From c0236e92be55cec267b425a3b1fffc65b119b1aa Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 24 Mar 2016 16:56:01 -0400 Subject: 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. --- src/Propellor/Types.hs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/Propellor/Types.hs') 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. -- -- cgit v1.2.3