Comments (4)
To really get the efficiency right, we'd have to make the Bin
constructor lazy in the child maps, and strictify other code appropriately (perhaps using a smart constructor). We'd need to run some benchmarks to make sure that didn't cause problems.
from containers.
I am not sure this is worth it, i.e., do people construct IntMap
s in such a way? Would they use fromFunction
instead of something trivial like fromList [(i, f i) | i<-[1..100]]
?
Also it is not obvious what is the right type of fromFunction
-- should we support different step-size than one? If we do, should arguments of fromFunction :: Int -> Int -> Int -> (Int -> a) -> IntMap a
be
- lower_bound step upper_bound
- lower_bound step number_of_elements
- lower_bound upper_bound step
- lower_bound number_of_elements step
It is a shame we cannot easily use the [1,3..10]
syntax :-)
Also note that if we do this, maybe we should create an equivalent function in IntSet
, something like fromRange :: ... -> IntSet
.
If you want to pursue this, please propose to [email protected].
from containers.
We would need to explain, in the documentation, the rather substantial difference in performance characteristics. We also need to do this for Data.Sequence
, in fact.
from containers.
I have since decided the required laziness is probably going to be way too much trouble to manage and also likely detrimental to performance.
from containers.
Related Issues (20)
- Symmetric difference for sets
- Incorrect order of Applicative actions in mergeA when using filterAMissing HOT 2
- Fusible IntSet.fromDistinctAscList definition HOT 3
- NonEmpty for CyclicSCC HOT 11
- better instance Hashable IntSet? HOT 8
- Unusual definition of foldrBits and foldlBits HOT 3
- Unnecessary CPP and C header in `Data.Map.Internal.Debug.html`?
- Release for GHC 9.8.1 HOT 17
- feat request: Add `popLeftWithValue` and `popWithValue` in `Data.Sequence` HOT 5
- Data.Graph: detect cycles utility functions HOT 2
- Data.Map.mergeWithKey doesn't match documentation
- Flag to introduce pedantic invariant checks? HOT 2
- Map.unionWith is over specialized and not consistent with intersectionWith HOT 10
- Add `flattenSCC1 : SCC vertex -> Data.List.NonEmpty.NonEmpty vertex` HOT 2
- Data.Map.Internal does not export insertMin
- Repo: remove merged branches?
- Contribution guide outdated?
- Potential memory optimization for IntMap and IntSet HOT 8
- Errors when trying to generate a test coverage report HOT 10
- Full IntSets? HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from containers.