use pure or return rather than (:[]) or \x -> [x]
This commit is contained in:
parent
8b5de8588d
commit
8aa22a57ca
2 changed files with 2 additions and 2 deletions
|
@ -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)
|
||||
|
|
|
@ -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!") $
|
||||
|
|
Loading…
Reference in a new issue