modify package:rio
Monadic state transformer.
Maps an old state to a new state inside a state monad. The old state
is thrown away.
Main> :t modify ((+1) :: Int -> Int)
modify (...) :: (MonadState Int a) => a ()
This says that
modify (+1) acts over any Monad that is a
member of the
MonadState class, with an
Int state.
Apply a destructive operation to a vector. The operation will be
performed in place if it is safe to do so and will modify a copy of
the vector otherwise.
modify (\v -> write v 0 'x') (replicate 3 'a') = <'x','a','a'>
Apply a destructive operation to a vector. The operation will be
performed in place if it is safe to do so and will modify a copy of
the vector otherwise.
modify (\v -> write v 0 'x') (replicate 3 'a') = <'x','a','a'>
Apply a destructive operation to a vector. The operation will be
performed in place if it is safe to do so and will modify a copy of
the vector otherwise.
modify (\v -> write v 0 'x') (replicate 3 'a') = <'x','a','a'>
Apply a destructive operation to a vector. The operation will be
performed in place if it is safe to do so and will modify a copy of
the vector otherwise.
modify (\v -> write v 0 'x') (replicate 3 'a') = <'x','a','a'>
Modify a SomeRef This function is subject to change due to the lack of
atomic operations
Modify a value in a
URef. Note that this action is strict, and
will force evaluation of the result value.
Modify the environment variables of a
ProcessContext. This will
not change the working directory.
Note that this requires
MonadIO, as it will create a new
IORef for the cache.
A variant of
modify in which the computation is strict in the
new state.