| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Language.Syntactic.TypeRep.TupleConversion
Description
Construction and elimination of tuples
Something similar can be achieved using the Syntactic instances from
Language.Syntactic.TypeRep.Sugar.TupleTR, e.g:
sel1' :: forall sym t a b
. ( Typeable t a
, Typeable t b
, Tuple :<: sym
, TupleType :<: t
)
=> ASTF (sym :&: TypeRep t) (a,b) -> ASTF (sym :&: TypeRep t) a
sel1' ab = a
where
(a, _ :: ASTF (sym :&: TypeRep t) b) = sugar abBut the point of this module is to do it without the Typeable constraint.
Documentation
sel1 :: (Tuple :<: sym, TupleType :<: t) => ASTF (sym :&: TypeRep t) tup -> ASTF (sym :&: TypeRep t) (Sel1 tup) Source
sel2 :: (Tuple :<: sym, TupleType :<: t) => ASTF (sym :&: TypeRep t) tup -> ASTF (sym :&: TypeRep t) (Sel2 tup) Source
sel3 :: (Tuple :<: sym, TupleType :<: t) => ASTF (sym :&: TypeRep t) tup -> ASTF (sym :&: TypeRep t) (Sel3 tup) Source
sel4 :: (Tuple :<: sym, TupleType :<: t) => ASTF (sym :&: TypeRep t) tup -> ASTF (sym :&: TypeRep t) (Sel4 tup) Source
tup2 :: (Tuple :<: sym, TupleType :<: t) => ASTF (sym :&: TypeRep t) a -> ASTF (sym :&: TypeRep t) b -> ASTF (sym :&: TypeRep t) (a, b) Source