HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Moduleyesod-test-1.6.19Haskell2010

Yesod.Test.Internal.SIO

The SIO type is used by Yesod.Test to provide exception-safe environment between requests and assertions.

This module is internal. Breaking changes to this module will not be reflected in the major version of this package.

  • 1 type
  • 6 values
newtypenewtype SIO s a
#

State + IO

Constructors

Instances9MonadState, Monad, Functor, Applicative, MonadIO, MonadThrow, …
valuegetSIO :: SIO s s
#

Retrieve the current state in the SIO type.

Equivalent to get

valueputSIO :: s -> SIO s ()
#

Put the given s into the SIO state for later retrieval.

Equivalent to put, but the value is evaluated to weak head normal form.

valuemodifySIO :: (s -> s) -> SIO s ()
#

Modify the underlying s state.

This is strict in the function used, and is equivalent to modify'.

valueevalSIO :: SIO s a -> s -> IO a
#

Run an SIO action with the intial state s provided, returning the result, and discard the final state.

valueexecSIO :: SIO s () -> s -> IO s
#

Run an SIO action with the initial state s provided, returning the final state, and discarding the result.

valuerunSIO :: SIO s a -> s -> IO (s, a)
#

Run an SIO action with the initial state provided, returning both the result of the computation as well as the final state.