Giter Site home page Giter Site logo

strict-containers's People

Contributors

infinity0 avatar sjakobi avatar erikd avatar

Stargazers

Ilmari Vacklin avatar Josh Miller avatar  avatar

Watchers

 avatar James Cloos avatar  avatar

strict-containers's Issues

review HashSet

containers' Set is defined as a separate data type where every field is strict so it is obvious there is no value to defining a "more strict" one here, since it would be exactly the same.

OTOH, unordered-containers' HashSet is defined as a newtype wrapper around HashMap _ (). Because HashMap internally uses a primitive Array# which is lazy in its contents, this means that HashSet may contain thunks even when the values are all (). This could be what's behind haskell-unordered-containers/unordered-containers#70.

If we instead define HashSet from our stricter HashMap, whose array operations all force the value, then we can avoid this potential problem.

Add to stackage

Thanks for this package. It would be convenient for to have it on Stackage.

Could you open an MR with Stackage to add it to the package set?

I understand that this adds a further maintenance burden, so if you'd like I can maintain the Stackage entry and open MR's here when bounds need to be updated, etc.

Seq: make whole/part-container transforms such as fmap strict

As described in the latest documentation. Possible candidates beyond fmap:

  • scan*
  • update, insertAt, and anything else we might've missed with a similar type signature -> a .. -> (Seq a, *).
  • dynamic constructors e.g. from*, replicate*, iterateN. although the documentation says they are O(n), from a quick reading of the source code it seems this really means "only if someone actually evaluates the whole thing e.g. by printing it", since the lazy parts of the Deep structure stay lazy

Some technical details in haskell/containers#752

Doesn't compile with GHC 9.4.2 due to the upper bound on hashable

Adding --allow-newer=strict-containers:hashable makes it compile. Without it, I'm getting

[__1] trying: strict-containers-0.1 (dependency of horde-ad)
[__2] next goal: hashable (dependency of strict-containers)
[__2] rejecting: hashable-1.4.1.0 (conflict: strict-containers =>
hashable>=1.2.7.0 && <1.4)
[__2] skipping: hashable-1.4.0.2, hashable-1.4.0.1, hashable-1.4.0.0 (has the
same characteristics that caused the previous version to fail: excluded by
constraint '>=1.2.7.0 && <1.4' from 'strict-containers')
[__2] trying: hashable-1.3.5.0
[__3] next goal: base (dependency of horde-ad)
[__3] rejecting: base-4.17.0.0/installed-4.17.0.0 (conflict: hashable =>
base>=4.5 && <4.17)

Doesn't compile with vector-0.13 (with --allow-newer in order to ignore the bound from .cabal)

Compiles fine with vector-0.12.3.1. The failure is

[41 of 44] Compiling Data.Strict.Vector.Autogen.Mutable ( src/Data/Strict/Vector/Autogen/Mutable.hs, dist/build/Data/Strict/Vector/Autogen/Mutable.o, dist/build/Data/Strict/Vector/Autogen/Mutable.dyn_o )

src/Data/Strict/Vector/Autogen/Mutable.hs:161:3: error:
    Data constructor not in scope:
      INTERNAL_CHECK :: t2 -> String -> String -> Bool -> m2 () -> m ()
    |
161 |   INTERNAL_CHECK(check) "moveBackwards" "not a backwards move" (dstOff < srcOff)
    |   ^^^^^^^^^^^^^^

src/Data/Strict/Vector/Autogen/Mutable.hs:161:18: error:
    Variable not in scope: check
    |
161 |   INTERNAL_CHECK(check) "moveBackwards" "not a backwards move" (dstOff < srcOff)
    |                  ^^^^^

src/Data/Strict/Vector/Autogen/Mutable.hs:168:3: error:
    Data constructor not in scope:
      INTERNAL_CHECK :: t1 -> String -> String -> Bool -> m1 () -> m ()
    |
168 |   INTERNAL_CHECK(check) "moveForwardsSmallOverlap" "not a forward move" (dstOff > srcOff)
    |   ^^^^^^^^^^^^^^

src/Data/Strict/Vector/Autogen/Mutable.hs:168:18: error:
    Variable not in scope: check
    |
168 |   INTERNAL_CHECK(check) "moveForwardsSmallOverlap" "not a forward move" (dstOff > srcOff)
    |                  ^^^^^

src/Data/Strict/Vector/Autogen/Mutable.hs:179:3: error:
    Data constructor not in scope:
      INTERNAL_CHECK :: t0 -> String -> String -> Bool -> m0 () -> m ()
    |
179 |   INTERNAL_CHECK(check) "moveForwardsLargeOverlap" "not a forward move" (dstOff > srcOff)
    |   ^^^^^^^^^^^^^^

src/Data/Strict/Vector/Autogen/Mutable.hs:179:18: error:
    Variable not in scope: check
    |
179 |   INTERNAL_CHECK(check) "moveForwardsLargeOverlap" "not a forward move" (dstOff > srcOff)
    |                  ^^^^^
Error: cabal: Failed to build strict-containers-0.1 (which is required by
test:shortTestForCI from horde-ad-0.1.0.0, test:minimalTest from
horde-ad-0.1.0.0 and others). See the build log above for details.

add tests

Would be good to copy the tests over here too and run them

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.