Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
snf-ganeti
Commits
4333a887
Commit
4333a887
authored
May 24, 2009
by
Iustin Pop
Browse files
Add some utility functions for kt deprecation
These will be used to remove even more uses of ktn/kti in non-critical paths.
parent
dbd6700b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Ganeti/HTools/Container.hs
View file @
4333a887
...
@@ -9,6 +9,7 @@ module Ganeti.HTools.Container
...
@@ -9,6 +9,7 @@ module Ganeti.HTools.Container
(
(
-- * Types
-- * Types
Container
Container
,
Key
-- * Creation
-- * Creation
,
empty
,
empty
,
fromAssocList
,
fromAssocList
...
...
Ganeti/HTools/Types.hs
View file @
4333a887
...
@@ -60,3 +60,11 @@ instance Element Instance.Instance where
...
@@ -60,3 +60,11 @@ instance Element Instance.Instance where
idx
=
Instance
.
idx
idx
=
Instance
.
idx
setName
=
Instance
.
setName
setName
=
Instance
.
setName
setIdx
=
Instance
.
setIdx
setIdx
=
Instance
.
setIdx
-- | Compute the name of an element in a container
cNameOf
::
(
Element
a
)
=>
Container
.
Container
a
->
Container
.
Key
->
String
cNameOf
c
k
=
name
$
Container
.
find
k
c
-- | Compute the maximum name length in an Element Container
cMaxNamelen
::
(
Element
a
)
=>
Container
.
Container
a
->
Int
cMaxNamelen
=
maximum
.
map
(
length
.
name
)
.
Container
.
elems
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment