Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Web.Twain.Types
Synopsis
- data ResponderM a = ResponderM (Request -> IO (Either RouteAction (a, Request)))
- data RouteAction
- data ParsedRequest = ParsedRequest {
- preqBody :: Maybe ParsedBody
- preqCookieParams :: [Param]
- preqPathParams :: [Param]
- preqQueryParams :: [Param]
- data ResponderOptions = ResponderOptions {}
- data ParsedBody
- data HttpError = HttpError Status String
- type Param = (Text, Text)
- data PathPattern = MatchPath (Request -> Maybe [Param])
- matchPath :: Text -> Request -> Maybe [Param]
- class ParsableParam a where
- parseParam :: Text -> Either HttpError a
- parseParamList :: Text -> Either HttpError [a]
- readEither :: Read a => Text -> Either HttpError a
- data HTTP2Exception = HTTP2Exception ErrorCode
Documentation
data ResponderM a Source #
ResponderM
is an Either-like monad that can "short-circuit" and return a
response, or pass control to the next middleware. This provides convenient
branching with do notation for redirects, error responses, etc.
Constructors
ResponderM (Request -> IO (Either RouteAction (a, Request))) |
Instances
data ParsedRequest Source #
Constructors
ParsedRequest | |
Fields
|
data ResponderOptions Source #
Constructors
ResponderOptions | |
Fields |
data ParsedBody Source #
Instances
Exception HttpError Source # | |
Defined in Web.Twain.Types Methods toException :: HttpError -> SomeException # fromException :: SomeException -> Maybe HttpError # displayException :: HttpError -> String # | |
Show HttpError Source # | |
Eq HttpError Source # | |
data PathPattern Source #
Instances
IsString PathPattern Source # | |
Defined in Web.Twain.Types Methods fromString :: String -> PathPattern # |
class ParsableParam a where Source #
Parse values from request parameters.
Minimal complete definition
Methods
parseParam :: Text -> Either HttpError a Source #
parseParamList :: Text -> Either HttpError [a] Source #
Default implementation parses comma-delimited lists.
Instances
readEither :: Read a => Text -> Either HttpError a Source #
Useful for creating ParsableParam
instances for things that already implement Read
.
data HTTP2Exception Source #
Constructors
HTTP2Exception ErrorCode |
Instances
Exception HTTP2Exception Source # | |
Defined in Web.Twain.Types Methods toException :: HTTP2Exception -> SomeException # | |
Show HTTP2Exception Source # | |
Defined in Web.Twain.Types Methods showsPrec :: Int -> HTTP2Exception -> ShowS # show :: HTTP2Exception -> String # showList :: [HTTP2Exception] -> ShowS # |