ide-backend-common-0.10.0: Shared library used be ide-backend and ide-backend-server

Safe HaskellSafe-Inferred
LanguageHaskell2010

IdeSession.Strict.StateT

Contents

Description

Version on StateT which evaluates the state strictly at every step

Synopsis

Transformer

newtype StrictStateT s m a Source

Constructors

StrictStateT 

Fields

runStateT :: s -> m (a, s)
 

modify :: MonadState s m => (s -> s) -> m ()

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.

evalStateT :: Monad m => StrictStateT s m a -> s -> m a Source

execStateT :: Monad m => StrictStateT s m a -> s -> m s Source

As base monad

runState :: StrictState s a -> s -> (a, s) Source

evalState :: StrictState s a -> s -> a Source

execState :: StrictState s a -> s -> s Source