yesod-test-1.6.14: integration testing for WAI/Yesod Applications
Safe HaskellNone
LanguageHaskell2010

Yesod.Test.Internal.SIO

Description

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.

Since: 1.6.13

Synopsis

Documentation

newtype SIO s a Source #

State + IO

Since: 1.6.0

Constructors

SIO (ReaderT (IORef s) IO a) 

Instances

Instances details
MonadState s (SIO s) Source # 
Instance details

Defined in Yesod.Test.Internal.SIO

Methods

get :: SIO s s #

put :: s -> SIO s () #

state :: (s -> (a, s)) -> SIO s a #

Monad (SIO s) Source # 
Instance details

Defined in Yesod.Test.Internal.SIO

Methods

(>>=) :: SIO s a -> (a -> SIO s b) -> SIO s b #

(>>) :: SIO s a -> SIO s b -> SIO s b #

return :: a -> SIO s a #

Functor (SIO s) Source # 
Instance details

Defined in Yesod.Test.Internal.SIO

Methods

fmap :: (a -> b) -> SIO s a -> SIO s b #

(<$) :: a -> SIO s b -> SIO s a #

Applicative (SIO s) Source # 
Instance details

Defined in Yesod.Test.Internal.SIO

Methods

pure :: a -> SIO s a #

(<*>) :: SIO s (a -> b) -> SIO s a -> SIO s b #

liftA2 :: (a -> b -> c) -> SIO s a -> SIO s b -> SIO s c #

(*>) :: SIO s a -> SIO s b -> SIO s b #

(<*) :: SIO s a -> SIO s b -> SIO s a #

MonadIO (SIO s) Source # 
Instance details

Defined in Yesod.Test.Internal.SIO

Methods

liftIO :: IO a -> SIO s a #

MonadUnliftIO (SIO s) Source # 
Instance details

Defined in Yesod.Test.Internal.SIO

Methods

withRunInIO :: ((forall a. SIO s a -> IO a) -> IO b) -> SIO s b #

MonadThrow (SIO s) Source # 
Instance details

Defined in Yesod.Test.Internal.SIO

Methods

throwM :: Exception e => e -> SIO s a #

YesodDispatch site => Example (SIO (YesodExampleData site) a) Source # 
Instance details

Defined in Yesod.Test

Associated Types

type Arg (SIO (YesodExampleData site) a) #

type Arg (SIO (YesodExampleData site) a) Source # 
Instance details

Defined in Yesod.Test

type Arg (SIO (YesodExampleData site) a) = TestApp site

getSIO :: SIO s s Source #

Retrieve the current state in the SIO type.

Equivalent to get

Since: 1.6.13

putSIO :: s -> SIO s () Source #

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

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

Since: 1.6.13

modifySIO :: (s -> s) -> SIO s () Source #

Modify the underlying s state.

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

Since: 1.6.13

evalSIO :: SIO s a -> s -> IO a Source #

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

Since: 1.6.13

execSIO :: SIO s () -> s -> IO s Source #

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

Since: 1.6.13

runSIO :: SIO s a -> s -> IO (s, a) Source #

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

Since: 1.6.13