Portability | non-portable (GHC extensions) |
---|---|
Stability | experimental |
Maintainer | Manuel M T Chakravarty <chak@cse.unsw.edu.au> |
Safe Haskell | None |
Our representation of tuples are heterogenous snoc lists, which are typed by type lists, where '()' and '(,)' are type-level nil and snoc, respectively. The components may only be drawn from types that can be used as array elements.
- data Tuple c t where
- data TupleIdx t e where
- ZeroTupIdx :: Elt s => TupleIdx (t, s) s
- SuccTupIdx :: TupleIdx t e -> TupleIdx (t, s) e
- class IsTuple tup where
Tuple representation
We represent tuples as heterogenous lists, typed by a type list.
Type-safe projection indicies for tuples.
NB: We index tuples by starting to count from the *right*!
ZeroTupIdx :: Elt s => TupleIdx (t, s) s | |
SuccTupIdx :: TupleIdx t e -> TupleIdx (t, s) e |
Conversion between surface n-tuples and our tuple representation.