Deserializing maps and sets
- Dominant language
- Haskell
- Stars
- 355
- Forks
- 194
- Avg merge
- 3d 4h
- Merged PRs (30d)
- 4
Description
`binary`, `cereal` and `store` all deserialize `Set`s, `IntSet`s, `Map`s and `IntMap`s via `fromDistinctAscList <$> deserializeList` or even `fromList <$> deserializeList` and I've been wondering if that's the best way to do it.
The problem seems to be that this will first completely build the intermediary list before the map or set is constructed from the list.
Instead, it seems to me that the set or map should be built by repeatedly inserting a single element.
Do you agree that this should save a lot of memory allocations?
What I think is missing from `containers` to support the alternative deserialization implementations is something like a `insertDistinctMax` function that can efficiently insert an element that is known to be strictly greater than all elements in the set/map.
Contributor guide
Assessment
This issue has not been assessed yet.