2 ms·
Nice to see an article on news.ycombinator.com that actually uses the Y combinator. A particularly pleasant definition of it, too: Y(a) = g(g) where g(x)
by kragen 5y ago
Nice to see an article on news.ycombinator.com that actually uses the Y combinator. A particularly pleasant definition of it, too:
Y(a) = g(g) where g(x) = a(x(x));
But I think in PyFL functions are not automatically curried, so that's only applicable to functions of one argument.
I like his syntactic sugar for what would be list comprehensions in Python:
nprime = not exist p in primes: n mod p == 0 end;
rather than Python's
nprime = not [p for p in primes if n % p == 0]
but I wonder if the Python/Haskell approach offers more composability.