purescript-ordered-collections
purescript-ordered-collections copied to clipboard
Purely functional map and set data structures
Per #71, an attempt was made to add `Bifunctor` to `Map`. While the implementation could be written that would type-check, the issue is that implementation wouldn't maintain the `Ord` invariant....
Can `mapWithKey` be added for the times that you want to keep all items (opposed to `mapMaybeWithKey`)?
At work we newtype `Map` in a manner analogous to `Data.Set.NonEmpty.NonEmptySet`, copying the API of `Data.Map.Internal` without `empty` and dealing with partial functions by returning `Maybe (NonEmptyMap k v)`. I'm...
As per @fehrenbach in https://github.com/purescript/purescript-ordered-collections/pull/5#discussion_r219065421: ``` purescript unionWith :: forall k a b c. Ord k => (a -> b -> c) -> Map k a -> Map k b...
See https://github.com/purescript/purescript-ordered-collections/issues/36#issuecomment-1069673833 Remove `SemigroupMap`
See https://github.com/purescript/purescript-ordered-collections/issues/36#issuecomment-1069673833 - remove `Warn` on `Map`'s `Semigroup` and `Monoid` instances. - add `Warn` on `SemigroupMap`'s `Semigroup` and `Monoid` instances. - add deprecation notice to `SemigroupMap`
As an example of another module `Data.HashMap` it says > Note that this is an unordered collection. https://pursuit.purescript.org/packages/purescript-unordered-collections/1.0.1/docs/Data.HashMap Such information would also be useful for the data structures in this...
Wanted to make this suggestion isn't forgotten after #31 is merged. ```purs annotateSet :: forall a b. (a -> b) -> Set a -> Map a b annotateSet f =...
Looks like this is only noted for [union](https://pursuit.purescript.org/packages/purescript-ordered-collections/1.6.1/docs/Data.Set#v:union).
We have `union`, `unions`, and `intersection`, but no `intersections`. I've been using this locally: ```purs intersections :: forall f a. Foldable f => Ord a => f (Set a) ->...