úÎ[˜X),      !"#$%&'()*+The  type and API(c) Eitan Chatav, 2015 PublicDomaineitan.chatav@gmail.com experimental Safe-Inferred The  a l m r^ type encodes a nullable monad transformer in continuation passing style which is monadic in r0. This property holds for any type constructor m.=Construct a continuation-passing computation from a function.SThe result of running a CPS computation with given nothing and just continuations. embeds , in  a. is the CPS representation of -.PApply a function to transform the result of a continuation-passing computation.bApply a function to transform the just continuation passed to a continuation-passing computation.eApply a function to transform the nothing continuation passed to a continuation-passing computation..$Call with current just continuation./ a is a monad transformer.0The 1 instance encodes monadicity of  a m.2The 3# instance encodes applicativity of  a m.4The 5# instance encodes functoriality of  a m. ./024 ./024The  type and API(c) Eitan Chatav, 2015 PublicDomaineitan.chatav@gmail.com experimental Safe-Inferred a rD is a CPS computation that produces an intermediate result of type aC within a CPS computation which produces either a just or nothing. =Construct a continuation-passing computation from a function. SThe result of running a CPS computation with given nothing and just continuations.runMaybeCont . maybeCont = idmaybeCont . runMaybeCont = id   embeds 6 in  a. PApply a function to transform the result of a continuation-passing computation. bApply a function to transform the just continuation passed to a continuation-passing computation.fApply a function to transform the nothing continuation passed to an continuation-passing computation.       The  type and API(c) Eitan Chatav, 2015 PublicDomaineitan.chatav@gmail.com experimental Safe-Inferred246The  a l m rn type encodes a sum type monad transformer in continuation passing style which is separately monadic in both l and r>. Interestingly, this property holds for any type constructor m.=Construct a continuation-passing computation from a function.VThe result of running a CPS computation with given failure and success continuations. embeds 7 in  a. encodes functoriality of  a l m r in l. encodes bifunctoriality of  a l m r in l and r.bimapEC f id = fmapL fbimapEC id f = fmap f) encodes the applicative/monadic unit of  a l m r in l. encodes applicativity of  a l m r in l. and  encode monadicity of  a l m r in l!. The usual monad laws hold with  taking the role of 8 and  taking the role of 9.throwEC l `catchEC` f = f lec `catchEC` throwEC = ecC(ec `catchEC` f) `catchEC` g = ec `catchEC` (\l -> f l `catchEC` g) is a flipped .nA right-to-left, point free way to compose handlers. The monad laws look more elegant, expressed in terms of .!throwEC <?< f = f = f <?< throwEC!(h <?< g) <?< f = h <?< (g <?< f)4A left-to-right, point free way to compose handlers. a l m r is a monad transformer for m in l. encodes the symmetry of l and r in  a l m r.flipEC . flipEC = idPApply a function to transform the result of a continuation-passing computation.eApply a function to transform the success continuation passed to a continuation-passing computation.fApply a function to transform the failure continuation passed to an continuation-passing computation. 'Call with current failure continuation.!!Z runs the continuation-passing computation, throwing on failure and returning on success."" embeds a : computation m r into  a l m r. " and !! are one-sided inverses, making MonadError l m => m r a retract of  r l m r.%lowerMonadError . liftMonadError = id;The : function < is weaker than * since it must not change the error type.='Call with current success continuation.> a l m r is a monad transformer for m in r.?The 1 instance encodes monadicity of  a l m r in r.@The 3# instance encodes applicativity of  a l m r in r.AThe 5# instance encodes functoriality of  a l m r in r. !";=>?@A !" !" !";=>?@AThe # type and API(c) Eitan Chatav, 2015 PublicDomaineitan.chatav@gmail.com experimental Safe-Inferred## a l rD is a CPS computation that produces an intermediate result of type aC within a CPS computation which produces either a success of type r or failure of type l.$=Construct a continuation-passing computation from a function.%VThe result of running a CPS computation with given failure and success continuations.runEitherCont . eitherCont = ideitherCont . runEitherCont = id&& embeds B in # a.'PApply a function to transform the result of a continuation-passing computation.(eApply a function to transform the success continuation passed to a continuation-passing computation.)fApply a function to transform the failure continuation passed to an continuation-passing computation.#$%&'() #$%&'()#$%&')( #$%&'())Utility functions for error continuations(c) Eitan Chatav, 2015 PublicDomaineitan.chatav@gmail.com experimental Safe-Inferred*(Suppress the nothing continuation of an +"Tag the nothing continuation of a *+*+*+*+C      !"#$%&'()*+,-./01234567839:;3<=>39?34@ABC39D39EFGHIFGJKLMNO3PQRerror-continuations-0.1.0.0Control.Monad.Trans.MaybeContControl.Monad.MaybeContControl.Monad.Trans.EitherContControl.Monad.EitherContControl.Error.Cont.Util MaybeContT runMaybeContT liftMaybeTnothingC mapMaybeContTwithMaybeContTJustwithMaybeContTNothing MaybeCont maybeCont runMaybeCont liftMaybe mapMaybeContwithMaybeContJustwithMaybeContNothing EitherContTrunEitherContT liftEitherTfmapLbimapECthrowECapLcatchEChandleEC?>liftLflipECmapEitherContTwithEitherContTRwithEitherContTLcallCCLlowerMonadErrorliftMonadError EitherCont eitherCont runEitherCont liftEither mapEitherContwithEitherContRwithEitherContLhushnotetransformers-0.4.2.0Control.Monad.Trans.MaybeMaybeTbase Data.MaybeNothing$fMonadContMaybeContT$fMonadTransMaybeContT$fMonadMaybeContTGHC.BaseMonad$fApplicativeMaybeContTControl.Applicative Applicative$fFunctorMaybeContTFunctorMaybeeither-4.3.2.1Control.Monad.Trans.EitherEitherTreturn>>= mtl-2.2.1Control.Monad.Error.Class MonadError$fMonadErrorlEitherContT catchError$fMonadContEitherContT$fMonadTransEitherContT$fMonadEitherContT$fApplicativeEitherContT$fFunctorEitherContT Data.EitherEither