From 2b722cf3bdd267c999f25c4f1c2ebb4cc4d27cb4 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Mon, 2 Dec 2013 22:56:10 +0100 Subject: add other haskell files --- ch03_localfunction.hs | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 ch03_localfunction.hs (limited to 'ch03_localfunction.hs') 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" -- cgit v1.2.3