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

Data.Type.Witness.Specific.OrderedWitnessMap.For

Synopsis

Documentation

newtype OrderedWitnessMapFor 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.

Constructors

MkOrderedWitnessMapFor (Map (Some w) (SomeFor f w)) 

orderedWitnessMapForLookup :: TestOrder w => w a -> OrderedWitnessMapFor f w -> Maybe (f a) Source #

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

orderedWitnessMapForModify :: forall f w a. TestOrder w => w a -> (f a -> f a) -> OrderedWitnessMapFor f w -> OrderedWitnessMapFor f w Source #

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

orderedWitnessMapForReplace :: TestOrder w => w a -> f a -> OrderedWitnessMapFor f w -> OrderedWitnessMapFor f w Source #

Replace the value in the dictionary that matches the witness

orderedWitnessMapForAdd :: TestOrder w => w a -> f a -> OrderedWitnessMapFor f w -> OrderedWitnessMapFor f w Source #

Add a witness and value to the dictionary.

orderedWitnessMapForSingle :: w a -> f a -> OrderedWitnessMapFor f w Source #

A dictionary for a single witness and value

orderedWitnessMapForFold :: Monoid m => OrderedWitnessMapFor f w -> (forall a. w a -> f a -> m) -> m Source #

orderedWitnessMapForRemove :: TestOrder w => w a -> OrderedWitnessMapFor f w -> OrderedWitnessMapFor f w Source #

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

orderedWitnessMapForFromList :: TestOrder w => [SomeFor f w] -> OrderedWitnessMapFor f w Source #

Create a dictionary from a list of witness/value pairs

orderedWitnessMapForMapM :: Applicative m => (forall a. f a -> m (g a)) -> OrderedWitnessMapFor f w -> m (OrderedWitnessMapFor g w) Source #