diff options
| author | Joey Hess <joeyh@joeyh.name> | 2015-01-19 15:11:10 -0400 |
|---|---|---|
| committer | Joey Hess <joeyh@joeyh.name> | 2015-01-19 15:11:10 -0400 |
| commit | e583c40c65c5bf179e560a4e483fd7a3e2d6ca42 (patch) | |
| tree | 6eb87b6200084e29164b328f84b8afad831d3e15 | |
| parent | 603e6d340611dc15bca876c6374bf5938b8a3d4e (diff) | |
more reorg
| -rw-r--r-- | src/Propellor/Types.hs | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/src/Propellor/Types.hs b/src/Propellor/Types.hs index e330d5be..12fa676b 100644 --- a/src/Propellor/Types.hs +++ b/src/Propellor/Types.hs @@ -3,13 +3,12 @@ module Propellor.Types ( Host(..) - , Propellor(..) , Property(..) , RevertableProperty(..) , IsProp(..) , Desc , Info(..) - , RunLog + , Propellor(..) , EndAction(..) , module Propellor.Types.OS , module Propellor.Types.Dns @@ -43,18 +42,22 @@ data Host = Host deriving (Show) -- | Propellor's monad provides read-only access to info about the host --- it's running on, and a writer to accumulate logs about the run. -newtype Propellor p = Propellor { runWithHost :: RWST Host RunLog () IO p } +-- it's running on, and a writer to accumulate EndActions. +newtype Propellor p = Propellor { runWithHost :: RWST Host [EndAction] () IO p } deriving ( Monad , Functor , Applicative , MonadReader Host - , MonadWriter RunLog + , MonadWriter [EndAction] , MonadIO , MonadCatchIO ) +-- | An action that Propellor runs at the end, after trying to satisfy all +-- properties. It's passed the combined Result of the entire Propellor run. +data EndAction = EndAction Desc (Result -> Propellor Result) + -- | The core data type of Propellor, this represents a property -- that the system should have, and an action to ensure it has the -- property. @@ -153,9 +156,3 @@ instance Empty Info where , isEmpty (_dockerinfo i) , isEmpty (_chrootinfo i) ] - -type RunLog = [EndAction] - --- | An action that Propellor runs at the end, after trying to satisfy all --- properties. It's passed the combined Result of the entire Propellor run. -data EndAction = EndAction Desc (Result -> Propellor Result) |
