Revision 9188aeef Ganeti/HTools/Types.hs

b/Ganeti/HTools/Types.hs
5 5
module Ganeti.HTools.Types
6 6
    where
7 7

  
8
-- | The instance index type
8
-- | The instance index type.
9 9
type Idx = Int
10 10

  
11
-- | The node index type
11
-- | The node index type.
12 12
type Ndx = Int
13 13

  
14
-- | The type used to hold name-to-idx mappings
14
-- | The type used to hold name-to-idx mappings.
15 15
type NameAssoc = [(String, Int)]
16 16

  
17 17
{-|
......
32 32
    return = Ok
33 33
    fail = Bad
34 34

  
35
-- | A generic class for items that have names and indices
35
-- | A generic class for items that have updateable names and indices.
36 36
class Element a where
37
    -- | Returns the name of the element
37 38
    nameOf  :: a -> String
39
    -- | Returns the index of the element
38 40
    idxOf   :: a -> Int
41
    -- | Updates the name of the element
39 42
    setName :: a -> String -> a
43
    -- | Updates the index of the element
40 44
    setIdx  :: a -> Int -> a

Also available in: Unified diff