diff options
| author | Joey Hess <joey@kitenet.net> | 2014-03-31 10:36:45 -0400 |
|---|---|---|
| committer | Joey Hess <joey@kitenet.net> | 2014-03-31 10:36:45 -0400 |
| commit | 9b65d9650404d8b7202fc63ba23554d734589f20 (patch) | |
| tree | f19d1e948823bcae4de99a52baac5b1ad8781b8a /Propellor/Types.hs | |
| parent | f9536060e86971f37f337132de9a4a0ed327e727 (diff) | |
monoid
Diffstat (limited to 'Propellor/Types.hs')
| -rw-r--r-- | Propellor/Types.hs | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/Propellor/Types.hs b/Propellor/Types.hs index 70ad8f9b..ec472ffe 100644 --- a/Propellor/Types.hs +++ b/Propellor/Types.hs @@ -1,5 +1,7 @@ module Propellor.Types where +import Data.Monoid + type HostName = String type UserName = String @@ -14,9 +16,11 @@ 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 +instance Monoid Result where + mempty = NoChange + + mappend FailedChange _ = FailedChange + mappend _ FailedChange = FailedChange + mappend MadeChange _ = MadeChange + mappend _ MadeChange = MadeChange + mappend NoChange NoChange = NoChange |
