| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Data.Type.Witness.Specific.WitnessMap.For
Synopsis
- newtype WitnessMapFor (f :: k -> Type) (w :: k -> Type) = MkWitnessMapFor {
- witnessMapForToList :: [SomeFor f w]
- emptyWitnessMapFor :: forall {k} (f :: k -> Type) (w :: k -> Type). WitnessMapFor f w
- witnessMapForLookup :: forall {k} w (a :: k) f. TestEquality w => w a -> WitnessMapFor f w -> Maybe (f a)
- witnessMapForModify :: forall {k} w (a :: k) f. TestEquality w => w a -> (f a -> f a) -> WitnessMapFor f w -> WitnessMapFor f w
- witnessMapForReplace :: forall {k} w (a :: k) f. TestEquality w => w a -> f a -> WitnessMapFor f w -> WitnessMapFor f w
- witnessMapForAdd :: forall {k} w (a :: k) f. w a -> f a -> WitnessMapFor f w -> WitnessMapFor f w
- witnessMapForSingle :: forall {k} w (a :: k) f. w a -> f a -> WitnessMapFor f w
- witnessMapForFold :: forall {k} m f w. Monoid m => WitnessMapFor f w -> (forall (a :: k). w a -> f a -> m) -> m
- witnessMapForRemove :: forall {k} w (a :: k) (f :: k -> Type). TestEquality w => w a -> WitnessMapFor f w -> WitnessMapFor f w
- witnessMapForFromList :: forall {k} (f :: k -> Type) (w :: k -> Type). [SomeFor f w] -> WitnessMapFor f w
- witnessMapForMapM :: forall {k} m f g (w :: k -> Type). Applicative m => (forall (a :: k). f a -> m (g a)) -> WitnessMapFor f w -> m (WitnessMapFor g w)
Documentation
newtype WitnessMapFor (f :: k -> Type) (w :: k -> Type) Source #
A dictionary that is heterogenous up to its simple witness type w.
Witnesses are the keys of the dictionary, and the values they witness are the values of the dictionary.
Constructors
| MkWitnessMapFor | |
Fields
| |
Instances
| Monoid (WitnessMapFor f w) Source # | |
Defined in Data.Type.Witness.Specific.WitnessMap.For Methods mempty :: WitnessMapFor f w # mappend :: WitnessMapFor f w -> WitnessMapFor f w -> WitnessMapFor f w # mconcat :: [WitnessMapFor f w] -> WitnessMapFor f w # | |
| Semigroup (WitnessMapFor f w) Source # | |
Defined in Data.Type.Witness.Specific.WitnessMap.For Methods (<>) :: WitnessMapFor f w -> WitnessMapFor f w -> WitnessMapFor f w # sconcat :: NonEmpty (WitnessMapFor f w) -> WitnessMapFor f w # stimes :: Integral b => b -> WitnessMapFor f w -> WitnessMapFor f w # | |
emptyWitnessMapFor :: forall {k} (f :: k -> Type) (w :: k -> Type). WitnessMapFor f w Source #
An empty dictionary.
witnessMapForLookup :: forall {k} w (a :: k) f. TestEquality w => w a -> WitnessMapFor f w -> Maybe (f a) Source #
Look up the first value in the dictionary that matches the given witness.
witnessMapForModify :: forall {k} w (a :: k) f. TestEquality w => w a -> (f a -> f a) -> WitnessMapFor f w -> WitnessMapFor f w Source #
Modify the first value in the dictionary that matches a particular witness.
witnessMapForReplace :: forall {k} w (a :: k) f. TestEquality w => w a -> f a -> WitnessMapFor f w -> WitnessMapFor f w Source #
Replace the first value in the dictionary that matches the witness
witnessMapForAdd :: forall {k} w (a :: k) f. w a -> f a -> WitnessMapFor f w -> WitnessMapFor f w Source #
Add a witness and value as the first entry in the dictionary.
witnessMapForSingle :: forall {k} w (a :: k) f. w a -> f a -> WitnessMapFor f w Source #
A dictionary for a single witness and value
witnessMapForFold :: forall {k} m f w. Monoid m => WitnessMapFor f w -> (forall (a :: k). w a -> f a -> m) -> m Source #
witnessMapForRemove :: forall {k} w (a :: k) (f :: k -> Type). TestEquality w => w a -> WitnessMapFor f w -> WitnessMapFor f w Source #
Remove the first entry in the dictionary that matches the given witness.
witnessMapForFromList :: forall {k} (f :: k -> Type) (w :: k -> Type). [SomeFor f w] -> WitnessMapFor f w Source #
Create a dictionary from a list of witness/value pairs
witnessMapForMapM :: forall {k} m f g (w :: k -> Type). Applicative m => (forall (a :: k). f a -> m (g a)) -> WitnessMapFor f w -> m (WitnessMapFor g w) Source #