fused-effects-optics-0.2.0.0: Bridge between the optics and fused-effects ecosystems.

Control.Effect.Optics.Indexed

Synopsis

iview :: (Is k A_Getter, is HasSingleIndex i, Has (Reader r) sig m) => Optic' k is r a -> m (i, a) Source #

View the index and value of an indexed getter into the current environment as a pair.

iviews :: (Is k A_Getter, is HasSingleIndex i, Has (Reader r) sig m) => Optic' k is r a -> (i -> a -> m b) -> m b Source #

View the index and value of an indexed getter into the current environment and pass them to the provided function.

ilocally :: (Has (Reader s) sig m, is HasSingleIndex i, Is k A_Setter) => Optic k is s s a1 b -> (i -> a1 -> b) -> m a2 -> m a2 Source #

Given a monadic argument, evaluate it in a context modified by applying the provided function to the index and target of the provided indexed Setter, Lens, or Traversal.

# Indexed state operations

iuse :: (Is k A_Getter, is HasSingleIndex i, Has (State s) sig m) => Optic' k is s a -> m (i, a) Source #

Extract the index and target of an indexed getter in the current state as a pair.

iuses :: (Is k A_Getter, is HasSingleIndex i, Has (State s) sig m) => Optic' k is s a -> (i -> a -> m b) -> m b Source #

Extract the index and target of an indexed getter in the current state and pass them to the provided function.