[Haskell-cafe] Haskell Pangolins

Scott Turner p.turner at computer.org
Wed Dec 29 19:54:15 EST 2004


On 2004 December 29 Wednesday 19:13, Dominic Fox wrote:
> any obvious respects in which this program
> could be simplified, clarified or made more idiomatic.

isYes = `elem` ["y", "yes", "Y", "YES"]

withArticle fullString@(x:xs) =
 (if x `elem` "aeiou" then "an " else "a ") ++ fullString
withArticle [] = "" -- in case of empty input


More information about the Haskell-Cafe mailing list