more reorg

This commit is contained in:
Joey Hess 2015-01-19 15:11:10 -04:00
parent 603e6d3406
commit e583c40c65
1 changed files with 8 additions and 11 deletions

View File

@ -3,13 +3,12 @@
module Propellor.Types module Propellor.Types
( Host(..) ( Host(..)
, Propellor(..)
, Property(..) , Property(..)
, RevertableProperty(..) , RevertableProperty(..)
, IsProp(..) , IsProp(..)
, Desc , Desc
, Info(..) , Info(..)
, RunLog , Propellor(..)
, EndAction(..) , EndAction(..)
, module Propellor.Types.OS , module Propellor.Types.OS
, module Propellor.Types.Dns , module Propellor.Types.Dns
@ -43,18 +42,22 @@ data Host = Host
deriving (Show) deriving (Show)
-- | Propellor's monad provides read-only access to info about the host -- | 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. -- it's running on, and a writer to accumulate EndActions.
newtype Propellor p = Propellor { runWithHost :: RWST Host RunLog () IO p } newtype Propellor p = Propellor { runWithHost :: RWST Host [EndAction] () IO p }
deriving deriving
( Monad ( Monad
, Functor , Functor
, Applicative , Applicative
, MonadReader Host , MonadReader Host
, MonadWriter RunLog , MonadWriter [EndAction]
, MonadIO , MonadIO
, MonadCatchIO , 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 -- | The core data type of Propellor, this represents a property
-- that the system should have, and an action to ensure it has the -- that the system should have, and an action to ensure it has the
-- property. -- property.
@ -153,9 +156,3 @@ instance Empty Info where
, isEmpty (_dockerinfo i) , isEmpty (_dockerinfo i)
, isEmpty (_chrootinfo 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)