From 8aa22a57ca101487d5aff06e8e99dc41af2de2dc Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 6 Nov 2013 01:18:22 -0400 Subject: [PATCH] use pure or return rather than (:[]) or \x -> [x] --- Build/EvilSplicer.hs | 2 +- Build/OSXMkLibs.hs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Build/EvilSplicer.hs b/Build/EvilSplicer.hs index f40d100331..35dba49688 100644 --- a/Build/EvilSplicer.hs +++ b/Build/EvilSplicer.hs @@ -584,7 +584,7 @@ text_builder_hack = replace "Data.Text.Lazy.Builder.Internal.fromText" "Data.Tex parsecAndReplace :: Parser String -> String -> String parsecAndReplace p s = case parse find "" s of Left e -> s - Right l -> concatMap (either (\c -> [c]) id) l + Right l -> concatMap (either return id) l where find :: Parser [Either Char String] find = many $ try (Right <$> p) <|> (Left <$> anyChar) diff --git a/Build/OSXMkLibs.hs b/Build/OSXMkLibs.hs index ed12a945f1..dae9bc0aea 100644 --- a/Build/OSXMkLibs.hs +++ b/Build/OSXMkLibs.hs @@ -144,7 +144,7 @@ getLibName lib libmap = case M.lookup lib libmap of Just n -> (n, libmap) Nothing -> (nextfreename, M.insert lib nextfreename libmap) where - names = map (\c -> [c]) ['A' .. 'Z'] ++ + names = map pure ['A' .. 'Z'] ++ [[n, l] | n <- ['0' .. '9'], l <- ['A' .. 'Z']] used = S.fromList $ M.elems libmap nextfreename = fromMaybe (error "ran out of short library names!") $