Hoogle Search
Within LTS Haskell 24.40 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
foldMapWithKey :: Semigroup m => (k -> a -> m) -> NEMap k a -> mnonempty-containers Data.Map.NonEmpty.Internal O(n). Fold the keys and values in the map using the given semigroup, such that
foldMapWithKey f = fold1 . mapWithKey f
This can be an asymptotically faster than foldrWithKey or foldlWithKey for some monoids.insertMaxMap :: k -> a -> Map k a -> Map k anonempty-containers Data.Map.NonEmpty.Internal O(log n). Insert new key and value into a map where keys are strictly less than the new key. That is, the new key must be strictly greater than all keys present in the Map. /The precondition is not checked./ While this has the same asymptotics as Data.Map.insert, it saves a constant factor for key comparison (so may be helpful if comparison is expensive) and also does not require an Ord instance for the key type.
insertMinMap :: k -> a -> Map k a -> Map k anonempty-containers Data.Map.NonEmpty.Internal O(log n). Insert new key and value into a map where keys are strictly greater than the new key. That is, the new key must be strictly less than all keys present in the Map. /The precondition is not checked./ While this has the same asymptotics as Data.Map.insert, it saves a constant factor for key comparison (so may be helpful if comparison is expensive) and also does not require an Ord instance for the key type.
nemMap :: NEMap k a -> !Map k anonempty-containers Data.Map.NonEmpty.Internal No documentation available.
nonEmptyMap :: Map k a -> Maybe (NEMap k a)nonempty-containers Data.Map.NonEmpty.Internal O(log n). Smart constructor for an NEMap from a Map. Returns Nothing if the Map was originally actually empty, and Just n with an NEMap, if the Map was not empty. nonEmptyMap and maybe empty toMap form an isomorphism: they are perfect structure-preserving inverses of eachother. See IsNonEmpty for a pattern synonym that lets you "match on" the possiblity of a Map being an NEMap.
nonEmptyMap (Data.Map.fromList [(3,"a"), (5,"b")]) == Just (fromList ((3,"a") :| [(5,"b")]))
-
nonempty-containers Data.Map.NonEmpty.Internal O(log n). Convert a non-empty map back into a normal possibly-empty map, for usage with functions that expect Map. Can be thought of as "obscuring" the non-emptiness of the map in its type. See the IsNotEmpty pattern. nonEmptyMap and maybe empty toMap form an isomorphism: they are perfect structure-preserving inverses of eachother.
toMap (fromList ((3,"a") :| [(5,"b")])) == Data.Map.fromList [(3,"a"), (5,"b")]
foldMapWithIndex :: Semigroup m => (Int -> a -> m) -> NESeq a -> mnonempty-containers Data.Sequence.NonEmpty O(n). A generalization of foldMap1, foldMapWithIndex takes a folding function that also depends on the element's index, and applies it to every element in the sequence.
foldMapWithIndex :: Semigroup m => (Int -> a -> m) -> NESeq a -> mnonempty-containers Data.Sequence.NonEmpty.Internal O(n). A generalization of foldMap1, foldMapWithIndex takes a folding function that also depends on the element's index, and applies it to every element in the sequence.
-
patch Data.Functor.Misc Union two DMaps of different types, yielding another type. Each key that is present in either input map will be present in the output.
dmapToIntMap :: DMap (Const2 Key v) Identity -> IntMap vpatch Data.Functor.Misc