
2 Jul
2009
2 Jul
'09
8:22 p.m.
Edward Kmett 쓴 글:
Actually the problem lies in your definition of fz, it has the wrong type to be used in lam.
The Z you get out of fz as type Z b String, but you need it to have Z (a -> b) String so that when you strip off the Z you have a Y String (a -> b) matching the result type of lam.
To get there replace your definition of fz with:
fz :: Z a String -> Z (a -> b) String fz = Z . Y . unY . f . unZ
I think this seems to be the Yeoh wanted. Mine was just blinded hack just to make it type check without looking at what program means.