HaskellWiki

Haskell | Wiki community | Recent changes
Random page | Special pages

 

Not logged in
Log in | Help

McCarthy91

Categories: Code

mccarthy91 n = 
    if n <= 100
    then (mccarthy91.mccarthy91.(+11)) n 
    else n - 10

or with guards:

mccarthy91 n | n <= 100  = mccarthy91 . mccarthy91 . (+11) $ n
             | otherwise = n - 10

Retrieved from "http://haskell.org/haskellwiki/McCarthy91"

This page has been accessed 685 times. This page was last modified 06:37, 16 November 2006. Recent content is available under a simple permissive license.