summaryrefslogtreecommitdiff
path: root/Propellor/Types.hs
diff options
context:
space:
mode:
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