News for hackers. Stuff that matters.
Re:Functional Programming in 5 Minutes by derleth on Sunday May 19, 2013 @11:26PM (#5735711)
> I would like to add that recursive calls can be nicer than loops

Having a good library of higher-order functions that encapsulate common recursion patterns is a lot nicer than doing recursion by hand, or having to read code where someone did recursion by hand and you have to not only figure out how the recursion works, but whether the author did anything wrong.

Higher-order functions are control structures, and we should encourage their use for all the same reasons we encourage the use of while loops in preference to people building their loop structures by hand out of gotos and conditional gotos.

Re:Functional Programming in 5 Minutes by eru on Monday May 20, 2013 @06:11AM (#5736812)
As another nice effect, higher-order functions (or as we call them in their use as control structures: combinators) unify data structure and control structures. E.g. folding over a list is equivalent to various loops, the Monad instance of Maybe represents simple exception handling, trees and their traversal are identifiable in some sense, etc.

At least in lazy, statically typed functional languages, like e.g. Haskell.

Re:Functional Programming in 5 Minutes by Paradigma11 on Monday May 20, 2013 @06:56AM (#5736917)
I agree but using mutual recursion to model simple state machines is very nice.