freer-extras-1.2.0.0: Useful extensions to simple-freer
Safe Haskell None
Language Haskell2010

Control.Monad.Freer.Extras.Modify

Synopsis

change the list of effects

under functions

class UnderN as where Source #

Instances

Instances details
UnderN ('[] :: [ Type -> Type ]) Source #
Instance details

Defined in Control.Monad.Freer.Extras.Modify

Methods

underN :: forall (effs :: [ Type -> Type ]) (effs' :: [ Type -> Type ]). ( Union effs ~> Union effs') -> Union ('[] :++: effs) ~> Union ('[] :++: effs') Source #

UnderN as => UnderN (a ': as) Source #
Instance details

Defined in Control.Monad.Freer.Extras.Modify

Methods

underN :: forall (effs :: [ Type -> Type ]) (effs' :: [ Type -> Type ]). ( Union effs ~> Union effs') -> Union ((a ': as) :++: effs) ~> Union ((a ': as) :++: effs') Source #

under :: ( Union effs ~> Union effs') -> Union (a ': effs) ~> Union (a ': effs') Source #

weaken functions

class CanWeakenEnd as effs where Source #

Instances

Instances details
(effs ~ (a ': effs'), CanWeakenEnd (b ': as) effs') => CanWeakenEnd (a ': (b ': as)) effs Source #
Instance details

Defined in Control.Monad.Freer.Extras.Modify

Methods

weakenEnd :: Union (a ': (b ': as)) ~> Union effs Source #

effs ~ (a ': effs') => CanWeakenEnd '[a] effs Source #
Instance details

Defined in Control.Monad.Freer.Extras.Modify

weakenUnder :: forall effs a b. Union (a ': effs) ~> Union (a ': (b ': effs)) Source #

weakenNUnder :: forall effs' effs a. Weakens effs' => Union (a ': effs) ~> Union (a ': (effs' :++: effs)) Source #

weakenMUnderN :: forall effs' as effs. ( UnderN as, Weakens effs') => Union (as :++: effs) ~> Union (as :++: (effs' :++: effs)) Source #

raise functions

raiseUnder :: forall effs a b. Eff (a ': effs) ~> Eff (a ': (b ': effs)) Source #

raiseUnder2 :: forall effs a b c. Eff (a ': (b ': effs)) ~> Eff (a ': (b ': (c ': effs))) Source #

raise2Under :: forall effs a b c. Eff (a ': effs) ~> Eff (a ': (b ': (c ': effs))) Source #

raiseNUnder :: forall effs' effs a. Weakens effs' => Eff (a ': effs) ~> Eff (a ': (effs' :++: effs)) Source #

raiseMUnderN :: forall effs' as effs. ( UnderN as, Weakens effs') => Eff (as :++: effs) ~> Eff (as :++: (effs' :++: effs)) Source #

Raise m effects under the top n effects

zoom functions

handleZoomedState :: Member ( State s2) effs => Lens' s2 s1 -> State s1 ~> Eff effs Source #

Handle a State effect in terms of a "larger" State effect from which we have a lens.

handleZoomedError :: Member ( Error s2) effs => AReview s2 s1 -> Error s1 ~> Eff effs Source #

Handle an Error effect in terms of a "larger" Error effect from which we have a review.

handleZoomedWriter :: Member ( Writer s2) effs => AReview s2 s1 -> Writer s1 ~> Eff effs Source #

Handle a Writer effect in terms of a "larger" Writer effect from which we have a review.

handleZoomedReader :: Member ( Reader s2) effs => Getter s2 s1 -> Reader s1 ~> Eff effs Source #

Handle a Reader effect in terms of a "larger" Reader effect from which we have a getter.

manipulation

writeIntoState :: ( Monoid s1, Member ( State s2) effs) => Setter' s2 s1 -> Writer s1 ~> Eff effs Source #

Handle a Writer effect in terms of a "larger" State effect from which we have a setter.

stateToMonadState :: MonadState s m => State s ~> m Source #

Handle a State effect in terms of a monadic effect which has a MonadState instance.

errorToMonadError :: MonadError e m => Error e ~> m Source #

Handle an Error effect in terms of a monadic effect which has a MonadError instance.

wrapError :: forall e f effs. Member ( Error f) effs => (e -> f) -> Eff ( Error e ': effs) ~> Eff effs Source #

Transform an error type