5 module Ganeti.HTools.Types
8 -- | The instance index type.
11 -- | The node index type.
14 -- | The type used to hold name-to-idx mappings.
15 type NameAssoc = [(String, Int)]
19 This is similar to the JSON library Result type - *very* similar, but
20 we want to use it in multiple places, so we abstract it into a
29 instance Monad Result where
30 (>>=) (Bad x) _ = Bad x
31 (>>=) (Ok x) fn = fn x
35 -- | A generic class for items that have updateable names and indices.
37 -- | Returns the name of the element
39 -- | Returns the index of the element
41 -- | Updates the name of the element
42 setName :: a -> String -> a
43 -- | Updates the index of the element
44 setIdx :: a -> Int -> a