open-typerep-0.4: Open type representations and dynamic types

Safe HaskellNone
LanguageHaskell2010

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 ab

But 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

tup3 :: (Tuple :<: sym, TupleType :<: t) => ASTF (sym :&: TypeRep t) a -> ASTF (sym :&: TypeRep t) b -> ASTF (sym :&: TypeRep t) c -> ASTF (sym :&: TypeRep t) (a, b, c) Source

tup4 :: (Tuple :<: sym, TupleType :<: t) => ASTF (sym :&: TypeRep t) a -> ASTF (sym :&: TypeRep t) b -> ASTF (sym :&: TypeRep t) c -> ASTF (sym :&: TypeRep t) d -> ASTF (sym :&: TypeRep t) (a, b, c, d) Source