Commit d05f1c86 authored by Niklas Hambuechen's avatar Niklas Hambuechen

Fix hlint warnings found by hlint 1.9.11

Our current hlint version cannot find them yet.
Signed-off-by: default avatarNiklas Hambuechen <niklash@google.com>
Reviewed-by: default avatarKlaus Aehlig <aehlig@google.com>
parent 4320ba1d
......@@ -409,7 +409,7 @@ main opts args = do
sortBy (flip compare `on` length . fst) $
nodesRebootGroups
confToMoveNames =
map (Instance.name *** (Node.name *** flip (>>=) (return . Node.name)))
map (Instance.name *** (Node.name *** (=<<) (return . Node.name)))
. getMoves (nlf, ilf)
namesAndMoves = map (map Node.name *** confToMoveNames) outputRebootGroups
......
......@@ -66,7 +66,7 @@ class FromLispConfig a where
-- | Instance of FromLispConfig for Int.
instance FromLispConfig Int where
fromLispConfig (LCDouble d) = Ok $ floor d
fromLispConfig (LCList (LCString _:LCDouble d:[])) = Ok $ floor d
fromLispConfig (LCList [LCString _, LCDouble d]) = Ok $ floor d
fromLispConfig c =
Bad $ "Unable to extract a Int from this configuration: "
++ show c
......@@ -74,7 +74,7 @@ instance FromLispConfig Int where
-- | Instance of FromLispConfig for Double.
instance FromLispConfig Double where
fromLispConfig (LCDouble d) = Ok d
fromLispConfig (LCList (LCString _:LCDouble d:[])) = Ok d
fromLispConfig (LCList [LCString _, LCDouble d]) = Ok d
fromLispConfig c =
Bad $ "Unable to extract a Double from this configuration: "
++ show c
......@@ -82,7 +82,7 @@ instance FromLispConfig Double where
-- | Instance of FromLispConfig for String
instance FromLispConfig String where
fromLispConfig (LCString s) = Ok s
fromLispConfig (LCList (LCString _:LCString s:[])) = Ok s
fromLispConfig (LCList [LCString _, LCString s]) = Ok s
fromLispConfig c =
Bad $ "Unable to extract a String from this configuration: "
++ show c
......
......@@ -226,8 +226,8 @@ if' _ _ y = y
-- | Parse results from readsPrec.
parseChoices :: Monad m => String -> String -> [(a, String)] -> m a
parseChoices _ _ ((v, ""):[]) = return v
parseChoices name s ((_, e):[]) =
parseChoices _ _ [(v, "")] = return v
parseChoices name s [(_, e)] =
fail $ name ++ ": leftover characters when parsing '"
++ s ++ "': '" ++ e ++ "'"
parseChoices name s _ = fail $ name ++ ": cannot parse string '" ++ s ++ "'"
......
......@@ -86,7 +86,7 @@ instance Arbitrary LispConfig where
-- | Determines conservatively whether a string could be a number.
canBeNumber :: String -> Bool
canBeNumber [] = False
canBeNumber (c:[]) = canBeNumberChar c
canBeNumber [c] = canBeNumberChar c
canBeNumber (c:xs) = canBeNumberChar c && canBeNumber xs
-- | Determines whether a char can be part of the string representation of a
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment