From 4ffd00b5755da6a5c6f05f2f636d1900a35b83cd Mon Sep 17 00:00:00 2001 From: Daniel Gröber Date: Fri, 30 Oct 2015 17:26:01 +0100 Subject: Fix warnings --- CabalHelper/Common.hs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'CabalHelper/Common.hs') diff --git a/CabalHelper/Common.hs b/CabalHelper/Common.hs index 391a842..37c217a 100644 --- a/CabalHelper/Common.hs +++ b/CabalHelper/Common.hs @@ -96,10 +96,11 @@ takeExtension' p = then "" -- just ".cabal" is not a valid cabal file else takeExtension p -replace n r h = go "" n r h +replace :: String -> String -> String -> String +replace n r hs' = go "" hs' where - go acc n r h + go acc h | take (length n) h == n = reverse acc ++ r ++ drop (length n) h - go acc n r (h:hs) = go (h:acc) n r hs - go acc n r [] = reverse acc + go acc (h:hs) = go (h:acc) hs + go acc [] = reverse acc -- cgit v1.2.3