Commit 25fe44b7 authored by Niklas Hambuechen's avatar Niklas Hambuechen Committed by Klaus Aehlig
Browse files

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>

Cherry-picked-from: d05f1c86

Signed-off-by: default avatarKlaus Aehlig <aehlig@google.com>
Reviewed-by: default avatarPetr Pudlak <pudlak@google.com>
parent fef5c09e
......@@ -400,7 +400,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
......
......@@ -57,7 +57,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
......@@ -65,7 +65,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
......@@ -73,7 +73,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
......
......@@ -163,8 +163,8 @@ if' _ _ y = y
-- | Parse results from readsPrec.
parseChoices :: (Monad m, Read a) => 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 ++ "'"
......
......@@ -77,7 +77,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