[Haskell] How to define Y combinator in Haskell
Lennart Augustsson
lennart at augustsson.net
Fri Sep 15 08:17:52 EDT 2006
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 at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell
More information about the Haskell
mailing list