Commit 05ff7a00 authored by Agata Murawska's avatar Agata Murawska Committed by Iustin Pop
Browse files

Dots in docstings and hlint error fixes for htools


Signed-off-by: default avatarAgata Murawska <agatamurawska@google.com>
Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent d85f01e7
......@@ -286,7 +286,7 @@ processRelocate gl nl il idx 1 exndx = do
when (snode == pnode) $
fail "Internal error: selected primary as new secondary?!"
nodes' <- if (nodes == [pnode, snode])
nodes' <- if nodes == [pnode, snode]
then return [snode] -- only the new secondary is needed
else fail $ "Internal error: inconsistent node list (" ++
show nodes ++ ") versus instance nodes (" ++ show pnode ++
......
......@@ -146,7 +146,7 @@ lookupGroup ktg nname gname =
prefixMatch :: String -- ^ Lookup
-> String -- ^ Full name
-> Bool -- ^ Whether there is a prefix match
prefixMatch lkp = isPrefixOf (lkp ++ ".")
prefixMatch = isPrefixOf . (++ ".")
-- | Is the lookup priority a "good" one?
goodMatchPriority :: MatchPriority -> Bool
......@@ -178,7 +178,7 @@ chooseLookupResult lkp cstr old =
select (min new old)
-- special cases:
-- short circuit if the new result is an exact match
[ ((lrMatchPriority new) == ExactMatch, new)
[ (lrMatchPriority new == ExactMatch, new)
-- if both are partial matches generate a multiple match
, (partial2, LookupResult MultipleMatch lkp)
] where new = compareNameComponent cstr lkp
......
......@@ -223,11 +223,11 @@ create name_init mem_t_init mem_n_init mem_f_init
-- | Conversion formula from mDsk\/tDsk to loDsk.
mDskToloDsk :: Double -> Double -> Int
mDskToloDsk mval tdsk = floor (mval * tdsk)
mDskToloDsk mval = floor . (mval *)
-- | Conversion formula from mCpu\/tCpu to hiCpu.
mCpuTohiCpu :: Double -> Double -> Int
mCpuTohiCpu mval tcpu = floor (mval * tcpu)
mCpuTohiCpu mval = floor . (mval *)
-- | Changes the index.
--
......
......@@ -41,7 +41,7 @@ testSuite tsname tdef = do
tests <- mapM (\n -> [| (run $(varE n), $(litE . StringL . nameBase $ n)) |])
tdef
sigtype <- [t| (String, [(Args -> IO Result, String)]) |]
return $ [ SigD fullname sigtype
, ValD (VarP fullname) (NormalB (TupE [LitE (StringL tsname),
ListE tests])) []
]
return [ SigD fullname sigtype
, ValD (VarP fullname) (NormalB (TupE [LitE (StringL tsname),
ListE tests])) []
]
......@@ -72,7 +72,7 @@ debugFn fn x = debug (fn x) `seq` x
-- | Show the first parameter before returning the second one.
debugXy :: Show a => a -> b -> b
debugXy a b = debug a `seq` b
debugXy = seq . debug
-- * Miscellaneous
......
......@@ -132,7 +132,7 @@ $(genLuxiOp "LuxiOp"
[ ("flag", [t| Bool |], [| id |]) ],
[| J.showJSON |])
, ("SetWatcherPause",
[ ("duration", [t| Double |], [| \x -> [x] |]) ],
[ ("duration", [t| Double |], [| (: []) |]) ],
[| J.showJSON |])
])
......
......@@ -227,7 +227,7 @@ deCamelCase :: String -> String
deCamelCase =
intercalate "_" . map (map toUpper) . groupBy (\_ b -> not $ isUpper b)
-- | Computes the name of a given constructor
-- | Computes the name of a given constructor.
constructorName :: Con -> Q Name
constructorName (NormalC name _) = return name
constructorName (RecC name _) = return name
......@@ -255,7 +255,7 @@ genConstrToStr trans_fun name fname = do
genOpID :: Name -> String -> Q [Dec]
genOpID = genConstrToStr deCamelCase
-- | OpCode parameter (field) type
-- | OpCode parameter (field) type.
type OpParam = (String, Q Type, Q Exp)
-- | Generates the OpCode data type.
......@@ -292,7 +292,7 @@ genOpCode name cons = do
(loadsig, loadfn) <- genLoadOpCode cons
return [declD, loadsig, loadfn, savesig, savefn]
-- | Checks whether a given parameter is options
-- | Checks whether a given parameter is options.
--
-- This requires that it's a 'Maybe'.
isOptional :: Type -> Bool
......
......@@ -56,7 +56,7 @@ usage name = do
main :: IO ()
main = do
binary <- getEnv "HTOOLS" `catch` (\_ -> getProgName)
binary <- getEnv "HTOOLS" `catch` const getProgName
let name = map toLower binary
boolnames = map (\(x, y) -> (x == name, y)) personalities
select (usage name) boolnames
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