, select
, applyIf
, commaJoin
- , readEitherString
- , JSRecord
- , loadJSArray
- , fromObj
- , fromObjWithDefault
- , maybeFromObj
- , tryFromObj
- , fromJVal
- , asJSObject
- , asObjectList
- , fromJResult
, tryRead
, formatTable
, parseUnit
+ , plural
) where
import Data.Char (toUpper)
import Debug.Trace
--- we will re-export these for our existing users
-import Ganeti.HTools.JSON
-
-- * Debug functions
-- | To be used only for debugging, breaks referential integrity.
where (x, xs) = break (== sep) s
ys = drop 1 xs
+-- | Simple pluralize helper
+plural :: Int -> String -> String -> String
+plural 1 s _ = s
+plural _ _ p = p
+
-- * Mathematical functions
-- Simple and slow statistical functions, please replace with better