Revision 4333a887

b/Ganeti/HTools/Container.hs
9 9
    (
10 10
     -- * Types
11 11
     Container
12
    , Key
12 13
     -- * Creation
13 14
    , empty
14 15
    , fromAssocList
b/Ganeti/HTools/Types.hs
60 60
    idx = Instance.idx
61 61
    setName = Instance.setName
62 62
    setIdx = Instance.setIdx
63

  
64
-- | Compute the name of an element in a container
65
cNameOf :: (Element a) => Container.Container a -> Container.Key -> String
66
cNameOf c k = name $ Container.find k c
67

  
68
-- | Compute the maximum name length in an Element Container
69
cMaxNamelen :: (Element a) => Container.Container a -> Int
70
cMaxNamelen = maximum . map (length . name) . Container.elems

Also available in: Unified diff