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.Handler

Synopsis

- newtype Handler a = Handler {
  - runHandler' :: ExceptT ServerError IO a
  }
- runHandler :: Handler a -> IO (Either ServerError a)
- pattern MkHandler :: IO (Either ServerError a) -> Handler a

# Documentation

newtype Handler a Source #

Constructors

Handler |

Fields

- runHandler' :: ExceptT ServerError IO a

#### Instances

Instances details

MonadIO Handler Source # |
Instance details Defined in Servant.Server.Internal.Handler Methods liftIO :: IO a -> Handler a Source #
MonadCatch Handler Source # |
Instance details Defined in Servant.Server.Internal.Handler Methods catch :: (HasCallStack, Exception e) => Handler a -> (e -> Handler a) -> Handler a Source #
MonadMask Handler Source # |
Instance details Defined in Servant.Server.Internal.Handler Methods mask :: HasCallStack => ((forall a. Handler a -> Handler a) -> Handler b) -> Handler b Source # uninterruptibleMask :: HasCallStack => ((forall a. Handler a -> Handler a) -> Handler b) -> Handler b Source # generalBracket :: HasCallStack => Handler a -> (a -> ExitCase b -> Handler c) -> (a -> Handler b) -> Handler (b, c) Source #
MonadThrow Handler Source # |
Instance details Defined in Servant.Server.Internal.Handler Methods throwM :: (HasCallStack, Exception e) => e -> Handler a Source #
Applicative Handler Source # |
Instance details Defined in Servant.Server.Internal.Handler Methods pure :: a -> Handler a Source # (<*>) :: Handler (a -> b) -> Handler a -> Handler b Source # liftA2 :: (a -> b -> c) -> Handler a -> Handler b -> Handler c Source # (*>) :: Handler a -> Handler b -> Handler b Source # (<*) :: Handler a -> Handler b -> Handler a Source #
Functor Handler Source # |
Instance details Defined in Servant.Server.Internal.Handler Methods fmap :: (a -> b) -> Handler a -> Handler b Source # (<$) :: a -> Handler b -> Handler a Source #
Monad Handler Source # |
Instance details Defined in Servant.Server.Internal.Handler Methods (>>=) :: Handler a -> (a -> Handler b) -> Handler b Source # (>>) :: Handler a -> Handler b -> Handler b Source # return :: a -> Handler a Source #
MonadFail Handler Source # |
Instance details Defined in Servant.Server.Internal.Handler Methods fail :: String -> Handler a Source #
MonadBaseControl IO Handler Source # |

Instance details

Defined in Servant.Server.Internal.Handler

Associated Types

type StM Handler a |
Instance details Defined in Servant.Server.Internal.Handler type StM Handler a = Either ServerError a

Methods

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

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

MonadError ServerError Handler Source # |
Instance details Defined in Servant.Server.Internal.Handler Methods throwError :: ServerError -> Handler a Source # catchError :: Handler a -> (ServerError -> Handler a) -> Handler a Source #
MonadBase IO Handler Source # |
Instance details Defined in Servant.Server.Internal.Handler Methods liftBase :: IO α -> Handler α Source #
Generic (Handler a) Source # |

Instance details

Defined in Servant.Server.Internal.Handler

Associated Types

type Rep (Handler a) |
Instance details Defined in Servant.Server.Internal.Handler type Rep (Handler a) = D1 ('MetaData "Handler" "Servant.Server.Internal.Handler" "servant-server-0.20.3.0-K3OEf3La2TA6Zg4wWiPZKx" 'True) (C1 ('MetaCons "Handler" 'PrefixI 'True) (S1 ('MetaSel ('Just "runHandler'") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ExceptT ServerError IO a))))

Methods

from :: Handler a -> Rep (Handler a) x Source #

to :: Rep (Handler a) x -> Handler a Source #

type StM Handler a Source # |
Instance details Defined in Servant.Server.Internal.Handler type StM Handler a = Either ServerError a
type Rep (Handler a) Source # |
Instance details Defined in Servant.Server.Internal.Handler type Rep (Handler a) = D1 ('MetaData "Handler" "Servant.Server.Internal.Handler" "servant-server-0.20.3.0-K3OEf3La2TA6Zg4wWiPZKx" 'True) (C1 ('MetaCons "Handler" 'PrefixI 'True) (S1 ('MetaSel ('Just "runHandler'") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ExceptT ServerError IO a))))

runHandler :: Handler a -> IO (Either ServerError a) Source #

pattern MkHandler :: IO (Either ServerError a) -> Handler a Source #

Pattern synonym that matches directly on the inner `IO` action.

To lift `IO` actions that don't carry a `ServerError`, use `liftIO` instead.