servant-server-0.20.3.0: A family of combinators for defining webservices APIs and serving them

Safe Haskell | None
Language | Haskell2010

Servant.Server.Internal.DelayedIO

Synopsis

- newtype DelayedIO a = DelayedIO {
  - runDelayedIO' :: ReaderT Request (ResourceT (RouteResultT IO)) a
  }
- liftRouteResult :: RouteResult a -> DelayedIO a
- runDelayedIO :: DelayedIO a -> Request -> ResourceT IO (RouteResult a)
- delayedFail :: ServerError -> DelayedIO a
- delayedFailFatal :: ServerError -> DelayedIO a
- withRequest :: (Request -> DelayedIO a) -> DelayedIO a

# Documentation

newtype DelayedIO a Source #

Computations used in a `Delayed` can depend on the incoming `Request`, may perform `IO`, and result in a `RouteResult`, meaning they can either succeed, fail (with the possibility to recover), or fail fatally.

Constructors

DelayedIO |

Fields

- runDelayedIO' :: ReaderT Request (ResourceT (RouteResultT IO)) a

#### Instances

Instances details

MonadIO DelayedIO Source # |
Instance details Defined in Servant.Server.Internal.DelayedIO Methods liftIO :: IO a -> DelayedIO a Source #
MonadThrow DelayedIO Source # |
Instance details Defined in Servant.Server.Internal.DelayedIO Methods throwM :: (HasCallStack, Exception e) => e -> DelayedIO a Source #
Applicative DelayedIO Source # |
Instance details Defined in Servant.Server.Internal.DelayedIO Methods pure :: a -> DelayedIO a Source # (<*>) :: DelayedIO (a -> b) -> DelayedIO a -> DelayedIO b Source # liftA2 :: (a -> b -> c) -> DelayedIO a -> DelayedIO b -> DelayedIO c Source # (*>) :: DelayedIO a -> DelayedIO b -> DelayedIO b Source # (<*) :: DelayedIO a -> DelayedIO b -> DelayedIO a Source #
Functor DelayedIO Source # |
Instance details Defined in Servant.Server.Internal.DelayedIO Methods fmap :: (a -> b) -> DelayedIO a -> DelayedIO b Source # (<$) :: a -> DelayedIO b -> DelayedIO a Source #
Monad DelayedIO Source # |
Instance details Defined in Servant.Server.Internal.DelayedIO Methods (>>=) :: DelayedIO a -> (a -> DelayedIO b) -> DelayedIO b Source # (>>) :: DelayedIO a -> DelayedIO b -> DelayedIO b Source # return :: a -> DelayedIO a Source #
MonadResource DelayedIO Source # |
Instance details Defined in Servant.Server.Internal.DelayedIO Methods liftResourceT :: ResourceT IO a -> DelayedIO a Source #
MonadBaseControl IO DelayedIO Source # |

Instance details

Defined in Servant.Server.Internal.DelayedIO

Associated Types

type StM DelayedIO a |
Instance details Defined in Servant.Server.Internal.DelayedIO type StM DelayedIO a = RouteResult a

Methods

liftBaseWith :: (RunInBase DelayedIO IO -> IO a) -> DelayedIO a Source #

restoreM :: StM DelayedIO a -> DelayedIO a Source #

MonadReader Request DelayedIO Source # |
Instance details Defined in Servant.Server.Internal.DelayedIO Methods ask :: DelayedIO Request Source # local :: (Request -> Request) -> DelayedIO a -> DelayedIO a Source # reader :: (Request -> a) -> DelayedIO a Source #
MonadBase IO DelayedIO Source # |
Instance details Defined in Servant.Server.Internal.DelayedIO Methods liftBase :: IO α -> DelayedIO α Source #
type StM DelayedIO a Source # |
Instance details Defined in Servant.Server.Internal.DelayedIO type StM DelayedIO a = RouteResult a

liftRouteResult :: RouteResult a -> DelayedIO a Source #

runDelayedIO :: DelayedIO a -> Request -> ResourceT IO (RouteResult a) Source #

delayedFail :: ServerError -> DelayedIO a Source #

Fail with the option to recover.

delayedFailFatal :: ServerError -> DelayedIO a Source #

Fail fatally, i.e., without any option to recover.

withRequest :: (Request -> DelayedIO a) -> DelayedIO a Source #

Gain access to the incoming request.