How to define Y combinator in Haskell
15 Sep
2006
15 Sep
'06
12:11 p.m.
Hi, Writing yc = \f -> (\x -> f(x x)) (\x -> f(x x)) causes type error. Is there a way to define it in Haskell? Thanks, Haihua
15 Sep
15 Sep
12:17 p.m.
Well, you can do it with the existing recursion in Haskell let yc f = f (yc f) Or you can encode it with type level recursion and no value recursion by using a recursive data type. -- Lennart On Sep 15, 2006, at 08:11 , Haihua Lin wrote:
Hi,
Writing
yc = \f -> (\x -> f(x x)) (\x -> f(x x))
causes type error. Is there a way to define it in Haskell?
Thanks, Haihua
_______________________________________________ Haskell mailing list Haskell@haskell.org http://www.haskell.org/mailman/listinfo/haskell
7286
Age (days ago)
7286
Last active (days ago)
1 comments
2 participants
participants (2)
-
Haihua Lin -
Lennart Augustsson