hetero-map-0.10: Pure heterogeneous maps.

HeteroMap.Map

Synopsis

Documentation

data Key x a Source

A Key in a heterogeneous map. x is the key identifier type, which ensures that we don't look up a key in a map that doesn't have it.

newKey :: (forall x. Key x a -> b) -> bSource

Allocate a new key, which is only valid within the passed function (and will be a type error if it tries to escape).

data Map xs Source

A heterogeneous map, including keys xs.

singleton :: Key x a -> a -> Map (x, ())Source

insert :: Key x a -> a -> Map xs -> Map (x, xs)Source

lookup :: In x xs => Key x a -> Map xs -> aSource

overwrite :: In x xs => Key x a -> a -> Map xs -> Map xsSource

Same as insert, except does not add the key identifier to the map, instead ensuring that it's already there.

union :: Map xs -> Map ys -> Map (Union xs ys)Source