From 2220b3753ca46b89e93fac469a22fa3f346804d9 Mon Sep 17 00:00:00 2001 From: Shaun Kerr Date: Tue, 12 Mar 2019 14:50:34 +1300 Subject: [PATCH] cleanup --- beer.hs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/beer.hs b/beer.hs index 10358c4..c0049fc 100644 --- a/beer.hs +++ b/beer.hs @@ -11,8 +11,10 @@ conk [] _ = id lyrc'b'o :: Integer -> ((Integer -> String) -> String) lyrc'b'o x | (x == 0) = (\_ -> "no more bottles") - | (x == 1) = (\f -> conk [(f x), "bottle"] (' ':) $ []) - | otherwise = (\f -> conk [(f x), "bottles"] (' ':) $ []) + | (x == 1) = cenk "bottle" x + | otherwise = cenk "bottles" x + where + cenk s x = (\f -> conk [(f x), s] (' ':) $ []) lyrc's'o :: String -> ((Integer -> String) -> String) lyrc's'o s = (\_ -> s)