From e583c40c65c5bf179e560a4e483fd7a3e2d6ca42 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 19 Jan 2015 15:11:10 -0400 Subject: more reorg --- src/Propellor/Types.hs | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'src/Propellor') 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) -- cgit v1.2.3