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
( 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)