From da11635b2819eb87a6544823675b4ded257c16ea Mon Sep 17 00:00:00 2001 From: Dan Buch Date: Mon, 2 Apr 2012 23:04:35 -0400 Subject: [PATCH] yet more functions. baby. --- lyahfgg/baby.hs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lyahfgg/baby.hs b/lyahfgg/baby.hs index e81eb5e..352d1ed 100644 --- a/lyahfgg/baby.hs +++ b/lyahfgg/baby.hs @@ -7,3 +7,9 @@ doubleSmallNumber x = if x > 100 else x*2 doubleSmallNumber' x = (if x > 100 then x else x*2) + 1 + +boomBangs xs = [if x < 10 then "BOOM!" else "BANG!" | x <- xs, odd x] + +length' xs = sum [1 | _ <- xs] + +removeNonUppercase st = [c | c <- st, c `elem` ['A'..'Z']]