Tail recursion (87)

23 Name: #!/usr/bin/anonymous : 2006-02-28 20:17 ID:qq6fgBY7

I ripped off that code from "The Evolution of a Haskell Programmer" (http://www.willamette.edu/~fruehr/haskell/evolution.html). It's an example of what someone thinking in Pascal might write.

The one-line version actually does give a pretty good indication of Haskell. Lots of things can be done in one or two lines, like finding the minimum element of a list:

minlist = foldl1 min

Don't take my word for it though, try it.

This thread has been closed. You cannot post in this thread any longer.