summaryrefslogtreecommitdiffstats
path: root/ch03_localfunction.hs
blob: 61ecc25350ccc6ee9f12ed3bc2c96ea2b8b29dd6 (plain)
1
2
3
4
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"