summaryrefslogtreecommitdiff
path: root/Propellor/Types.hs
diff options
context:
space:
mode:
authorJoey Hess2014-03-30 23:37:54 -0400
committerJoey Hess2014-03-30 23:37:54 -0400
commit380c1b0fd6c25dec3c924b82f1d721aa91a001da (patch)
tree7d5b73309b73f13ac2be3f911318fe6a126264ff /Propellor/Types.hs
parent02a7bf5f0e2de1d0dea71781ed0c1ae3a50e6425 (diff)
prepare for hackage
Diffstat (limited to 'Propellor/Types.hs')
-rw-r--r--Propellor/Types.hs22
1 files changed, 22 insertions, 0 deletions
diff --git a/Propellor/Types.hs b/Propellor/Types.hs
new file mode 100644
index 00000000..70ad8f9b
--- /dev/null
+++ b/Propellor/Types.hs
@@ -0,0 +1,22 @@
+module Propellor.Types where
+
+type HostName = String
+type UserName = String
+
+data Property = Property
+ { propertyDesc :: Desc
+ -- | must be idempotent; may run repeatedly
+ , propertySatisfy :: IO Result
+ }
+
+type Desc = String
+
+data Result = NoChange | MadeChange | FailedChange
+ deriving (Show, Eq)
+
+combineResult :: Result -> Result -> Result
+combineResult FailedChange _ = FailedChange
+combineResult _ FailedChange = FailedChange
+combineResult MadeChange _ = MadeChange
+combineResult _ MadeChange = MadeChange
+combineResult NoChange NoChange = NoChange