
9 Oct
2008
9 Oct
'08
2:51 p.m.
Reiner Pope wrote:
The syntax is for the implicit parameter extension[1]. I think you would write your example as
foo (undefined :: Bar x) ?z :: Bar y
Then querying the type of that whole expression with :t will list ?z's type in the expression's constraints. (Of course, you should turn off the monomorphism restriction so that ghc doesn't complain if constraints aren't resolved).
[1]: http://www.haskell.org/ghc/docs/latest/html/users_guide/other-type-extension...
Woah... that's some pretty crazy stuff, right there. Just wow. It would take me months to comprehend how that works. Heh. Oh well, it's useful for debugging the type system though. ;-)