From 1cd7f557f0c89714c47855f38583073c313674f2 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 23 Oct 2015 17:25:31 -0400 Subject: generalize check Hmm, do I really need my own type class for LiftPropellor? This seems like a general problem so I am probably reinventing the wheel. --- src/Propellor/Types.hs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/Propellor/Types.hs') diff --git a/src/Propellor/Types.hs b/src/Propellor/Types.hs index fc700df0..5904374e 100644 --- a/src/Propellor/Types.hs +++ b/src/Propellor/Types.hs @@ -29,6 +29,7 @@ module Propellor.Types , CombinedType , combineWith , Propellor(..) + , LiftPropellor(..) , EndAction(..) , module Propellor.Types.OS , module Propellor.Types.Dns @@ -72,6 +73,15 @@ newtype Propellor p = Propellor { runWithHost :: RWST Host [EndAction] () IO p } , MonadMask ) +class LiftPropellor m where + liftPropellor :: m a -> Propellor a + +instance LiftPropellor Propellor where + liftPropellor = id + +instance LiftPropellor IO where + liftPropellor = liftIO + instance Monoid (Propellor Result) where mempty = return NoChange -- | The second action is only run if the first action does not fail. -- cgit v1.2.3