summaryrefslogtreecommitdiff
path: root/src/Propellor/Types/Info.hs
diff options
context:
space:
mode:
authorJoey Hess2016-03-27 19:59:20 -0400
committerJoey Hess2016-03-27 19:59:20 -0400
commit9d6dc29555b8499d8ae6c73c891b0b5dc19f83e5 (patch)
tree875311342f65bcdc380b31a14be8def60533b670 /src/Propellor/Types/Info.hs
parent3383d008c7df57e6b5dd066fa1dfa80ac39cdd8e (diff)
improve haddocks and move code around to make them more clear
Diffstat (limited to 'src/Propellor/Types/Info.hs')
-rw-r--r--src/Propellor/Types/Info.hs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/Propellor/Types/Info.hs b/src/Propellor/Types/Info.hs
index c7f6b82f..2e188ae5 100644
--- a/src/Propellor/Types/Info.hs
+++ b/src/Propellor/Types/Info.hs
@@ -19,6 +19,9 @@ import Data.Monoid
import Prelude
-- | Information about a Host, which can be provided by its properties.
+--
+-- Many different types of data can be contained in the same Info value
+-- at the same time. See `toInfo` and `fromInfo`.
newtype Info = Info [InfoEntry]
deriving (Monoid, Show)
@@ -47,6 +50,8 @@ class (Typeable v, Monoid v, Show v) => IsInfo v where
addInfo :: IsInfo v => Info -> v -> Info
addInfo (Info l) v = Info (InfoEntry v:l)
+-- | Converts any value in the `IsInfo` type class into an Info,
+-- which is otherwise empty.
toInfo :: IsInfo v => v -> Info
toInfo = addInfo mempty