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.

  1. foldMapWithKey :: Semigroup m => (k -> a -> m) -> NEMap k a -> m

    nonempty-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.

  2. insertMaxMap :: k -> a -> Map k a -> Map k a

    nonempty-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.

  3. insertMinMap :: k -> a -> Map k a -> Map k a

    nonempty-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.

  4. nemMap :: NEMap k a -> !Map k a

    nonempty-containers Data.Map.NonEmpty.Internal

    No documentation available.

  5. 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")]))
    

  6. toMap :: NEMap k a -> Map k a

    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")]
    

  7. foldMapWithIndex :: Semigroup m => (Int -> a -> m) -> NESeq a -> m

    nonempty-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.

  8. foldMapWithIndex :: Semigroup m => (Int -> a -> m) -> NESeq a -> m

    nonempty-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.

  9. combineDMapsWithKey :: GCompare f => (forall (a :: k) . () => f a -> These (g a) (h a) -> i a) -> DMap f g -> DMap f h -> DMap f i

    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.

  10. dmapToIntMap :: DMap (Const2 Key v) Identity -> IntMap v

    patch Data.Functor.Misc

    Convert a DMap to an IntMap

Page 958 of many | Previous | Next