diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2013-12-02 22:56:10 +0100 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2013-12-02 22:56:10 +0100 |
commit | 2b722cf3bdd267c999f25c4f1c2ebb4cc4d27cb4 (patch) | |
tree | 95a2fa4d0aac52f4a82e234276ce7ede15a8e8ff /ch03_localfunction.hs | |
parent | 40860a46fa0a22cc376b015e36744c8573f92654 (diff) | |
download | haskell-2b722cf3bdd267c999f25c4f1c2ebb4cc4d27cb4.tar.gz haskell-2b722cf3bdd267c999f25c4f1c2ebb4cc4d27cb4.tar.bz2 haskell-2b722cf3bdd267c999f25c4f1c2ebb4cc4d27cb4.zip |
add other haskell files
Diffstat (limited to 'ch03_localfunction.hs')
-rw-r--r-- | ch03_localfunction.hs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/ch03_localfunction.hs b/ch03_localfunction.hs new file mode 100644 index 0000000..61ecc25 --- /dev/null +++ b/ch03_localfunction.hs @@ -0,0 +1,5 @@ +pluralise :: String -> Int -> String +pluralise word counts = plural counts + where plural 0 = "no " ++ word ++ "s" + plural 1 = "one " ++ word + plural n = show n ++ " " ++ word ++ "s" |