Portability | GHC |
---|---|

Stability | experimental |

Maintainer | emw4@rice.edu |

Safe Haskell | Safe-Infered |

Vectors indexed by a type list

- data MapC f c where
- empty :: MapC f Nil
- singleton :: f a -> MapC f (Nil :> a)
- lookup :: Member c a -> MapC f c -> f a
- mapC :: (forall x. f x -> g x) -> MapC f c -> MapC g c
- mapC2 :: (forall x. f x -> g x -> h x) -> MapC f c -> MapC g c -> MapC h c
- append :: MapC f c1 -> MapC f c2 -> MapC f (c1 :++: c2)
- mkAppend :: MapC f c2 -> Append c1 c2 (c1 :++: c2)
- mkMonoAppend :: Proxy c1 -> MapC f c2 -> Append c1 c2 (c1 :++: c2)
- split :: Append c1 c2 c -> MapC f c -> (MapC f c1, MapC f c2)
- proxy :: MapC f c -> Proxy c
- members :: MapC f c -> MapC (Member c) c
- replace :: MapC f c -> Member c a -> f a -> MapC f c

# Documentation

A `MapC f c`

is a vector with exactly one element of type `f a`

for
each type `a`

in the type list `c`

.

mapC :: (forall x. f x -> g x) -> MapC f c -> MapC g cSource

Map a function to all elements of a `MapC`

vector.

mapC2 :: (forall x. f x -> g x -> h x) -> MapC f c -> MapC g c -> MapC h cSource

Map a binary function to all pairs of elements of two `MapC`

vectors.

split :: Append c1 c2 c -> MapC f c -> (MapC f c1, MapC f c2)Source

Split a `MapC`

vector into two pieces.