[Haskell] recursion patterns?

Henning Thielemann lemming at henning-thielemann.de
Wed May 15 20:17:28 CEST 2013


On Wed, 15 May 2013, 7stud wrote:

> Well, my question does not meet the standards for a question at stackoverflow:
>
> (I am a haskell beginner)

Then you might want to post your question to haskell-beginners mailing 
list.

> Is one solution more efficient than the other?  I believe my solution is 
> tail recursive, but it's my understanding that compilers can now 
> optimize just about anything into tail recursion.

The first solution works for infinite lists and the second one does not. 
It's really like foldr vs. foldl.



More information about the Haskell mailing list