-
Notifications
You must be signed in to change notification settings - Fork 24
Closed
Description
I'm currently working on abag<'T> in an effort to find some equivalent to seq<'T> for adaptive.
Since order is hard to maintain adaptively (and alist already does that) we need some sort of unordered collection that does not care about duplicate elements (nor hash anything). I coined the term bag but I'm not entirely happy with it, so suggestions would be very welcome.
I implemented all the basic combinators I could come up with here and the current implementation gives rise to a few questions:
- I need to create unique-ids for all elements in the bag in order to support removal. The only other alternative I could think of is a reference-counting HashSet where we could count the duplicates (but this would require hashing/etc on elements)
- A clean way of using heterogenous keys would be really nice since
alistandamapalready contain unique-identifiers for each element but constantly boxing/unboxig all keys could be costly. So either cache unique-ids for each input-key (Index/amap-key) or useobjas key and live with boxing/unboxing in many places
More questions to come but if anyone has ideas/requests or spots problems feel free to comment
Metadata
Metadata
Assignees
Labels
No labels