Y combinator

Antonio Eduardo Costa Pereira costa@ufu.br
Fri, 10 Dec 1999 12:18:57 -0200


 Dr. Mark E. Hall wrote:

> Yes, you can write similar code in Clean. The following should work just
> fine (I haven't had time to re-install Clean since upgrading my hardware
> recently, so I haven't tried it):
> 
> :: D a = Disguise ((D a) -> a)
> 
> yCurry :: (a -> a) -> a
> yCurry f = let
> 		g (Disguise x) = f (x (Disguise x))
> 	in g (Disguise g)

Dear Sir.
Thank you very much for the information. I tested your code,
and it works fine. I have been trying to write similar code, without
success. Your letter was of great help indeed.

By the way, I intend to write in Clean (and Haskell) all the 
combinators of Descles' book on functional linguistics. Therefore, I 
really needed to learn how to write this kind of thing without using 
recursivity. That is why I didn't want to use Y f= f (Y f).

Thank you once more.

Eduardo Costa.