fused-effects-lens-0.1.0.0: Monadic lens combinators for fused-effects.

Safe HaskellNone
LanguageHaskell2010

Control.Effect.Lens

Synopsis

Documentation

view :: forall r a sig m. (Member (Reader r) sig, Carrier sig m, Functor m) => Getting a r a -> m a Source #

View the value pointed to by a Getter, Iso or Lens or the result of folding over all the results of a Fold or Traversal corresponding to the Reader context of the given monadic carrier.

views :: (Member (Reader s) sig, Carrier sig m, Functor m) => Getting a s a -> (a -> b) -> m b Source #

View a function of the value pointed to by a Getter, Iso or Lens or the result of folding over all the results of a Fold or Traversal corresponding to the Reader context of the given monadic carrier.

This is slightly more general in lens itself, but should suffice for our purposes.

use :: forall s a sig m. (Member (State s) sig, Carrier sig m, Monad m) => Getting a s a -> m a Source #

Extract the target of a Lens, Iso, or Getter from the, or use a summary of a Fold or Traversal that points to a monoidal value.

uses :: (Carrier sig f, Functor f, Member (State s) sig) => Getting a s a -> (a -> b) -> f b Source #

Use a function of the target of a Lens, Iso, or Getter in the current state, or use a summary of a Fold or Traversal that points to a monoidal value.

assign :: forall s a b sig m. (Member (State s) sig, Carrier sig m, Monad m) => ASetter s s a b -> b -> m () Source #

Replace the target of a Lens or all of the targets of a Setter or Traversal in our monadic state with a new value, irrespective of the old.

This is a prefix version of .=.

(.=) :: forall s a b sig m. (Member (State s) sig, Carrier sig m, Monad m) => ASetter s s a b -> b -> m () infixr 4 Source #

Replace the target of a Lens or all of the targets of a Setter or Traversal in our monadic state with a new value, irrespective of the old.

This is an infix version of assign.

modifying :: forall s a b sig m. (Member (State s) sig, Carrier sig m, Monad m) => ASetter s s a b -> (a -> b) -> m () Source #

Map over the target of a Lens or all of the targets of a Setter or Traversal in our monadic state.

This is a prefix version of %=.

(%=) :: forall s a b sig m. (Member (State s) sig, Carrier sig m, Monad m) => ASetter s s a b -> (a -> b) -> m () infixr 4 Source #

Map over the target of a Lens or all of the targets of a Setter or Traversal in our monadic state.

This is an infix version of modifying.