mkTyCon, -- :: String -> TyCon
mkAppTy, -- :: TyCon -> [TypeRep] -> TypeRep
mkFunTy, -- :: TypeRep -> TypeRep -> TypeRep
- applyTy -- :: TypeRep -> TypeRep -> Maybe TypeRep
+ applyTy, -- :: TypeRep -> TypeRep -> Maybe TypeRep
+
+ -- * Observation of type representations
+ typerepTyCon, -- :: TypeRep -> TyCon
+ typerepArgs, -- :: TypeRep -> [TypeRep]
+ tyconString -- :: TyCon -> String
+
) where
+----------------- Observation ---------------------
+
+
+-- | Observe the type constructor of a type representation
+typerepTyCon :: TypeRep -> TyCon
+typerepTyCon (TypeRep _ tc _) = tc
+
+
+-- | Observe the argument types of a type representation
+typerepArgs :: TypeRep -> [TypeRep]
+typerepArgs (TypeRep _ _ args) = args
+
+
+-- | Observe string encoding of a type representation
+tyconString :: TyCon -> String
+tyconString (TyCon _ str) = str
+
+
----------------- Showing TypeReps --------------------
instance Show TypeRep where