Safe Haskell | Safe-Inferred |
---|
State and Reader operations specialized for working with total lenses.
- gets :: MonadState f m => Lens (->) f o -> m o
- puts :: MonadState f m => Lens (->) f o -> o -> m ()
- modify :: MonadState f m => Lens (->) f o -> (o -> o) -> m ()
- modifyAndGet :: MonadState f m => Lens (->) f o -> (o -> (a, o)) -> m a
- (=:) :: MonadState f m => Lens (->) f o -> o -> m ()
- (=.) :: MonadState f m => Lens (->) f o -> (o -> o) -> m ()
- asks :: MonadReader f m => Lens (->) f o -> m o
- local :: MonadReader f m => Lens (->) f o -> (o -> o) -> m a -> m a
MonadState
lens operations.
gets :: MonadState f m => Lens (->) f o -> m oSource
Get a value out of the state, pointed to by the specified lens.
puts :: MonadState f m => Lens (->) f o -> o -> m ()Source
Set a value somewhere in the state, pointed to by the specified lens.
modify :: MonadState f m => Lens (->) f o -> (o -> o) -> m ()Source
Modify a value with a function somewhere in the state, pointed to by the specified lens.
modifyAndGet :: MonadState f m => Lens (->) f o -> (o -> (a, o)) -> m aSource
Modify a value with a function somewhere in the state, pointed to by the specified lens. Additionally return a separate value based on the modification.
(=:) :: MonadState f m => Lens (->) f o -> o -> m ()Source
Alias for puts
that reads like an assignment.
(=.) :: MonadState f m => Lens (->) f o -> (o -> o) -> m ()Source
Alias for modify
that reads more or less like an assignment.