summaryrefslogtreecommitdiff
path: root/src/Propellor/Types
diff options
context:
space:
mode:
Diffstat (limited to 'src/Propellor/Types')
-rw-r--r--src/Propellor/Types/Core.hs3
-rw-r--r--src/Propellor/Types/Info.hs1
2 files changed, 4 insertions, 0 deletions
diff --git a/src/Propellor/Types/Core.hs b/src/Propellor/Types/Core.hs
index 88c749b3..9f4dc519 100644
--- a/src/Propellor/Types/Core.hs
+++ b/src/Propellor/Types/Core.hs
@@ -109,3 +109,6 @@ instance IsProp ChildProperty where
getInfo (ChildProperty _ _ i _) = i
toChildProperty = id
getSatisfy (ChildProperty _ a _ _) = a
+
+propsInfo :: Props metatypes -> Info
+propsInfo (Props l) = mconcat (map getInfo l)
diff --git a/src/Propellor/Types/Info.hs b/src/Propellor/Types/Info.hs
index b941cc8f..27633712 100644
--- a/src/Propellor/Types/Info.hs
+++ b/src/Propellor/Types/Info.hs
@@ -63,6 +63,7 @@ addInfo (Info l) v = Info (l++[InfoEntry v])
toInfo :: IsInfo v => v -> Info
toInfo = addInfo mempty
+-- | Extracts a value from an Info.
fromInfo :: IsInfo v => Info -> v
fromInfo (Info l) = mconcat (mapMaybe extractInfoEntry l)