| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Data.TypeRep.TH
- deriveRender_forType :: Name -> DecsQ
- deriveTypeEq :: Name -> DecsQ
- deriveWitness :: Name -> Name -> DecsQ
- derivePWitness :: Name -> Name -> DecsQ
- deriveWitnessAny :: Name -> DecsQ
- derivePWitnessAny :: Name -> DecsQ
- deriveWitnessTypeable :: Name -> DecsQ
- derivePWitnessTypeable :: Name -> DecsQ
Documentation
A version of deriveRender that applies typeName to each constructor
name. That is, e.g. the constructor Int_t :: IntType (Full Int) will be
rendered as "Int".
Derive TypeEq instance for a type representation
Derive Witness instance for a type representation
instance Witness Cl t t => Witness Cl Ty t where
witSym Con1 Nil = Dict
witSym Con2 (a :* b :* Nil) =
case wit (Proxy :: Proxy Cl) (TypeRep a) of
Dict -> case wit (Proxy :: Proxy Cl) (TypeRep b) of
Dict -> DictDerive PWitness instance for a type representation
instance PWitness Cl t t => PWitness Cl Ty t where
pwitSym Con1 Nil = return Dict
pwitSym Con2 (a :* b :* Nil) = do
Dict <- pwit (Proxy :: Proxy Cl) (TypeRep a)
Dict <- pwit (Proxy :: Proxy Cl) (TypeRep b)
return DictDerive instance for a type representationPWitness (Typeable Ty)
instance (Ty :<: t) => PWitness (Typeable t) Ty t where
pwitSym Con1 Nil = return Dict
pwitSym Con2 (a :* b :* Nil) = do
Dict <- pwit (Proxy :: Proxy (Typeable t)) (TypeRep a)
Dict <- pwit (Proxy :: Proxy (Typeable t)) (TypeRep b)
return Dict