Commit 8f467ab0 authored by Klaus Aehlig's avatar Klaus Aehlig

Improve haskell style

...by fixing lint warnings found by HLint v1.8.57. In particular,
make sure 'make hlint' passes for this version of hlint.
Signed-off-by: default avatarKlaus Aehlig <aehlig@google.com>
Reviewed-by: default avatarHelga Velroyen <helgav@google.com>
parent 4868dfd5
......@@ -385,7 +385,7 @@ failureReason = show . fst . head
-- | Sorts the failure reasons.
sortReasons :: [(FailMode, Int)] -> [(FailMode, Int)]
sortReasons = reverse . sortBy (comparing snd)
sortReasons = sortBy (flip $ comparing snd)
-- | Runs an allocation algorithm and saves cluster state.
runAllocation :: ClusterData -- ^ Cluster data
......
......@@ -45,6 +45,7 @@ module Ganeti.JQueue
, noSuchJob
) where
import Control.Applicative((<$>))
import Control.Exception
import Control.Monad
import Data.List
......@@ -235,7 +236,7 @@ determineJobDirectories rootdir archived = do
-- FIXME: delete this and just use \'sequence\' instead when Lucid compatibility
-- will not be required anymore.
sequencer :: [Either IOError [JobId]] -> Either IOError [[JobId]]
sequencer l = fmap reverse $ foldl seqFolder (Right []) l
sequencer l = reverse <$> foldl seqFolder (Right []) l
-- | Folding function for joining multiple [JobIds] into one list.
seqFolder :: Either IOError [[JobId]]
......
......@@ -176,8 +176,8 @@ error404 = do
-- | Return the report of one collector
oneReport :: Snap ()
oneReport = do
categoryName <- fmap (maybe mzero unpack) $ getParam "category"
collectorName <- fmap (maybe mzero unpack) $ getParam "collector"
categoryName <- maybe mzero unpack <$> getParam "category"
collectorName <- maybe mzero unpack <$> getParam "collector"
category <-
case catFromName categoryName of
BT.Ok cat -> return cat
......
......@@ -35,6 +35,7 @@ module Test.Ganeti.HTools.Instance
, Instance.Instance(..)
) where
import Control.Applicative ((<$>))
import Control.Monad (liftM)
import Test.QuickCheck hiding (Result)
......@@ -112,7 +113,7 @@ genInstanceOnNodeList nl = do
genInstanceList :: Gen Instance.Instance -> Gen Instance.List
genInstanceList igen = fmap (snd . Loader.assignIndices) names_instances
where names_instances =
(fmap . map) (\n -> (Instance.name n, n)) $ listOf igen
map (\n -> (Instance.name n, n)) <$> listOf igen
-- let's generate a random instance
instance Arbitrary Instance.Instance where
......
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