
5 Jun
2012
5 Jun
'12
4:28 p.m.
What you want seems a bit tricky.
p :: ProxyWrapper Num p = ProxyWrapper (Proxy :: Proxy Int)
At this point, all you know about p is that it is a Num. You don't know that it is Typeable, because you choose to forget about that. You could give p the type 'ProxyWrapper (Ext Typeable Num)' and it would work.
then the following would give a type error:
oops :: TypeRep oops = typeOfInnerProxy p
Yes, and correctly so. Because Typeable isn't even a superclass of Num. So there's no way to know that p actually contains a Typeable proxy. Cheers, Andres -- Andres Löh, Haskell Consultant Well-Typed LLP, http://www.well-typed.com