witness-0.6.1: values that witness types
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Type.Witness.Specific.WitnessMap.Of

Synopsis

Documentation

type WitnessMapOf = WitnessMapFor Identity 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.

emptyWitnessMapOf :: WitnessMapOf w Source #

An empty dictionary.

witnessMapOfLookup :: TestEquality w => w a -> WitnessMapOf w -> Maybe a Source #

Look up the first value in the dictionary that matches the given witness.

witnessMapOfModify :: TestEquality w => w a -> (a -> a) -> WitnessMapOf w -> WitnessMapOf w Source #

Modify the first value in the dictionary that matches a particular witness.

witnessMapOfReplace :: TestEquality w => w a -> a -> WitnessMapOf w -> WitnessMapOf w Source #

Replace the first value in the dictionary that matches the witness

witnessMapOfFold :: Monoid m => WitnessMapOf w -> (forall a. w a -> a -> m) -> m Source #

witnessMapOfAdd :: w a -> a -> WitnessMapOf w -> WitnessMapOf w Source #

Add a witness and value as the first entry in the dictionary.

witnessMapOfRemove :: TestEquality w => w a -> WitnessMapOf w -> WitnessMapOf w Source #

Remove the first entry in the dictionary that matches the given witness.

witnessMapOfFromList :: [SomeOf w] -> WitnessMapOf w Source #

Create a dictionary from a list of witness/value pairs