Safe Haskell | None |
---|
Snap.Predicate.Param
- data Parameter a = Parameter {
- _pName :: !ByteString
- _pRead :: [ByteString] -> Either ByteString a
- _pDefault :: !(Maybe a)
- data Param a = Param ByteString
- data ParamOpt a = ParamOpt ByteString
- data ParamDef a = ParamDef ByteString a
- data HasParam = HasParam ByteString
Documentation
The most generic request parameter predicate provided.
It will get all request parameter values of _name
and pass them on to
the conversion function _read
, which might either yield an error
message or a value. If the parameter is not present, an optional default may be
returned instead, if nothing is provided, the error message will be used
when construction the 400 status.
Constructors
Parameter | |
Fields
|
Specialisation of Parameter
which returns the first request
parameter which could be converted to the target type.
Relies on Readable
type-class for the actual conversion.
Constructors
Param ByteString |
Predicate which returns the first request parameter which could be
converted to the target type wrapped in a Maybe.
If the parameter is not present, Nothing
will be returned.
Relies on Readable
type-class for the actual conversion.
Constructors
ParamOpt ByteString |
Specialisation of Parameter
which returns the first request
parameter which could be converted to the target type.
If the parameter is not present, the provided default will be used.
Relies on Readable
type-class for the actual conversion.
Constructors
ParamDef ByteString a |