| Copyright | © 2022–2026 Jonathan Knowles |
|---|---|
| License | Apache-2.0 |
| Safe Haskell | None |
| Language | Haskell2010 |
Data.MonoidMap.Internal.NonNullMap
Contents
Description
Provides the NonNullMap type and related functions.
This module is intended to be imported qualified:
import Data.MonoidMap.Internal.NonNullMap (NonNullMap (..)) import Data.MonoidMap.Internal.NonNullMap qualified as NonNullMap
Synopsis
- newtype NonNullMap k v = NonNullMap (Map k (NonNull v))
- fromMap :: MonoidNull v => Map k v -> NonNullMap k v
- fromMapWith :: MonoidNull v2 => (v1 -> v2) -> Map k v1 -> NonNullMap k v2
- toMap :: NonNullMap k v -> Map k v
Type
newtype NonNullMap k v Source #
A map of NonNull values.
Other types with the same representation (such as MonoidMap from the
monoidmap package) can derive instances via this type, without access
to the data constructor of NonNull.
Constructors
| NonNullMap (Map k (NonNull v)) |
Instances
Construction
fromMap :: MonoidNull v => Map k v -> NonNullMap k v Source #
Constructs a NonNullMap from an ordinary Map, removing all
null values.
This function selects which of the implementations in
Data.MonoidMap.Internal.NonNullMap.FromMap is used by the public fromMap
function of the monoidmap package.
fromMapWith :: MonoidNull v2 => (v1 -> v2) -> Map k v1 -> NonNullMap k v2 Source #
Constructs a NonNullMap from an ordinary Map, applying the given
function to all values, and removing all null values.
This function selects which of the implementations in
Data.MonoidMap.Internal.NonNullMap.FromMapWith is used by the public
fromMapWith function of the monoidmap package.
Deconstruction
toMap :: NonNullMap k v -> Map k v Source #
Converts a NonNullMap into an ordinary map.