Revision 61bbbed7 htools/Ganeti/HTools/Utils.hs
b/htools/Ganeti/HTools/Utils.hs | ||
---|---|---|
30 | 30 |
, stdDev |
31 | 31 |
, if' |
32 | 32 |
, select |
33 |
, applyIf |
|
33 | 34 |
, commaJoin |
34 | 35 |
, readEitherString |
35 | 36 |
, JSRecord |
... | ... | |
76 | 77 |
|
77 | 78 |
-- * Miscellaneous |
78 | 79 |
|
80 |
-- | Apply the function if condition holds, otherwise use default value. |
|
81 |
applyIf :: Bool -> (a -> a) -> a -> a |
|
82 |
applyIf b f x = if b then f x else x |
|
83 |
|
|
79 | 84 |
-- | Comma-join a string list. |
80 | 85 |
commaJoin :: [String] -> String |
81 | 86 |
commaJoin = intercalate "," |
Also available in: Unified diff