The Evolution of a Haskell Programmer

黑出翔了。。。

转自http://www.willamette.edu/~fruehr/haskell/evolution.html

作者Fritz Ruehr

Freshman Haskell programmer

fac n = if n == 0 
           then 1
           else n * fac (n-1)

Sophomore Haskell programmer, at MIT

(studied Scheme as a freshman)
fac = (\(n) ->
        (if ((==) n 0)
            then 1
            else ((*) n (fac ((-) n 1)))))

Junior Haskell programmer

(beginning Peano player)
fac 0 = 1
fac n = n * fac (n-1)

Continue reading The Evolution of a Haskell Programmer