Skip to content

Instantly share code, notes, and snippets.

@hgiasac
Created January 4, 2019 17:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hgiasac/c7f5093c3773c252083d5d78a570a0eb to your computer and use it in GitHub Desktop.
Save hgiasac/c7f5093c3773c252083d5d78a570a0eb to your computer and use it in GitHub Desktop.
INSTANCE_TYPEABLE0(Bool,boolTc,"Bool")
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
...
tup4Tc :: TyCon
tup4Tc = mkTyCon ",,," -- too much boilerplate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment