
9 Oct
2008
9 Oct
'08
2:52 p.m.
Ryan Ingram wrote:
There's also a haskell98 way to do the same thing, it's just a bit more wordy at the ghci prompt, and a bit more work to decode the result:
ghci> :t \z -> (foo (undefined :: Bar x) z :: Bar y)
Now, the type of this expression is clearly
type of z -> Bar y
So just read the value before the arrow to get your answer.
Ah, ingenious! Why did I not think of that...?