wai-transformers-0.0.3: Simple parameterization of Wai's Application type

Copyright(c) 2015 Athan Clark
LicenseBSD-style
Maintainerathan.clark@gmail.com
Stabilityexperimental
PortabilityGHC
Safe HaskellNone
LanguageHaskell2010

Network.Wai.Trans

Description

Simple utilities for embedding a monad transformer stack in an Application or Middleware - with MiddlewareT, your transformer stack is shared across all attached middlewares until run. You can also lift existing Middleware to MiddlewareT, given some extraction function.

Synopsis

Documentation

type ApplicationT m = Request -> (Response -> m ResponseReceived) -> m ResponseReceived Source

Isomorphic to Kleisli (ContT ResponseReceived m) Request Response

liftApplication :: MonadIO m => (forall a. m a -> IO a) -> Application -> ApplicationT m Source

liftMiddleware :: MonadIO m => (forall a. m a -> IO a) -> Middleware -> MiddlewareT m Source

runApplicationT :: MonadIO m => (forall a. m a -> IO a) -> ApplicationT m -> Application Source

runMiddlewareT :: MonadIO m => (forall a. m a -> IO a) -> MiddlewareT m -> Middleware Source