wai-request-spec-0.9.1.0: Declarative request parsing

CopyrightAlej Cabrera 2015
LicenseBSD-3
Maintainercpp.cabrera@gmail.com
Stabilityexperimental
PortabilityPOSIX
Safe HaskellNone
LanguageHaskell2010

Network.Wai.RequestSpec.Combinators

Description

 

Synopsis

Documentation

intQ :: (Read a, Integral a) => Text -> Env -> P a Source

Require a parameter as an integral type

boolQ :: Text -> Env -> P Bool Source

Require a parameter as a boolean: "true" | "false"

floatQ :: (Read a, Fractional a) => Text -> Env -> P a Source

Require a parameter as a fractional type

textQ :: Text -> Env -> P Text Source

Require a parameter as text

bytesQ :: (Text -> ByteString) -> Text -> Env -> P ByteString Source

Require a parameter as bytes, applying the encoding function f

textQM :: Text -> Env -> P (Maybe Text) Source

Optional parameter as text

intQM :: (Read a, Integral a) => Text -> Env -> P (Maybe a) Source

Optional parameter as integral

floatQM :: (Read a, Fractional a) => Text -> Env -> P (Maybe a) Source

Optional parameter as fractional

bytesQM :: (Text -> ByteString) -> Text -> Env -> P (Maybe ByteString) Source

Optional header as bytes, applying the encoding function f

intF :: (Read a, Integral a) => Text -> Env -> P a Source

Require a parameter as an integral type

boolF :: Text -> Env -> P Bool Source

Require a parameter as a boolean: "true" | "false"

floatF :: (Read a, Fractional a) => Text -> Env -> P a Source

Require a parameter as a fractional type

textF :: Text -> Env -> P Text Source

Require a parameter as text

bytesF :: (Text -> ByteString) -> Text -> Env -> P ByteString Source

Require a parameter as bytes, applying the encoding function f

textFM :: Text -> Env -> P (Maybe Text) Source

Optional parameter as text

intFM :: (Read a, Integral a) => Text -> Env -> P (Maybe a) Source

Optional parameter as integral

floatFM :: (Read a, Fractional a) => Text -> Env -> P (Maybe a) Source

Optional parameter as fractional

bytesFM :: (Text -> ByteString) -> Text -> Env -> P (Maybe ByteString) Source

Optional header as bytes, applying the encoding function f

intH :: (Integral a, Read a) => CI Text -> Env -> P a Source

Require a header as an integral type

boolH :: CI Text -> Env -> P Bool Source

Require a header as a boolean: "true" | "false"

floatH :: (Fractional a, Read a) => CI Text -> Env -> P a Source

Require a header a fractional type

textH :: CI Text -> Env -> P Text Source

Require a header as text

bytesH :: (Text -> ByteString) -> CI Text -> Env -> P ByteString Source

Require a header as bytes, applying the encoding function f

textHM :: CI Text -> Env -> P (Maybe Text) Source

Optional header as text

intHM :: (Integral a, Read a) => CI Text -> Env -> P (Maybe a) Source

Optional header as integral

floatHM :: (Fractional a, Read a) => CI Text -> Env -> P (Maybe a) Source

Optional header as floating

bytesHM :: (Text -> ByteString) -> CI Text -> Env -> P (Maybe ByteString) Source

Optional header as bytes, applying the encoding function f

choice :: [P a] -> P a Source

Combine a series of alternatives choice [a, b, c] == a | b | c | empty