- newtype WitnessFDict w f = MkWitnessFDict [AnyF w f]
- emptyWitnessFDict :: WitnessFDict w f
- witnessFDictLookup :: SimpleWitness w => w a -> WitnessFDict w f -> Maybe (f a)
- witnessFDictModify :: SimpleWitness w => w a -> (f a -> f a) -> WitnessFDict w f -> WitnessFDict w f
- witnessFDictReplace :: SimpleWitness w => w a -> f a -> WitnessFDict w f -> WitnessFDict w f
- witnessFDictAdd :: w a -> f a -> WitnessFDict w f -> WitnessFDict w f
- witnessFDictRemove :: SimpleWitness w => w a -> WitnessFDict w f -> WitnessFDict w f
- witnessFDictFromList :: SimpleWitness w => [AnyF w f] -> WitnessFDict w f
Documentation
newtype WitnessFDict w f 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.
MkWitnessFDict [AnyF w f] |
emptyWitnessFDict :: WitnessFDict w fSource
An empty dictionary.
witnessFDictLookup :: SimpleWitness w => w a -> WitnessFDict w f -> Maybe (f a)Source
Look up the first value in the dictionary that matches the given witness.
witnessFDictModify :: SimpleWitness w => w a -> (f a -> f a) -> WitnessFDict w f -> WitnessFDict w fSource
Modify the first value in the dictionary that matches a particular witness.
witnessFDictReplace :: SimpleWitness w => w a -> f a -> WitnessFDict w f -> WitnessFDict w fSource
Replace the first value in the dictionary that matches the witness
witnessFDictAdd :: w a -> f a -> WitnessFDict w f -> WitnessFDict w fSource
Add a witness and value as the first entry in the dictionary.
witnessFDictRemove :: SimpleWitness w => w a -> WitnessFDict w f -> WitnessFDict w fSource
Remove the first entry in the dictionary that matches the given witness.
witnessFDictFromList :: SimpleWitness w => [AnyF w f] -> WitnessFDict w fSource
Create a dictionary from a list of witness/value pairs