diff options
author | Joey Hess <joey@kitenet.net> | 2013-09-25 03:09:06 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-09-25 03:09:06 -0400 |
commit | d9c5d32c34885cac67c44c633c5351461902d166 (patch) | |
tree | 2628093b15b5564a33364cf67d54d87ef0f2474e /Command/Vicfg.hs | |
parent | 2270913743982ab33c68d17c8ed68326e1711f95 (diff) |
hlint
test suite still passes
Diffstat (limited to 'Command/Vicfg.hs')
-rw-r--r-- | Command/Vicfg.hs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Command/Vicfg.hs b/Command/Vicfg.hs index 1aa8722c5..dfdcde134 100644 --- a/Command/Vicfg.hs +++ b/Command/Vicfg.hs @@ -123,14 +123,14 @@ genCfg cfg descs = unlines $ concat [intro, trust, groups, preferredcontent] settings field desc showvals showdefaults = concat [ desc , concatMap showvals $ sort $ map swap $ M.toList $ field cfg - , concatMap (\u -> lcom $ showdefaults u) $ missing field + , concatMap (lcom . showdefaults) $ missing field ] line setting u value = - [ com $ "(for " ++ (fromMaybe "" $ M.lookup u descs) ++ ")" + [ com $ "(for " ++ fromMaybe "" (M.lookup u descs) ++ ")" , unwords [setting, fromUUID u, "=", value] ] - lcom = map (\l -> if "#" `isPrefixOf` l then l else "#" ++ l) + lcom = map (\l -> if "#" `isPrefixOf` l then l else '#' : l) missing field = S.toList $ M.keysSet descs `S.difference` M.keysSet (field cfg) {- If there's a parse error, returns a new version of the file, @@ -139,7 +139,7 @@ parseCfg :: Cfg -> String -> Either String Cfg parseCfg curcfg = go [] curcfg . lines where go c cfg [] - | null (catMaybes $ map fst c) = Right cfg + | null (mapMaybe fst c) = Right cfg | otherwise = Left $ unlines $ badheader ++ concatMap showerr (reverse c) go c cfg (l:ls) = case parse (dropWhile isSpace l) cfg of |