-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Open type representations and dynamic types -- -- This package uses Data Types à la Carte to provide open type -- representations and dynamic types/coercions for open type universes. -- -- Example 1 (dynamic types): -- --
-- type MyUniverse = IntType :+: BoolType -- -- hlist :: [Dynamic MyUniverse] -- hlist = [toDyn True, toDyn (1 :: Int)] ---- --
-- *Main> hlist -- [True,1] ---- -- Note that if we were using Data.Dynamic, it would just print -- --
-- [<<Bool>>,<<Int>>] ---- -- Example 2 (dynamically typed addition): -- --
-- addDyn :: (TypeEq ts ts, PWitness Num ts ts) => Dynamic ts -> Dynamic ts -> Maybe (Dynamic ts) -- addDyn (Dyn ta a) (Dyn tb b) = do -- Dict <- typeEq ta tb -- Dict <- pwit pNum ta -- return (Dyn ta (a+b)) ---- -- Data.Dynamic could only do this monomorphically, for one -- Num type at a time. @package open-typerep @version 0.6 -- | Open type representations and dynamic types module Data.TypeRep.Representation -- | Full-indexed type representation type TR = AST -- | This class provides reification of type a in a universe -- t. Typeable t a means that a is in -- the type universe represented by t. class Typeable t a typeRep' :: Typeable t a => TR t (Full a) -- | Representation of type a in a type universe t -- -- This type can also be seen as a witness that a is a member of -- t (i.e. Typeable t a); see -- witTypeable. newtype TypeRep t a TypeRep :: TR t (Full a) -> TypeRep t a [unTypeRep] :: TypeRep t a -> TR t (Full a) -- | Reification of type a in a type universe t typeRep :: Typeable t a => TypeRep t a -- | Equality on type representations class Render t => TypeEq t u typeEqSym :: TypeEq t u => (t sig1, Args (AST u) sig1) -> (t sig2, Args (AST u) sig2) -> Either String (Dict (DenResult sig1 ~ DenResult sig2)) -- | Equality on type representations typeEqM :: (TypeEq t t, MonadError String m) => TypeRep t a -> TypeRep t b -> m (Dict (a ~ b)) -- | Equality on type representations typeEq :: TypeEq t t => TypeRep t a -> TypeRep t b -> Maybe (Dict (a ~ b)) -- | Type constructor matching. This function makes it possible to match on -- type representations without dealing with the underlying AST -- representation. -- -- For example, to check that a TypeRep represents the type a -- -> Int for some a: -- --
-- is_atoi :: (TypeEq t t, IntType :<: t) => TypeRep t a -> Bool -- is_atoi t -- | [E ta, E tb] <- matchCon t -- , Just _ <- typeEq ta intType = True -- | otherwise = False --matchCon :: TypeRep t c -> [E (TypeRep t)] -- | Monadic version of matchCon -- --
-- matchConM = return . matchCon ---- -- matchConM is convenient when matching types in a monad, e.g.: -- --
-- do ... -- [E ta, E tb] <- matchConM t -- Dict <- typeEq ta tb -- ... --matchConM :: Monad m => TypeRep t c -> m [E (TypeRep t)] -- | Witness a type constraint for a reified type class Witness p t u witSym :: Witness p t u => t sig -> Args (AST u) sig -> Dict (p (DenResult sig)) -- | Partially witness a type constraint for a reified type class (ShowClass p, Render t) => PWitness p t u where pwitSym _ _ = throwError "" pwitSym :: PWitness p t u => t sig -> Args (AST u) sig -> Either String (Dict (p (DenResult sig))) -- | Default implementation of pwitSym for types that have a -- Witness instance pwitSymDefault :: Witness p t u => t sig -> Args (AST u) sig -> Either String (Dict (p (DenResult sig))) -- | Witness a type constraint for a reified type wit :: Witness p t t => Proxy p -> TypeRep t a -> Dict (p a) -- | Partially witness a type constraint for a reified type pwit :: (PWitness p t t, MonadError String m) => Proxy p -> TypeRep t a -> m (Dict (p a)) -- | Witness a Typeable constraint for a reified type witTypeable :: Witness (Typeable t) t t => TypeRep t a -> Dict (Typeable t a) -- | Partially witness a Typeable constraint for a reified type pwitTypeable :: PWitness (Typeable t) t t => TypeRep t a -> Either String (Dict (Typeable t a)) -- | Safe cast (does not use unsafeCoerce) cast :: (Typeable t a, Typeable t b, TypeEq t t) => Proxy t -> a -> Either String b -- | Safe generalized cast (does not use unsafeCoerce) gcast :: (Typeable t a, Typeable t b, TypeEq t t) => Proxy t -> c a -> Either String (c b) -- | Dynamic type parameterized on a type universe data Dynamic t Dyn :: TypeRep t a -> a -> Dynamic t toDyn :: Typeable t a => a -> Dynamic t fromDyn :: (Typeable t a, TypeEq t t) => Dynamic t -> Either String a -- | The universal class class Any a -- | Show the name of type classes class ShowClass (p :: * -> Constraint) -- | Show the name of a type class showClass :: ShowClass p => Proxy p -> String -- | Proxy of Any class. Can be passed to wit and -- pwit. pAny :: Proxy Any -- | Proxy of Typeable class (from the base library). Can be passed -- to wit and pwit. pDataTypeable :: Proxy Typeable -- | Proxy of Eq class. Can be passed to wit and pwit. pEq :: Proxy Eq -- | Proxy of Ord class. Can be passed to wit and -- pwit. pOrd :: Proxy Ord -- | Proxy of Show class. Can be passed to wit and -- pwit. pShow :: Proxy Show -- | Proxy of Num class. Can be passed to wit and -- pwit. pNum :: Proxy Num -- | Proxy of Integral class. Can be passed to wit and -- pwit. pIntegral :: Proxy Integral instance Language.Syntactic.Interpretation.Render t => GHC.Show.Show (Data.TypeRep.Representation.TypeRep t a) instance Language.Syntactic.Sugar.Syntactic (Data.TypeRep.Representation.TypeRep t a) instance (Data.TypeRep.Representation.TypeEq t1 t, Data.TypeRep.Representation.TypeEq t2 t) => Data.TypeRep.Representation.TypeEq (t1 Language.Syntactic.Syntax.:+: t2) t instance Data.TypeRep.Representation.TypeEq Language.Syntactic.Syntax.Empty t instance (Data.TypeRep.Representation.Witness p t1 t, Data.TypeRep.Representation.Witness p t2 t) => Data.TypeRep.Representation.Witness p (t1 Language.Syntactic.Syntax.:+: t2) t instance Data.TypeRep.Representation.Witness p t t => Data.TypeRep.Representation.Witness p (Language.Syntactic.Syntax.AST t) t instance (Data.TypeRep.Representation.PWitness p t1 t, Data.TypeRep.Representation.PWitness p t2 t) => Data.TypeRep.Representation.PWitness p (t1 Language.Syntactic.Syntax.:+: t2) t instance (Data.TypeRep.Representation.TypeEq t t, Data.TypeRep.Representation.Witness GHC.Classes.Eq t t) => GHC.Classes.Eq (Data.TypeRep.Representation.Dynamic t) instance Data.TypeRep.Representation.Witness GHC.Show.Show t t => GHC.Show.Show (Data.TypeRep.Representation.Dynamic t) instance Data.TypeRep.Representation.Any a instance Data.TypeRep.Representation.ShowClass Data.TypeRep.Representation.Any instance Data.TypeRep.Representation.ShowClass Data.Typeable.Internal.Typeable instance Data.TypeRep.Representation.ShowClass GHC.Classes.Eq instance Data.TypeRep.Representation.ShowClass GHC.Classes.Ord instance Data.TypeRep.Representation.ShowClass GHC.Show.Show instance Data.TypeRep.Representation.ShowClass GHC.Num.Num instance Data.TypeRep.Representation.ShowClass GHC.Real.Integral instance Data.TypeRep.Representation.ShowClass (Data.TypeRep.Representation.Typeable t) module Data.TypeRep.TH -- | 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". deriveRender_forType :: Name -> DecsQ -- | Derive TypeEq instance for a type representation deriveTypeEq :: Name -> DecsQ -- | 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 -> Dict --deriveWitness :: Name -> Name -> DecsQ -- | Derive 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 Dict --derivePWitness :: Name -> Name -> DecsQ -- | Derive Witness Any instance for a type -- representation -- --
-- instance Witness Any Ty t where -- witSym _ _ = Dict -- witSym _ _ = Dict --deriveWitnessAny :: Name -> DecsQ -- | Derive PWitness Any instance for a type -- representation -- --
-- instance PWitness Any Ty t where -- pwitSym _ _ = return Dict -- pwitSym _ _ = return Dict --derivePWitnessAny :: Name -> DecsQ -- | Derive Witness (Typeable Ty) instance for a -- type representation -- --
-- instance (Ty :<: t) => Witness (Typeable t) Ty t where -- witSym Con1 Nil = Dict -- witSym Con2 (a :* b :* Nil) = -- case wit (Proxy :: Proxy (Typeable t)) (TypeRep a) of -- Dict -> case wit (Proxy :: Proxy (Typeable t)) (TypeRep b) of -- Dict -> Dict --deriveWitnessTypeable :: Name -> DecsQ -- | Derive PWitness (Typeable Ty) instance for a -- type representation -- --
-- 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 --derivePWitnessTypeable :: Name -> DecsQ -- | Representations for signed and unsigned integer types -- -- The reason for using symbol names ending with _t is that -- deriveRender uses everything that comes before _ -- when rendering the constructor. module Data.TypeRep.Types.IntWord data IntWordType a Int8_t :: IntWordType (Full Int8) Int16_t :: IntWordType (Full Int16) Int32_t :: IntWordType (Full Int32) Int64_t :: IntWordType (Full Int64) Word8_t :: IntWordType (Full Word8) Word16_t :: IntWordType (Full Word16) Word32_t :: IntWordType (Full Word32) Word64_t :: IntWordType (Full Word64) int8Type :: (Syntactic a, IntWordType :<: Domain a, Internal a ~ Int8) => a int16Type :: (Syntactic a, IntWordType :<: Domain a, Internal a ~ Int16) => a int32Type :: (Syntactic a, IntWordType :<: Domain a, Internal a ~ Int32) => a int64Type :: (Syntactic a, IntWordType :<: Domain a, Internal a ~ Int64) => a word8Type :: (Syntactic a, IntWordType :<: Domain a, Internal a ~ Word8) => a word16Type :: (Syntactic a, IntWordType :<: Domain a, Internal a ~ Word16) => a word32Type :: (Syntactic a, IntWordType :<: Domain a, Internal a ~ Word32) => a word64Type :: (Syntactic a, IntWordType :<: Domain a, Internal a ~ Word64) => a instance Data.TypeRep.Representation.PWitness GHC.Real.Integral Data.TypeRep.Types.IntWord.IntWordType t instance Data.TypeRep.Representation.PWitness GHC.Num.Num Data.TypeRep.Types.IntWord.IntWordType t instance Data.TypeRep.Representation.PWitness GHC.Show.Show Data.TypeRep.Types.IntWord.IntWordType t instance Data.TypeRep.Representation.PWitness GHC.Classes.Ord Data.TypeRep.Types.IntWord.IntWordType t instance Data.TypeRep.Representation.PWitness GHC.Classes.Eq Data.TypeRep.Types.IntWord.IntWordType t instance Data.TypeRep.Representation.PWitness Data.Typeable.Internal.Typeable Data.TypeRep.Types.IntWord.IntWordType t instance Data.TypeRep.Representation.Witness GHC.Real.Integral Data.TypeRep.Types.IntWord.IntWordType t instance Data.TypeRep.Representation.Witness GHC.Num.Num Data.TypeRep.Types.IntWord.IntWordType t instance Data.TypeRep.Representation.Witness GHC.Show.Show Data.TypeRep.Types.IntWord.IntWordType t instance Data.TypeRep.Representation.Witness GHC.Classes.Ord Data.TypeRep.Types.IntWord.IntWordType t instance Data.TypeRep.Representation.Witness GHC.Classes.Eq Data.TypeRep.Types.IntWord.IntWordType t instance Data.TypeRep.Representation.Witness Data.Typeable.Internal.Typeable Data.TypeRep.Types.IntWord.IntWordType t instance Data.TypeRep.Representation.PWitness Data.TypeRep.Representation.Any Data.TypeRep.Types.IntWord.IntWordType t instance Data.TypeRep.Representation.Witness Data.TypeRep.Representation.Any Data.TypeRep.Types.IntWord.IntWordType t instance Data.TypeRep.Representation.TypeEq Data.TypeRep.Types.IntWord.IntWordType t instance Language.Syntactic.Interpretation.Render Data.TypeRep.Types.IntWord.IntWordType -- | Representations for specific types -- -- The reason for using symbol names ending with _t is that -- deriveRender uses everything that comes before _ -- when rendering the constructor. module Data.TypeRep.Types.Basic data BoolType a Bool_t :: BoolType (Full Bool) data CharType a Char_t :: CharType (Full Char) data IntType a Int_t :: IntType (Full Int) data FloatType a Float_t :: FloatType (Full Float) data DoubleType a Double_t :: DoubleType (Full Double) data ListType a List_t :: ListType (a :-> Full [a]) data FunType a Fun_t :: FunType (a :-> (b :-> Full (a -> b))) boolType :: (Syntactic a, BoolType :<: Domain a, Internal a ~ Bool) => a charType :: (Syntactic a, CharType :<: Domain a, Internal a ~ Char) => a intType :: (Syntactic a, IntType :<: Domain a, Internal a ~ Int) => a floatType :: (Syntactic a, FloatType :<: Domain a, Internal a ~ Float) => a doubleType :: (Syntactic a, DoubleType :<: Domain a, Internal a ~ Double) => a listType :: (Syntactic list, Syntactic elem, Domain list ~ Domain elem, ListType :<: Domain list, Internal list ~ [Internal elem], elem ~ c e, list ~ c l) => elem -> list funType :: (Syntactic fun, Syntactic a, Syntactic b, Domain fun ~ Domain a, Domain fun ~ Domain b, FunType :<: Domain fun, Internal fun ~ (Internal a -> Internal b), a ~ c x, b ~ c y, fun ~ c z) => a -> b -> fun instance Data.TypeRep.Representation.PWitness GHC.Real.Integral Data.TypeRep.Types.Basic.IntType t instance Data.TypeRep.Representation.PWitness GHC.Classes.Eq Data.TypeRep.Types.Basic.FunType t instance Data.TypeRep.Representation.PWitness GHC.Classes.Ord Data.TypeRep.Types.Basic.FunType t instance Data.TypeRep.Representation.PWitness GHC.Show.Show Data.TypeRep.Types.Basic.FunType t instance Data.TypeRep.Representation.PWitness GHC.Num.Num Data.TypeRep.Types.Basic.BoolType t instance Data.TypeRep.Representation.PWitness GHC.Num.Num Data.TypeRep.Types.Basic.CharType t instance Data.TypeRep.Representation.PWitness GHC.Num.Num Data.TypeRep.Types.Basic.ListType t instance Data.TypeRep.Representation.PWitness GHC.Num.Num Data.TypeRep.Types.Basic.FunType t instance Data.TypeRep.Representation.PWitness GHC.Real.Integral Data.TypeRep.Types.Basic.BoolType t instance Data.TypeRep.Representation.PWitness GHC.Real.Integral Data.TypeRep.Types.Basic.CharType t instance Data.TypeRep.Representation.PWitness GHC.Real.Integral Data.TypeRep.Types.Basic.FloatType t instance Data.TypeRep.Representation.PWitness GHC.Real.Integral Data.TypeRep.Types.Basic.DoubleType t instance Data.TypeRep.Representation.PWitness GHC.Real.Integral Data.TypeRep.Types.Basic.ListType t instance Data.TypeRep.Representation.PWitness GHC.Real.Integral Data.TypeRep.Types.Basic.FunType t instance Data.TypeRep.Representation.Witness GHC.Real.Integral Data.TypeRep.Types.Basic.IntType t instance Data.TypeRep.Representation.PWitness GHC.Num.Num Data.TypeRep.Types.Basic.DoubleType t instance Data.TypeRep.Representation.PWitness GHC.Num.Num Data.TypeRep.Types.Basic.FloatType t instance Data.TypeRep.Representation.PWitness GHC.Num.Num Data.TypeRep.Types.Basic.IntType t instance Data.TypeRep.Representation.Witness GHC.Num.Num Data.TypeRep.Types.Basic.DoubleType t instance Data.TypeRep.Representation.Witness GHC.Num.Num Data.TypeRep.Types.Basic.FloatType t instance Data.TypeRep.Representation.Witness GHC.Num.Num Data.TypeRep.Types.Basic.IntType t instance Data.TypeRep.Representation.PWitness GHC.Show.Show t t => Data.TypeRep.Representation.PWitness GHC.Show.Show Data.TypeRep.Types.Basic.ListType t instance Data.TypeRep.Representation.PWitness GHC.Show.Show Data.TypeRep.Types.Basic.DoubleType t instance Data.TypeRep.Representation.PWitness GHC.Show.Show Data.TypeRep.Types.Basic.FloatType t instance Data.TypeRep.Representation.PWitness GHC.Show.Show Data.TypeRep.Types.Basic.IntType t instance Data.TypeRep.Representation.PWitness GHC.Show.Show Data.TypeRep.Types.Basic.CharType t instance Data.TypeRep.Representation.PWitness GHC.Show.Show Data.TypeRep.Types.Basic.BoolType t instance Data.TypeRep.Representation.Witness GHC.Show.Show t t => Data.TypeRep.Representation.Witness GHC.Show.Show Data.TypeRep.Types.Basic.ListType t instance Data.TypeRep.Representation.Witness GHC.Show.Show Data.TypeRep.Types.Basic.DoubleType t instance Data.TypeRep.Representation.Witness GHC.Show.Show Data.TypeRep.Types.Basic.FloatType t instance Data.TypeRep.Representation.Witness GHC.Show.Show Data.TypeRep.Types.Basic.IntType t instance Data.TypeRep.Representation.Witness GHC.Show.Show Data.TypeRep.Types.Basic.CharType t instance Data.TypeRep.Representation.Witness GHC.Show.Show Data.TypeRep.Types.Basic.BoolType t instance Data.TypeRep.Representation.PWitness GHC.Classes.Ord t t => Data.TypeRep.Representation.PWitness GHC.Classes.Ord Data.TypeRep.Types.Basic.ListType t instance Data.TypeRep.Representation.PWitness GHC.Classes.Ord Data.TypeRep.Types.Basic.DoubleType t instance Data.TypeRep.Representation.PWitness GHC.Classes.Ord Data.TypeRep.Types.Basic.FloatType t instance Data.TypeRep.Representation.PWitness GHC.Classes.Ord Data.TypeRep.Types.Basic.IntType t instance Data.TypeRep.Representation.PWitness GHC.Classes.Ord Data.TypeRep.Types.Basic.CharType t instance Data.TypeRep.Representation.PWitness GHC.Classes.Ord Data.TypeRep.Types.Basic.BoolType t instance Data.TypeRep.Representation.Witness GHC.Classes.Ord t t => Data.TypeRep.Representation.Witness GHC.Classes.Ord Data.TypeRep.Types.Basic.ListType t instance Data.TypeRep.Representation.Witness GHC.Classes.Ord Data.TypeRep.Types.Basic.DoubleType t instance Data.TypeRep.Representation.Witness GHC.Classes.Ord Data.TypeRep.Types.Basic.FloatType t instance Data.TypeRep.Representation.Witness GHC.Classes.Ord Data.TypeRep.Types.Basic.IntType t instance Data.TypeRep.Representation.Witness GHC.Classes.Ord Data.TypeRep.Types.Basic.CharType t instance Data.TypeRep.Representation.Witness GHC.Classes.Ord Data.TypeRep.Types.Basic.BoolType t instance Data.TypeRep.Representation.PWitness GHC.Classes.Eq t t => Data.TypeRep.Representation.PWitness GHC.Classes.Eq Data.TypeRep.Types.Basic.ListType t instance Data.TypeRep.Representation.PWitness GHC.Classes.Eq Data.TypeRep.Types.Basic.DoubleType t instance Data.TypeRep.Representation.PWitness GHC.Classes.Eq Data.TypeRep.Types.Basic.FloatType t instance Data.TypeRep.Representation.PWitness GHC.Classes.Eq Data.TypeRep.Types.Basic.IntType t instance Data.TypeRep.Representation.PWitness GHC.Classes.Eq Data.TypeRep.Types.Basic.CharType t instance Data.TypeRep.Representation.PWitness GHC.Classes.Eq Data.TypeRep.Types.Basic.BoolType t instance Data.TypeRep.Representation.Witness GHC.Classes.Eq t t => Data.TypeRep.Representation.Witness GHC.Classes.Eq Data.TypeRep.Types.Basic.ListType t instance Data.TypeRep.Representation.Witness GHC.Classes.Eq Data.TypeRep.Types.Basic.DoubleType t instance Data.TypeRep.Representation.Witness GHC.Classes.Eq Data.TypeRep.Types.Basic.FloatType t instance Data.TypeRep.Representation.Witness GHC.Classes.Eq Data.TypeRep.Types.Basic.IntType t instance Data.TypeRep.Representation.Witness GHC.Classes.Eq Data.TypeRep.Types.Basic.CharType t instance Data.TypeRep.Representation.Witness GHC.Classes.Eq Data.TypeRep.Types.Basic.BoolType t instance Data.TypeRep.Representation.PWitness Data.Typeable.Internal.Typeable t t => Data.TypeRep.Representation.PWitness Data.Typeable.Internal.Typeable Data.TypeRep.Types.Basic.FunType t instance Data.TypeRep.Representation.PWitness Data.Typeable.Internal.Typeable t t => Data.TypeRep.Representation.PWitness Data.Typeable.Internal.Typeable Data.TypeRep.Types.Basic.ListType t instance Data.TypeRep.Representation.PWitness Data.Typeable.Internal.Typeable Data.TypeRep.Types.Basic.DoubleType t instance Data.TypeRep.Representation.PWitness Data.Typeable.Internal.Typeable Data.TypeRep.Types.Basic.FloatType t instance Data.TypeRep.Representation.PWitness Data.Typeable.Internal.Typeable Data.TypeRep.Types.Basic.IntType t instance Data.TypeRep.Representation.PWitness Data.Typeable.Internal.Typeable Data.TypeRep.Types.Basic.CharType t instance Data.TypeRep.Representation.PWitness Data.Typeable.Internal.Typeable Data.TypeRep.Types.Basic.BoolType t instance Data.TypeRep.Representation.Witness Data.Typeable.Internal.Typeable t t => Data.TypeRep.Representation.Witness Data.Typeable.Internal.Typeable Data.TypeRep.Types.Basic.FunType t instance Data.TypeRep.Representation.Witness Data.Typeable.Internal.Typeable t t => Data.TypeRep.Representation.Witness Data.Typeable.Internal.Typeable Data.TypeRep.Types.Basic.ListType t instance Data.TypeRep.Representation.Witness Data.Typeable.Internal.Typeable Data.TypeRep.Types.Basic.DoubleType t instance Data.TypeRep.Representation.Witness Data.Typeable.Internal.Typeable Data.TypeRep.Types.Basic.FloatType t instance Data.TypeRep.Representation.Witness Data.Typeable.Internal.Typeable Data.TypeRep.Types.Basic.IntType t instance Data.TypeRep.Representation.Witness Data.Typeable.Internal.Typeable Data.TypeRep.Types.Basic.CharType t instance Data.TypeRep.Representation.Witness Data.Typeable.Internal.Typeable Data.TypeRep.Types.Basic.BoolType t instance Data.TypeRep.Representation.PWitness Data.TypeRep.Representation.Any Data.TypeRep.Types.Basic.FunType t instance Data.TypeRep.Representation.PWitness Data.TypeRep.Representation.Any Data.TypeRep.Types.Basic.ListType t instance Data.TypeRep.Representation.PWitness Data.TypeRep.Representation.Any Data.TypeRep.Types.Basic.DoubleType t instance Data.TypeRep.Representation.PWitness Data.TypeRep.Representation.Any Data.TypeRep.Types.Basic.FloatType t instance Data.TypeRep.Representation.PWitness Data.TypeRep.Representation.Any Data.TypeRep.Types.Basic.IntType t instance Data.TypeRep.Representation.PWitness Data.TypeRep.Representation.Any Data.TypeRep.Types.Basic.CharType t instance Data.TypeRep.Representation.PWitness Data.TypeRep.Representation.Any Data.TypeRep.Types.Basic.BoolType t instance Data.TypeRep.Representation.Witness Data.TypeRep.Representation.Any Data.TypeRep.Types.Basic.FunType t instance Data.TypeRep.Representation.Witness Data.TypeRep.Representation.Any Data.TypeRep.Types.Basic.ListType t instance Data.TypeRep.Representation.Witness Data.TypeRep.Representation.Any Data.TypeRep.Types.Basic.DoubleType t instance Data.TypeRep.Representation.Witness Data.TypeRep.Representation.Any Data.TypeRep.Types.Basic.FloatType t instance Data.TypeRep.Representation.Witness Data.TypeRep.Representation.Any Data.TypeRep.Types.Basic.IntType t instance Data.TypeRep.Representation.Witness Data.TypeRep.Representation.Any Data.TypeRep.Types.Basic.CharType t instance Data.TypeRep.Representation.Witness Data.TypeRep.Representation.Any Data.TypeRep.Types.Basic.BoolType t instance Data.TypeRep.Representation.TypeEq t t => Data.TypeRep.Representation.TypeEq Data.TypeRep.Types.Basic.FunType t instance Data.TypeRep.Representation.TypeEq t t => Data.TypeRep.Representation.TypeEq Data.TypeRep.Types.Basic.ListType t instance Data.TypeRep.Representation.TypeEq Data.TypeRep.Types.Basic.DoubleType t instance Data.TypeRep.Representation.TypeEq Data.TypeRep.Types.Basic.FloatType t instance Data.TypeRep.Representation.TypeEq Data.TypeRep.Types.Basic.IntType t instance Data.TypeRep.Representation.TypeEq Data.TypeRep.Types.Basic.CharType t instance Data.TypeRep.Representation.TypeEq Data.TypeRep.Types.Basic.BoolType t instance Language.Syntactic.Interpretation.Render Data.TypeRep.Types.Basic.DoubleType instance Language.Syntactic.Interpretation.Render Data.TypeRep.Types.Basic.ListType instance Language.Syntactic.Interpretation.Render Data.TypeRep.Types.Basic.FunType instance Language.Syntactic.Interpretation.Render Data.TypeRep.Types.Basic.FloatType instance Language.Syntactic.Interpretation.Render Data.TypeRep.Types.Basic.IntType instance Language.Syntactic.Interpretation.Render Data.TypeRep.Types.Basic.CharType instance Language.Syntactic.Interpretation.Render Data.TypeRep.Types.Basic.BoolType -- | Typeable instances for various types. The reason for having -- these in a separate module is that it might be desired to have these -- instances with other type representations. -- -- For example, instead of the instance -- --
-- (BoolType :<: t) => Typeable t Bool ---- -- one might want to have -- --
-- Typeable MyTypeRep Bool --module Data.TypeRep.Types.Basic.Typeable instance (Data.TypeRep.Types.Basic.FunType Language.Syntactic.Syntax.:<: t, Data.TypeRep.Representation.PWitness (Data.TypeRep.Representation.Typeable t) t t) => Data.TypeRep.Representation.PWitness (Data.TypeRep.Representation.Typeable t) Data.TypeRep.Types.Basic.FunType t instance (Data.TypeRep.Types.Basic.ListType Language.Syntactic.Syntax.:<: t, Data.TypeRep.Representation.PWitness (Data.TypeRep.Representation.Typeable t) t t) => Data.TypeRep.Representation.PWitness (Data.TypeRep.Representation.Typeable t) Data.TypeRep.Types.Basic.ListType t instance (Data.TypeRep.Types.Basic.DoubleType Language.Syntactic.Syntax.:<: t) => Data.TypeRep.Representation.PWitness (Data.TypeRep.Representation.Typeable t) Data.TypeRep.Types.Basic.DoubleType t instance (Data.TypeRep.Types.Basic.FloatType Language.Syntactic.Syntax.:<: t) => Data.TypeRep.Representation.PWitness (Data.TypeRep.Representation.Typeable t) Data.TypeRep.Types.Basic.FloatType t instance (Data.TypeRep.Types.Basic.IntType Language.Syntactic.Syntax.:<: t) => Data.TypeRep.Representation.PWitness (Data.TypeRep.Representation.Typeable t) Data.TypeRep.Types.Basic.IntType t instance (Data.TypeRep.Types.Basic.CharType Language.Syntactic.Syntax.:<: t) => Data.TypeRep.Representation.PWitness (Data.TypeRep.Representation.Typeable t) Data.TypeRep.Types.Basic.CharType t instance (Data.TypeRep.Types.Basic.BoolType Language.Syntactic.Syntax.:<: t) => Data.TypeRep.Representation.PWitness (Data.TypeRep.Representation.Typeable t) Data.TypeRep.Types.Basic.BoolType t instance (Data.TypeRep.Types.Basic.FunType Language.Syntactic.Syntax.:<: t, Data.TypeRep.Representation.Witness (Data.TypeRep.Representation.Typeable t) t t) => Data.TypeRep.Representation.Witness (Data.TypeRep.Representation.Typeable t) Data.TypeRep.Types.Basic.FunType t instance (Data.TypeRep.Types.Basic.ListType Language.Syntactic.Syntax.:<: t, Data.TypeRep.Representation.Witness (Data.TypeRep.Representation.Typeable t) t t) => Data.TypeRep.Representation.Witness (Data.TypeRep.Representation.Typeable t) Data.TypeRep.Types.Basic.ListType t instance (Data.TypeRep.Types.Basic.DoubleType Language.Syntactic.Syntax.:<: t) => Data.TypeRep.Representation.Witness (Data.TypeRep.Representation.Typeable t) Data.TypeRep.Types.Basic.DoubleType t instance (Data.TypeRep.Types.Basic.FloatType Language.Syntactic.Syntax.:<: t) => Data.TypeRep.Representation.Witness (Data.TypeRep.Representation.Typeable t) Data.TypeRep.Types.Basic.FloatType t instance (Data.TypeRep.Types.Basic.IntType Language.Syntactic.Syntax.:<: t) => Data.TypeRep.Representation.Witness (Data.TypeRep.Representation.Typeable t) Data.TypeRep.Types.Basic.IntType t instance (Data.TypeRep.Types.Basic.CharType Language.Syntactic.Syntax.:<: t) => Data.TypeRep.Representation.Witness (Data.TypeRep.Representation.Typeable t) Data.TypeRep.Types.Basic.CharType t instance (Data.TypeRep.Types.Basic.BoolType Language.Syntactic.Syntax.:<: t) => Data.TypeRep.Representation.Witness (Data.TypeRep.Representation.Typeable t) Data.TypeRep.Types.Basic.BoolType t instance (Data.TypeRep.Types.Basic.BoolType Language.Syntactic.Syntax.:<: t) => Data.TypeRep.Representation.Typeable t GHC.Types.Bool instance (Data.TypeRep.Types.Basic.CharType Language.Syntactic.Syntax.:<: t) => Data.TypeRep.Representation.Typeable t GHC.Types.Char instance (Data.TypeRep.Types.Basic.IntType Language.Syntactic.Syntax.:<: t) => Data.TypeRep.Representation.Typeable t GHC.Types.Int instance (Data.TypeRep.Types.Basic.FloatType Language.Syntactic.Syntax.:<: t) => Data.TypeRep.Representation.Typeable t GHC.Types.Float instance (Data.TypeRep.Types.Basic.DoubleType Language.Syntactic.Syntax.:<: t) => Data.TypeRep.Representation.Typeable t GHC.Types.Double instance (Data.TypeRep.Types.Basic.ListType Language.Syntactic.Syntax.:<: t, Data.TypeRep.Representation.Typeable t a) => Data.TypeRep.Representation.Typeable t [a] instance (Data.TypeRep.Types.Basic.FunType Language.Syntactic.Syntax.:<: t, Data.TypeRep.Representation.Typeable t a, Data.TypeRep.Representation.Typeable t b) => Data.TypeRep.Representation.Typeable t (a -> b) -- | Representations for tuple types -- -- The reason for using symbol names ending with _t is that -- deriveRender uses everything that comes before _ -- when rendering the constructor. module Data.TypeRep.Types.Tuple data TupleType a Tup2_t :: TupleType (a :-> (b :-> Full (a, b))) Tup3_t :: TupleType (a :-> (b :-> (c :-> Full (a, b, c)))) Tup4_t :: TupleType (a :-> (b :-> (c :-> (d :-> Full (a, b, c, d))))) Tup5_t :: TupleType (a :-> (b :-> (c :-> (d :-> (e :-> Full (a, b, c, d, e)))))) Tup6_t :: TupleType (a :-> (b :-> (c :-> (d :-> (e :-> (f :-> Full (a, b, c, d, e, f))))))) Tup7_t :: TupleType (a :-> (b :-> (c :-> (d :-> (e :-> (f :-> (g :-> Full (a, b, c, d, e, f, g)))))))) Tup8_t :: TupleType (a :-> (b :-> (c :-> (d :-> (e :-> (f :-> (g :-> (h :-> Full (a, b, c, d, e, f, g, h))))))))) Tup9_t :: TupleType (a :-> (b :-> (c :-> (d :-> (e :-> (f :-> (g :-> (h :-> (i :-> Full (a, b, c, d, e, f, g, h, i)))))))))) Tup10_t :: TupleType (a :-> (b :-> (c :-> (d :-> (e :-> (f :-> (g :-> (h :-> (i :-> (j :-> Full (a, b, c, d, e, f, g, h, i, j))))))))))) Tup11_t :: TupleType (a :-> (b :-> (c :-> (d :-> (e :-> (f :-> (g :-> (h :-> (i :-> (j :-> (k :-> Full (a, b, c, d, e, f, g, h, i, j, k)))))))))))) Tup12_t :: TupleType (a :-> (b :-> (c :-> (d :-> (e :-> (f :-> (g :-> (h :-> (i :-> (j :-> (k :-> (l :-> Full (a, b, c, d, e, f, g, h, i, j, k, l))))))))))))) Tup13_t :: TupleType (a :-> (b :-> (c :-> (d :-> (e :-> (f :-> (g :-> (h :-> (i :-> (j :-> (k :-> (l :-> (m :-> Full (a, b, c, d, e, f, g, h, i, j, k, l, m)))))))))))))) Tup14_t :: TupleType (a :-> (b :-> (c :-> (d :-> (e :-> (f :-> (g :-> (h :-> (i :-> (j :-> (k :-> (l :-> (m :-> (n :-> Full (a, b, c, d, e, f, g, h, i, j, k, l, m, n))))))))))))))) Tup15_t :: TupleType (a :-> (b :-> (c :-> (d :-> (e :-> (f :-> (g :-> (h :-> (i :-> (j :-> (k :-> (l :-> (m :-> (n :-> (o :-> Full (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)))))))))))))))) tup2Type :: (TupleType :<: t) => TypeRep t a -> TypeRep t b -> TypeRep t (a, b) tup3Type :: (TupleType :<: t) => TypeRep t a -> TypeRep t b -> TypeRep t c -> TypeRep t (a, b, c) tup4Type :: (TupleType :<: t) => TypeRep t a -> TypeRep t b -> TypeRep t c -> TypeRep t d -> TypeRep t (a, b, c, d) tup5Type :: (TupleType :<: t) => TypeRep t a -> TypeRep t b -> TypeRep t c -> TypeRep t d -> TypeRep t e -> TypeRep t (a, b, c, d, e) tup6Type :: (TupleType :<: t) => TypeRep t a -> TypeRep t b -> TypeRep t c -> TypeRep t d -> TypeRep t e -> TypeRep t f -> TypeRep t (a, b, c, d, e, f) tup7Type :: (TupleType :<: t) => TypeRep t a -> TypeRep t b -> TypeRep t c -> TypeRep t d -> TypeRep t e -> TypeRep t f -> TypeRep t g -> TypeRep t (a, b, c, d, e, f, g) tup8Type :: (TupleType :<: t) => TypeRep t a -> TypeRep t b -> TypeRep t c -> TypeRep t d -> TypeRep t e -> TypeRep t f -> TypeRep t g -> TypeRep t h -> TypeRep t (a, b, c, d, e, f, g, h) tup9Type :: (TupleType :<: t) => TypeRep t a -> TypeRep t b -> TypeRep t c -> TypeRep t d -> TypeRep t e -> TypeRep t f -> TypeRep t g -> TypeRep t h -> TypeRep t i -> TypeRep t (a, b, c, d, e, f, g, h, i) tup10Type :: (TupleType :<: t) => TypeRep t a -> TypeRep t b -> TypeRep t c -> TypeRep t d -> TypeRep t e -> TypeRep t f -> TypeRep t g -> TypeRep t h -> TypeRep t i -> TypeRep t j -> TypeRep t (a, b, c, d, e, f, g, h, i, j) tup11Type :: (TupleType :<: t) => TypeRep t a -> TypeRep t b -> TypeRep t c -> TypeRep t d -> TypeRep t e -> TypeRep t f -> TypeRep t g -> TypeRep t h -> TypeRep t i -> TypeRep t j -> TypeRep t k -> TypeRep t (a, b, c, d, e, f, g, h, i, j, k) tup12Type :: (TupleType :<: t) => TypeRep t a -> TypeRep t b -> TypeRep t c -> TypeRep t d -> TypeRep t e -> TypeRep t f -> TypeRep t g -> TypeRep t h -> TypeRep t i -> TypeRep t j -> TypeRep t k -> TypeRep t l -> TypeRep t (a, b, c, d, e, f, g, h, i, j, k, l) tup13Type :: (TupleType :<: t) => TypeRep t a -> TypeRep t b -> TypeRep t c -> TypeRep t d -> TypeRep t e -> TypeRep t f -> TypeRep t g -> TypeRep t h -> TypeRep t i -> TypeRep t j -> TypeRep t k -> TypeRep t l -> TypeRep t m -> TypeRep t (a, b, c, d, e, f, g, h, i, j, k, l, m) tup14Type :: (TupleType :<: t) => TypeRep t a -> TypeRep t b -> TypeRep t c -> TypeRep t d -> TypeRep t e -> TypeRep t f -> TypeRep t g -> TypeRep t h -> TypeRep t i -> TypeRep t j -> TypeRep t k -> TypeRep t l -> TypeRep t m -> TypeRep t n -> TypeRep t (a, b, c, d, e, f, g, h, i, j, k, l, m, n) tup15Type :: (TupleType :<: t) => TypeRep t a -> TypeRep t b -> TypeRep t c -> TypeRep t d -> TypeRep t e -> TypeRep t f -> TypeRep t g -> TypeRep t h -> TypeRep t i -> TypeRep t j -> TypeRep t k -> TypeRep t l -> TypeRep t m -> TypeRep t n -> TypeRep t o -> TypeRep t (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) tupWidth :: TupleType a -> Int instance Data.TypeRep.Representation.PWitness GHC.Show.Show t t => Data.TypeRep.Representation.PWitness GHC.Show.Show Data.TypeRep.Types.Tuple.TupleType t instance Data.TypeRep.Representation.PWitness GHC.Num.Num Data.TypeRep.Types.Tuple.TupleType t instance Data.TypeRep.Representation.PWitness GHC.Real.Integral Data.TypeRep.Types.Tuple.TupleType t instance Data.TypeRep.Representation.PWitness GHC.Classes.Ord t t => Data.TypeRep.Representation.PWitness GHC.Classes.Ord Data.TypeRep.Types.Tuple.TupleType t instance Data.TypeRep.Representation.PWitness GHC.Classes.Eq t t => Data.TypeRep.Representation.PWitness GHC.Classes.Eq Data.TypeRep.Types.Tuple.TupleType t instance Data.TypeRep.Representation.PWitness Data.Typeable.Internal.Typeable t t => Data.TypeRep.Representation.PWitness Data.Typeable.Internal.Typeable Data.TypeRep.Types.Tuple.TupleType t instance Data.TypeRep.Representation.PWitness Data.TypeRep.Representation.Any Data.TypeRep.Types.Tuple.TupleType t instance Data.TypeRep.Representation.Witness GHC.Show.Show t t => Data.TypeRep.Representation.Witness GHC.Show.Show Data.TypeRep.Types.Tuple.TupleType t instance Data.TypeRep.Representation.Witness GHC.Classes.Ord t t => Data.TypeRep.Representation.Witness GHC.Classes.Ord Data.TypeRep.Types.Tuple.TupleType t instance Data.TypeRep.Representation.Witness GHC.Classes.Eq t t => Data.TypeRep.Representation.Witness GHC.Classes.Eq Data.TypeRep.Types.Tuple.TupleType t instance Data.TypeRep.Representation.Witness Data.Typeable.Internal.Typeable t t => Data.TypeRep.Representation.Witness Data.Typeable.Internal.Typeable Data.TypeRep.Types.Tuple.TupleType t instance Data.TypeRep.Representation.Witness Data.TypeRep.Representation.Any Data.TypeRep.Types.Tuple.TupleType t instance Data.TypeRep.Representation.TypeEq t t => Data.TypeRep.Representation.TypeEq Data.TypeRep.Types.Tuple.TupleType t instance Language.Syntactic.Interpretation.Render Data.TypeRep.Types.Tuple.TupleType -- | Typeable instances for tuple types. The reason for having these -- in a separate module is that it might be desired to have these -- instances with other type representations. -- -- For example, instead of the instance -- --
-- (BoolType :<: t) => Typeable t Bool ---- -- one might want to have -- --
-- Typeable MyTypeRep Bool --module Data.TypeRep.Types.Tuple.Typeable instance (Data.TypeRep.Types.Tuple.TupleType Language.Syntactic.Syntax.:<: t, Data.TypeRep.Representation.PWitness (Data.TypeRep.Representation.Typeable t) t t) => Data.TypeRep.Representation.PWitness (Data.TypeRep.Representation.Typeable t) Data.TypeRep.Types.Tuple.TupleType t instance (Data.TypeRep.Types.Tuple.TupleType Language.Syntactic.Syntax.:<: t, Data.TypeRep.Representation.Witness (Data.TypeRep.Representation.Typeable t) t t) => Data.TypeRep.Representation.Witness (Data.TypeRep.Representation.Typeable t) Data.TypeRep.Types.Tuple.TupleType t instance (Data.TypeRep.Types.Tuple.TupleType Language.Syntactic.Syntax.:<: t, Data.TypeRep.Representation.Typeable t a, Data.TypeRep.Representation.Typeable t b) => Data.TypeRep.Representation.Typeable t (a, b) instance (Data.TypeRep.Types.Tuple.TupleType Language.Syntactic.Syntax.:<: t, Data.TypeRep.Representation.Typeable t a, Data.TypeRep.Representation.Typeable t b, Data.TypeRep.Representation.Typeable t c) => Data.TypeRep.Representation.Typeable t (a, b, c) instance (Data.TypeRep.Types.Tuple.TupleType Language.Syntactic.Syntax.:<: t, Data.TypeRep.Representation.Typeable t a, Data.TypeRep.Representation.Typeable t b, Data.TypeRep.Representation.Typeable t c, Data.TypeRep.Representation.Typeable t d) => Data.TypeRep.Representation.Typeable t (a, b, c, d) instance (Data.TypeRep.Types.Tuple.TupleType Language.Syntactic.Syntax.:<: t, Data.TypeRep.Representation.Typeable t a, Data.TypeRep.Representation.Typeable t b, Data.TypeRep.Representation.Typeable t c, Data.TypeRep.Representation.Typeable t d, Data.TypeRep.Representation.Typeable t e) => Data.TypeRep.Representation.Typeable t (a, b, c, d, e) instance (Data.TypeRep.Types.Tuple.TupleType Language.Syntactic.Syntax.:<: t, Data.TypeRep.Representation.Typeable t a, Data.TypeRep.Representation.Typeable t b, Data.TypeRep.Representation.Typeable t c, Data.TypeRep.Representation.Typeable t d, Data.TypeRep.Representation.Typeable t e, Data.TypeRep.Representation.Typeable t f) => Data.TypeRep.Representation.Typeable t (a, b, c, d, e, f) instance (Data.TypeRep.Types.Tuple.TupleType Language.Syntactic.Syntax.:<: t, Data.TypeRep.Representation.Typeable t a, Data.TypeRep.Representation.Typeable t b, Data.TypeRep.Representation.Typeable t c, Data.TypeRep.Representation.Typeable t d, Data.TypeRep.Representation.Typeable t e, Data.TypeRep.Representation.Typeable t f, Data.TypeRep.Representation.Typeable t g) => Data.TypeRep.Representation.Typeable t (a, b, c, d, e, f, g) instance (Data.TypeRep.Types.Tuple.TupleType Language.Syntactic.Syntax.:<: t, Data.TypeRep.Representation.Typeable t a, Data.TypeRep.Representation.Typeable t b, Data.TypeRep.Representation.Typeable t c, Data.TypeRep.Representation.Typeable t d, Data.TypeRep.Representation.Typeable t e, Data.TypeRep.Representation.Typeable t f, Data.TypeRep.Representation.Typeable t g, Data.TypeRep.Representation.Typeable t h) => Data.TypeRep.Representation.Typeable t (a, b, c, d, e, f, g, h) instance (Data.TypeRep.Types.Tuple.TupleType Language.Syntactic.Syntax.:<: t, Data.TypeRep.Representation.Typeable t a, Data.TypeRep.Representation.Typeable t b, Data.TypeRep.Representation.Typeable t c, Data.TypeRep.Representation.Typeable t d, Data.TypeRep.Representation.Typeable t e, Data.TypeRep.Representation.Typeable t f, Data.TypeRep.Representation.Typeable t g, Data.TypeRep.Representation.Typeable t h, Data.TypeRep.Representation.Typeable t i) => Data.TypeRep.Representation.Typeable t (a, b, c, d, e, f, g, h, i) instance (Data.TypeRep.Types.Tuple.TupleType Language.Syntactic.Syntax.:<: t, Data.TypeRep.Representation.Typeable t a, Data.TypeRep.Representation.Typeable t b, Data.TypeRep.Representation.Typeable t c, Data.TypeRep.Representation.Typeable t d, Data.TypeRep.Representation.Typeable t e, Data.TypeRep.Representation.Typeable t f, Data.TypeRep.Representation.Typeable t g, Data.TypeRep.Representation.Typeable t h, Data.TypeRep.Representation.Typeable t i, Data.TypeRep.Representation.Typeable t j) => Data.TypeRep.Representation.Typeable t (a, b, c, d, e, f, g, h, i, j) instance (Data.TypeRep.Types.Tuple.TupleType Language.Syntactic.Syntax.:<: t, Data.TypeRep.Representation.Typeable t a, Data.TypeRep.Representation.Typeable t b, Data.TypeRep.Representation.Typeable t c, Data.TypeRep.Representation.Typeable t d, Data.TypeRep.Representation.Typeable t e, Data.TypeRep.Representation.Typeable t f, Data.TypeRep.Representation.Typeable t g, Data.TypeRep.Representation.Typeable t h, Data.TypeRep.Representation.Typeable t i, Data.TypeRep.Representation.Typeable t j, Data.TypeRep.Representation.Typeable t k) => Data.TypeRep.Representation.Typeable t (a, b, c, d, e, f, g, h, i, j, k) instance (Data.TypeRep.Types.Tuple.TupleType Language.Syntactic.Syntax.:<: t, Data.TypeRep.Representation.Typeable t a, Data.TypeRep.Representation.Typeable t b, Data.TypeRep.Representation.Typeable t c, Data.TypeRep.Representation.Typeable t d, Data.TypeRep.Representation.Typeable t e, Data.TypeRep.Representation.Typeable t f, Data.TypeRep.Representation.Typeable t g, Data.TypeRep.Representation.Typeable t h, Data.TypeRep.Representation.Typeable t i, Data.TypeRep.Representation.Typeable t j, Data.TypeRep.Representation.Typeable t k, Data.TypeRep.Representation.Typeable t l) => Data.TypeRep.Representation.Typeable t (a, b, c, d, e, f, g, h, i, j, k, l) instance (Data.TypeRep.Types.Tuple.TupleType Language.Syntactic.Syntax.:<: t, Data.TypeRep.Representation.Typeable t a, Data.TypeRep.Representation.Typeable t b, Data.TypeRep.Representation.Typeable t c, Data.TypeRep.Representation.Typeable t d, Data.TypeRep.Representation.Typeable t e, Data.TypeRep.Representation.Typeable t f, Data.TypeRep.Representation.Typeable t g, Data.TypeRep.Representation.Typeable t h, Data.TypeRep.Representation.Typeable t i, Data.TypeRep.Representation.Typeable t j, Data.TypeRep.Representation.Typeable t k, Data.TypeRep.Representation.Typeable t l, Data.TypeRep.Representation.Typeable t m) => Data.TypeRep.Representation.Typeable t (a, b, c, d, e, f, g, h, i, j, k, l, m) instance (Data.TypeRep.Types.Tuple.TupleType Language.Syntactic.Syntax.:<: t, Data.TypeRep.Representation.Typeable t a, Data.TypeRep.Representation.Typeable t b, Data.TypeRep.Representation.Typeable t c, Data.TypeRep.Representation.Typeable t d, Data.TypeRep.Representation.Typeable t e, Data.TypeRep.Representation.Typeable t f, Data.TypeRep.Representation.Typeable t g, Data.TypeRep.Representation.Typeable t h, Data.TypeRep.Representation.Typeable t i, Data.TypeRep.Representation.Typeable t j, Data.TypeRep.Representation.Typeable t k, Data.TypeRep.Representation.Typeable t l, Data.TypeRep.Representation.Typeable t m, Data.TypeRep.Representation.Typeable t n) => Data.TypeRep.Representation.Typeable t (a, b, c, d, e, f, g, h, i, j, k, l, m, n) instance (Data.TypeRep.Types.Tuple.TupleType Language.Syntactic.Syntax.:<: t, Data.TypeRep.Representation.Typeable t a, Data.TypeRep.Representation.Typeable t b, Data.TypeRep.Representation.Typeable t c, Data.TypeRep.Representation.Typeable t d, Data.TypeRep.Representation.Typeable t e, Data.TypeRep.Representation.Typeable t f, Data.TypeRep.Representation.Typeable t g, Data.TypeRep.Representation.Typeable t h, Data.TypeRep.Representation.Typeable t i, Data.TypeRep.Representation.Typeable t j, Data.TypeRep.Representation.Typeable t k, Data.TypeRep.Representation.Typeable t l, Data.TypeRep.Representation.Typeable t m, Data.TypeRep.Representation.Typeable t n, Data.TypeRep.Representation.Typeable t o) => Data.TypeRep.Representation.Typeable t (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -- | Typeable instances for signed and unsigned integer types. The -- reason for having these in a separate module is that it might be -- desired to have these instances with other type representations. -- -- For example, instead of the instance -- --
-- (IntWordType :<: t) => Typeable t Int8 ---- -- one might want to have -- --
-- Typeable MyTypeRep Int8 --module Data.TypeRep.Types.IntWord.Typeable instance (Data.TypeRep.Types.IntWord.IntWordType Language.Syntactic.Syntax.:<: t) => Data.TypeRep.Representation.PWitness (Data.TypeRep.Representation.Typeable t) Data.TypeRep.Types.IntWord.IntWordType t instance (Data.TypeRep.Types.IntWord.IntWordType Language.Syntactic.Syntax.:<: t) => Data.TypeRep.Representation.Witness (Data.TypeRep.Representation.Typeable t) Data.TypeRep.Types.IntWord.IntWordType t instance (Data.TypeRep.Types.IntWord.IntWordType Language.Syntactic.Syntax.:<: t) => Data.TypeRep.Representation.Typeable t GHC.Int.Int8 instance (Data.TypeRep.Types.IntWord.IntWordType Language.Syntactic.Syntax.:<: t) => Data.TypeRep.Representation.Typeable t GHC.Int.Int16 instance (Data.TypeRep.Types.IntWord.IntWordType Language.Syntactic.Syntax.:<: t) => Data.TypeRep.Representation.Typeable t GHC.Int.Int32 instance (Data.TypeRep.Types.IntWord.IntWordType Language.Syntactic.Syntax.:<: t) => Data.TypeRep.Representation.Typeable t GHC.Int.Int64 instance (Data.TypeRep.Types.IntWord.IntWordType Language.Syntactic.Syntax.:<: t) => Data.TypeRep.Representation.Typeable t GHC.Word.Word8 instance (Data.TypeRep.Types.IntWord.IntWordType Language.Syntactic.Syntax.:<: t) => Data.TypeRep.Representation.Typeable t GHC.Word.Word16 instance (Data.TypeRep.Types.IntWord.IntWordType Language.Syntactic.Syntax.:<: t) => Data.TypeRep.Representation.Typeable t GHC.Word.Word32 instance (Data.TypeRep.Types.IntWord.IntWordType Language.Syntactic.Syntax.:<: t) => Data.TypeRep.Representation.Typeable t GHC.Word.Word64 -- | Open type representations and dynamic types module Data.TypeRep -- | This class provides reification of type a in a universe -- t. Typeable t a means that a is in -- the type universe represented by t. class Typeable t a -- | Representation of type a in a type universe t -- -- This type can also be seen as a witness that a is a member of -- t (i.e. Typeable t a); see -- witTypeable. data TypeRep t a -- | Reification of type a in a type universe t typeRep :: Typeable t a => TypeRep t a -- | Equality on type representations class Render t => TypeEq t u -- | Equality on type representations typeEqM :: (TypeEq t t, MonadError String m) => TypeRep t a -> TypeRep t b -> m (Dict (a ~ b)) -- | Equality on type representations typeEq :: TypeEq t t => TypeRep t a -> TypeRep t b -> Maybe (Dict (a ~ b)) -- | Type constructor matching. This function makes it possible to match on -- type representations without dealing with the underlying AST -- representation. -- -- For example, to check that a TypeRep represents the type a -- -> Int for some a: -- --
-- is_atoi :: (TypeEq t t, IntType :<: t) => TypeRep t a -> Bool -- is_atoi t -- | [E ta, E tb] <- matchCon t -- , Just _ <- typeEq ta intType = True -- | otherwise = False --matchCon :: TypeRep t c -> [E (TypeRep t)] -- | Monadic version of matchCon -- --
-- matchConM = return . matchCon ---- -- matchConM is convenient when matching types in a monad, e.g.: -- --
-- do ... -- [E ta, E tb] <- matchConM t -- Dict <- typeEq ta tb -- ... --matchConM :: Monad m => TypeRep t c -> m [E (TypeRep t)] -- | Witness a type constraint for a reified type class Witness p t u -- | Partially witness a type constraint for a reified type class (ShowClass p, Render t) => PWitness p t u where pwitSym _ _ = throwError "" -- | Witness a type constraint for a reified type wit :: Witness p t t => Proxy p -> TypeRep t a -> Dict (p a) -- | Partially witness a type constraint for a reified type pwit :: (PWitness p t t, MonadError String m) => Proxy p -> TypeRep t a -> m (Dict (p a)) -- | Witness a Typeable constraint for a reified type witTypeable :: Witness (Typeable t) t t => TypeRep t a -> Dict (Typeable t a) -- | Partially witness a Typeable constraint for a reified type pwitTypeable :: PWitness (Typeable t) t t => TypeRep t a -> Either String (Dict (Typeable t a)) -- | Safe cast (does not use unsafeCoerce) cast :: (Typeable t a, Typeable t b, TypeEq t t) => Proxy t -> a -> Either String b -- | Safe generalized cast (does not use unsafeCoerce) gcast :: (Typeable t a, Typeable t b, TypeEq t t) => Proxy t -> c a -> Either String (c b) -- | Dynamic type parameterized on a type universe data Dynamic t Dyn :: TypeRep t a -> a -> Dynamic t toDyn :: Typeable t a => a -> Dynamic t fromDyn :: (Typeable t a, TypeEq t t) => Dynamic t -> Either String a -- | The universal class class Any a -- | Show the name of type classes class ShowClass (p :: * -> Constraint) -- | Show the name of a type class showClass :: ShowClass p => Proxy p -> String -- | Proxy of Any class. Can be passed to wit and -- pwit. pAny :: Proxy Any -- | Proxy of Typeable class (from the base library). Can be passed -- to wit and pwit. pDataTypeable :: Proxy Typeable -- | Proxy of Eq class. Can be passed to wit and pwit. pEq :: Proxy Eq -- | Proxy of Ord class. Can be passed to wit and -- pwit. pOrd :: Proxy Ord -- | Proxy of Show class. Can be passed to wit and -- pwit. pShow :: Proxy Show -- | Proxy of Num class. Can be passed to wit and -- pwit. pNum :: Proxy Num -- | Proxy of Integral class. Can be passed to wit and -- pwit. pIntegral :: Proxy Integral -- | Sub-universe relation -- -- In general, a universe t is a sub-universe of u if -- u has the form -- --
-- t1 :+: t2 :+: ... :+: t --class SubUniverse sub sup -- | Cast a type representation to a larger universe weakenUniverse :: SubUniverse sub sup => TypeRep sub a -> TypeRep sup a -- | Utilities for polyvariadic functions module Data.TypeRep.VarArg -- | Newtype marking the result of a N-ary function newtype Res a Res :: a -> Res a -- | Put a Res marker at the result type of a function -- --
-- ToRes (a -> b -> ... -> x) = a -> b -> ... -> Res x ---- | Remove the Res marker at the result type of a function -- --
-- FromRes (a -> b -> ... -> Res x) = a -> b -> ... -> x ---- | Witness of the arity of a function. Arity will normally be -- indexed by (ToRes a). data Arity a FunRes :: Arity (Res a) FunArg :: Arity b -> Arity (a -> b) class VarArg t aritySym :: (VarArg t, VarArg u) => t sig -> Args (AST u) sig -> Arity (ToRes (DenResult sig)) fromResInvSym :: (VarArg t, VarArg u, a ~ DenResult sig) => t sig -> Args (AST u) sig -> Dict (FromRes (ToRes a) ~ a) -- | Get the Arity of a type. The purpose is to be able to -- distinguish between functions and non-functions without having to -- handle all cases of a TypeRep. arity :: VarArg t => TypeRep t a -> Arity (ToRes a) -- | Prove that FromRes is the inverse of ToRes fromResInv :: VarArg t => TypeRep t a -> Dict (FromRes (ToRes a) ~ a) type NonFunction a = ToRes a ~ Res a -- | Attempt to prove that a type is not a function type nonFunction :: (VarArg t, MonadError String m) => TypeRep t a -> m (Dict (NonFunction a)) -- | Give a function a monadic result type. (FunM m) will -- normally be indexed by (ToRes a). -- --
-- FunM m (a -> b -> ... -> Res x) = a -> b -> ... -> m x ---- | Lift a function to a similar function with monadic result type -- --
-- liftMonadic _ _ f = \a b ... x -> return (f a b ... x) --liftMonadic :: (VarArg t, Monad m) => Proxy m -> TypeRep t a -> a -> FunM m (ToRes a) -- | Run the result of a monadic function -- --
-- runMonadic run _ f = \a b ... x -> run (f a b ... x) --runMonadic :: VarArg t => (forall a. m a -> a) -> TypeRep t a -> FunM m (ToRes a) -> a -- | Compose a function with an N-ary monadic function -- --
-- compMonadic f _ g = \a b ... x -> f (g a b ... x) --compMonadic :: VarArg t => (forall a. m1 a -> m2 a) -> TypeRep t a -> FunM m1 (ToRes a) -> FunM m2 (ToRes a) -- | Give a function monadic arguments and result type. (FunM2 -- m) will normally be indexed by (ToRes a). -- --
-- FunM m (a -> b -> ... -> Res x) = m a -> m b -> ... -> m x ---- | Lift a function to a similar function with monadic arguments and -- result -- --
-- liftMonadic f = \ma mb ... mx -> do -- a <- ma -- b <- mb -- ... -- x <- mx -- return (f a b ... x) --liftMonadic2 :: (VarArg t, Monad m) => Proxy m -> TypeRep t a -> a -> FunM2 m (ToRes a) instance (Data.TypeRep.VarArg.VarArg t1, Data.TypeRep.VarArg.VarArg t2) => Data.TypeRep.VarArg.VarArg (t1 Language.Syntactic.Syntax.:+: t2) instance Data.TypeRep.VarArg.VarArg Data.TypeRep.Types.Basic.BoolType instance Data.TypeRep.VarArg.VarArg Data.TypeRep.Types.Basic.CharType instance Data.TypeRep.VarArg.VarArg Data.TypeRep.Types.Basic.IntType instance Data.TypeRep.VarArg.VarArg Data.TypeRep.Types.Basic.FloatType instance Data.TypeRep.VarArg.VarArg Data.TypeRep.Types.Basic.ListType instance Data.TypeRep.VarArg.VarArg Data.TypeRep.Types.Basic.FunType