-listTc :: TyCon
-listTc = mkTyCon "[]"
-
-instance Typeable a => Typeable [a] where
- typeOf ls = mkAppTy listTc [typeOf ((undefined :: [a] -> a) ls)]
- -- In GHC we can say
- -- typeOf (undefined :: a)
- -- using scoped type variables, but we use the
- -- more verbose form here, for compatibility with Hugs
-
-unitTc :: TyCon
-unitTc = mkTyCon "()"
-
-instance Typeable () where
- typeOf _ = mkAppTy unitTc []
-
-tup2Tc :: TyCon
-tup2Tc = mkTyCon ","
-
-instance (Typeable a, Typeable b) => Typeable (a,b) where
- typeOf tu = mkAppTy tup2Tc [typeOf ((undefined :: (a,b) -> a) tu),
- typeOf ((undefined :: (a,b) -> b) tu)]
-
-tup3Tc :: TyCon
-tup3Tc = mkTyCon ",,"
-
-instance ( Typeable a , Typeable b , Typeable c) => Typeable (a,b,c) where
- typeOf tu = mkAppTy tup3Tc [typeOf ((undefined :: (a,b,c) -> a) tu),
- typeOf ((undefined :: (a,b,c) -> b) tu),
- typeOf ((undefined :: (a,b,c) -> c) tu)]
-
-tup4Tc :: TyCon
-tup4Tc = mkTyCon ",,,"
-
-instance ( Typeable a
- , Typeable b
- , Typeable c
- , Typeable d) => Typeable (a,b,c,d) where
- typeOf tu = mkAppTy tup4Tc [typeOf ((undefined :: (a,b,c,d) -> a) tu),
- typeOf ((undefined :: (a,b,c,d) -> b) tu),
- typeOf ((undefined :: (a,b,c,d) -> c) tu),
- typeOf ((undefined :: (a,b,c,d) -> d) tu)]
-tup5Tc :: TyCon
-tup5Tc = mkTyCon ",,,,"
-
-instance ( Typeable a
- , Typeable b
- , Typeable c
- , Typeable d
- , Typeable e) => Typeable (a,b,c,d,e) where
- typeOf tu = mkAppTy tup5Tc [typeOf ((undefined :: (a,b,c,d,e) -> a) tu),
- typeOf ((undefined :: (a,b,c,d,e) -> b) tu),
- typeOf ((undefined :: (a,b,c,d,e) -> c) tu),
- typeOf ((undefined :: (a,b,c,d,e) -> d) tu),
- typeOf ((undefined :: (a,b,c,d,e) -> e) tu)]
-
-tup6Tc :: TyCon
-tup6Tc = mkTyCon ",,,,"
-
-instance ( Typeable a
- , Typeable b
- , Typeable c
- , Typeable d
- , Typeable e
- , Typeable f) => Typeable (a,b,c,d,e,f) where
- typeOf tu = mkAppTy tup6Tc
- [typeOf ( (undefined :: (a,b,c,d,e,f) -> a) tu),
- typeOf ((undefined :: (a,b,c,d,e,f) -> b) tu),
- typeOf ((undefined :: (a,b,c,d,e,f) -> c) tu),
- typeOf ((undefined :: (a,b,c,d,e,f) -> d) tu),
- typeOf ((undefined :: (a,b,c,d,e,f) -> e) tu),
- typeOf ((undefined :: (a,b,c,d,e,f) -> f) tu)]
-
-tup7Tc :: TyCon
-tup7Tc = mkTyCon ",,,,"
-
-instance ( Typeable a
- , Typeable b
- , Typeable c
- , Typeable d
- , Typeable e
- , Typeable f
- , Typeable g) => Typeable (a,b,c,d,e,f,g) where
- typeOf tu = mkAppTy tup7Tc
- [typeOf ( (undefined :: (a,b,c,d,e,f,g) -> a) tu),
- typeOf ((undefined :: (a,b,c,d,e,f,g) -> b) tu),
- typeOf ((undefined :: (a,b,c,d,e,f,g) -> c) tu),
- typeOf ((undefined :: (a,b,c,d,e,f,g) -> d) tu),
- typeOf ((undefined :: (a,b,c,d,e,f,g) -> e) tu),
- typeOf ((undefined :: (a,b,c,d,e,f,g) -> f) tu),
- typeOf ((undefined :: (a,b,c,d,e,f,g) -> g) tu)]
-
-instance (Typeable a, Typeable b) => Typeable (a -> b) where
- typeOf f = mkFunTy (typeOf ((undefined :: (a -> b) -> a) f))
- (typeOf ((undefined :: (a -> b) -> b) f))