Meh, the Y combinator is a funny hack. A lot of people waffle on about it because they're blown away by how crazy untyped lambda calculus is. There are all kinds of ways to introduce recursion into a language, though. It's simply interesting that you might get it on accident in a language will as little restriction as UTLC.
Re:Big changes to Erlang
by colanderman on Saturday February 01, 2014 @02:14PM
(#7162931)
Oh don't worry, you can make a Y combinator in a typed lambda calculus too, it's just a little more involved: http://en.wikipedia.org/wiki/Fixed-point_combinator#Type_for...
Depends on the type theory. You need recursive types. Or you can just posit fix.
I think there's definitely a rule against dismissing Y combinators on news.ycombinator.com.
They're important in CS theory, sure, but you sure don't want to encounter one in raw form lurking in a regular codebase. (Just like you wouldn't want to encounter monadic IO in raw >>= form.)
Using the y combinator outside of some ridiculously abstract code would be irritating. Using (>>=) makes sense sometimes though. For instance if you just wanted to echo something you could do
do stuff <- getLine
putStrLn stuff
but the stuff variable is then unnecessarily introduced. You could instead just write getLine >>= putStrLn
or the flipped version if you want it to read more like function application putStrLn =<< getLine
Re:Big changes to Erlang
by logicallee on Saturday February 01, 2014 @02:33PM
(#7163012)
how do neither of you get the obvious joke OP is making with "I think there's definitely a rule against dismissing Y combinators on news.ycombinator.com". (he's making a joke out of the fact that YCombinator is named after the construct.)
That wasn't a joke.. People have been hellbanned for speaking ill of Y combinators.
Really?
Maybe that was the joke.
>Just like you wouldn't want to encounter monadic IO in raw >>= form
Yes I would. I would much rather see "getLine >>= putStrLn" than a 2 line do block.
Re:Big changes to Erlang
by dschiptsov on Sunday February 02, 2014 @05:09AM
(#7165538)
There are two side notes. 1. Should we really be constrained by frequent pub visitors when teaching CS? Adapting to stupidity (OK, mediocrity) caused Java and switch from Scheme to Python for intro courses at MIT (with great help of mr. Guttag, I suppose).
2. Should we ever hire a person who couldn't get what Y Combinator is or not being able to write one in Scheme?
Update: Python is heavily used in Biology and related research (so they said) and transition at MIT seemed like reasonable, but I still believe that Scheme shall be the language for serious introductory courses, like classic Berkeley CS61a was. Now PLT/Racket folks are doing great job of introducing proper concepts and developing "good habits" to students.
Priceless (and completely true). I really think this attitude is why Erlang is such a success.