instances of Typable

Glynn Clements glynn.clements@virgin.net
Fri, 26 Jul 2002 00:30:25 +0100


Hal Daume III wrote:

> if I have
> 
> newtype Foo = Foo Int
> 
> and i want to make it an instance of typeable, how do I create a TypeRep
> object?

	fooTc :: TyCon
	fooTc = mkTyCon "Foo"
	
	instance Typeable Foo where
	    typeOf _ = mkAppTy fooTc []

-- 
Glynn Clements <glynn.clements@virgin.net>