summaryrefslogtreecommitdiff
path: root/src/Propellor/Property/List.hs
diff options
context:
space:
mode:
authorJoey Hess2016-03-25 14:24:09 -0400
committerJoey Hess2016-03-25 14:24:09 -0400
commit9768434f5fa2f2ed0bbb0212763a76471186a3cd (patch)
treec5c13b99ef9cb38351a0a0c8ab25280ff3a155f9 /src/Propellor/Property/List.hs
parent91d1833155a2e8be2c435d0a92a750cc9d2f30b5 (diff)
finished porting Property.User
Diffstat (limited to 'src/Propellor/Property/List.hs')
-rw-r--r--src/Propellor/Property/List.hs10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/Propellor/Property/List.hs b/src/Propellor/Property/List.hs
index b4a72fa8..44916f23 100644
--- a/src/Propellor/Property/List.hs
+++ b/src/Propellor/Property/List.hs
@@ -7,18 +7,22 @@
module Propellor.Property.List (
props,
Props,
+ toProps,
propertyList,
combineProperties,
) where
import Propellor.Types
import Propellor.Types.MetaTypes
-import Propellor.Engine
import Propellor.PropAccum
+import Propellor.Engine
import Propellor.Exception
import Data.Monoid
+toProps :: [Property (MetaTypes metatypes)] -> Props (MetaTypes metatypes)
+toProps ps = Props (map toProp ps)
+
-- | Combines a list of properties, resulting in a single property
-- that when run will run each property in the list in turn,
-- and print out the description of each as it's run. Does not stop
@@ -30,7 +34,7 @@ import Data.Monoid
-- > & bar
-- > & baz
propertyList :: SingI metatypes => Desc -> Props (MetaTypes metatypes) -> Property (MetaTypes metatypes)
-propertyList desc (Props _i ps) =
+propertyList desc (Props ps) =
property desc (ensureChildProperties cs)
`modifyChildren` (++ cs)
where
@@ -39,7 +43,7 @@ propertyList desc (Props _i ps) =
-- | Combines a list of properties, resulting in one property that
-- ensures each in turn. Stops if a property fails.
combineProperties :: SingI metatypes => Desc -> Props (MetaTypes metatypes) -> Property (MetaTypes metatypes)
-combineProperties desc (Props _i ps) =
+combineProperties desc (Props ps) =
property desc (combineSatisfy cs NoChange)
`modifyChildren` (++ cs)
where