Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- newtype WitnessMapFor f w = MkWitnessMapFor {
- witnessMapForToList :: [SomeFor f w]
- emptyWitnessMapFor :: WitnessMapFor f w
- witnessMapForLookup :: TestEquality w => w a -> WitnessMapFor f w -> Maybe (f a)
- witnessMapForModify :: TestEquality w => w a -> (f a -> f a) -> WitnessMapFor f w -> WitnessMapFor f w
- witnessMapForReplace :: TestEquality w => w a -> f a -> WitnessMapFor f w -> WitnessMapFor f w
- witnessMapForAdd :: w a -> f a -> WitnessMapFor f w -> WitnessMapFor f w
- witnessMapForSingle :: w a -> f a -> WitnessMapFor f w
- witnessMapForFold :: Monoid m => WitnessMapFor f w -> (forall a. w a -> f a -> m) -> m
- witnessMapForRemove :: TestEquality w => w a -> WitnessMapFor f w -> WitnessMapFor f w
- witnessMapForFromList :: [SomeFor f w] -> WitnessMapFor f w
- witnessMapForMapM :: Applicative m => (forall a. f a -> m (g a)) -> WitnessMapFor f w -> m (WitnessMapFor g w)
Documentation
newtype WitnessMapFor f w 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.
MkWitnessMapFor | |
|
Instances
Monoid (WitnessMapFor f w) Source # | |
Defined in Data.Type.Witness.Specific.WitnessMap.For 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 (<>) :: 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 :: WitnessMapFor f w Source #
An empty dictionary.
witnessMapForLookup :: 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 :: 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 :: 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 :: w a -> f a -> WitnessMapFor f w -> WitnessMapFor f w Source #
Add a witness and value as the first entry in the dictionary.
witnessMapForSingle :: w a -> f a -> WitnessMapFor f w Source #
A dictionary for a single witness and value
witnessMapForFold :: Monoid m => WitnessMapFor f w -> (forall a. w a -> f a -> m) -> m Source #
witnessMapForRemove :: TestEquality w => w a -> WitnessMapFor f w -> WitnessMapFor f w Source #
Remove the first entry in the dictionary that matches the given witness.
witnessMapForFromList :: [SomeFor f w] -> WitnessMapFor f w Source #
Create a dictionary from a list of witness/value pairs
witnessMapForMapM :: Applicative m => (forall a. f a -> m (g a)) -> WitnessMapFor f w -> m (WitnessMapFor g w) Source #