Module

Control.Monad.State.Reified

Package
purescript-focus-ui
Repository
mbid/purescript-focus-ui

#MonadStateV Source

type MonadStateV s m = { get :: m s, gets :: forall a. (s -> a) -> m a, modify :: (s -> s) -> m Unit, put :: s -> m Unit, state :: forall a. (s -> Tuple a s) -> m a }

The datum of a MonadState, reified as record.
mapMonad and mapState induce the structure of a bifunctor MonadStateV :: Monad x Lens' -> Type.

#fromStateFunction Source

fromStateFunction :: forall m s. (forall a. (s -> Tuple a s) -> m a) -> MonadStateV s m

Create a complete MonadStateV given just state, using default implementations for the other functions.

#fromGetPutFunctions Source

fromGetPutFunctions :: forall m s. Monad m => m s -> (s -> m Unit) -> MonadStateV s m

Create a complete MonadStateV given just get and put, using default implementations for the other functions.

#mapMonad Source

mapMonad :: forall n m s. (m ~> n) -> MonadStateV s m -> MonadStateV s n

Change the underlying monad of a MonadStateV, given a morphism of monads.

#mapState Source

mapState :: forall m t s. Monad m => Lens' s t -> MonadStateV s m -> MonadStateV t m

Change the state type of a MonadStateV, given a morphism a lens.