summaryrefslogtreecommitdiff
path: root/src/Propellor/Types.hs
diff options
context:
space:
mode:
authorJoey Hess2016-03-24 16:56:01 -0400
committerJoey Hess2016-03-24 16:56:01 -0400
commitc0236e92be55cec267b425a3b1fffc65b119b1aa (patch)
treeac197a09d9d53f81047f53c3ec9cd3a4027597ed /src/Propellor/Types.hs
parentf1168d4b46e9a1c73afe4885f1b14b1bd81b7d50 (diff)
converted PrivData
Somewhat poorly; I don't like needing to export the Property constructor to use it here, and there's a use of undefined where it should be able to use sing. I got quite stuck on this, so am happy to have anything that works.
Diffstat (limited to 'src/Propellor/Types.hs')
-rw-r--r--src/Propellor/Types.hs12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/Propellor/Types.hs b/src/Propellor/Types.hs
index 49ba9220..866e8090 100644
--- a/src/Propellor/Types.hs
+++ b/src/Propellor/Types.hs
@@ -12,10 +12,10 @@
module Propellor.Types
( Host(..)
- , Property
+ , Property(..)
, Info
, Desc
- , mkProperty
+ , property
, MetaType(..)
, OS(..)
, UnixLike
@@ -43,6 +43,7 @@ module Propellor.Types
, module Propellor.Types.Result
, module Propellor.Types.ZFS
, propertySatisfy
+ , Sing
) where
import Data.Monoid
@@ -127,7 +128,8 @@ data ChildProperty = ChildProperty Desc (Propellor Result) Info [ChildProperty]
instance Show ChildProperty where
show (ChildProperty desc _ _ _) = desc
--- | Constructs a Property.
+-- | Constructs a Property, from a description and an action to run to
+-- ensure the Property is met.
--
-- You can specify any metatypes that make sense to indicate what OS
-- the property targets, etc.
@@ -138,12 +140,12 @@ instance Show ChildProperty where
-- > foo = mkProperty "foo" (...)
--
-- Note that using this needs LANGUAGE PolyKinds.
-mkProperty
+property
:: SingI metatypes
=> Desc
-> Propellor Result
-> Property (Sing metatypes)
-mkProperty d a = Property sing d a mempty mempty
+property d a = Property sing d a mempty mempty
-- | Adds info to a Property.
--