propellor/Propellor/Types.hs

27 lines
555 B
Haskell
Raw Normal View History

2014-03-31 03:37:54 +00:00
module Propellor.Types where
2014-03-30 23:10:32 +00:00
2014-03-31 14:36:45 +00:00
import Data.Monoid
2014-03-30 23:10:32 +00:00
type HostName = String
type UserName = String
data Property = Property
{ propertyDesc :: Desc
2014-03-31 03:37:54 +00:00
-- | must be idempotent; may run repeatedly
2014-03-30 23:10:32 +00:00
, propertySatisfy :: IO Result
}
type Desc = String
data Result = NoChange | MadeChange | FailedChange
deriving (Show, Eq)
2014-03-31 14:36:45 +00:00
instance Monoid Result where
mempty = NoChange
mappend FailedChange _ = FailedChange
mappend _ FailedChange = FailedChange
mappend MadeChange _ = MadeChange
mappend _ MadeChange = MadeChange
mappend NoChange NoChange = NoChange