Safe Haskell | None |
---|
- data Parameter a = Parameter {
- _name :: !ByteString
- _read :: [ByteString] -> Either ByteString a
- _default :: !(Maybe a)
- data Param a = Param ByteString
- data ParamOpt a = ParamOpt ByteString
- data ParamDef a = ParamDef ByteString a
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. In case of error, an optional default may be
returned instead, if nothing is provided, the error message will be used
when construction the 400 status.
Parameter | |
|
Specialisation of Parameter
which returns the first request
which could be converted to the target type.
Like Param
, but denoting an optional parameter, i.e. if the
parameter is not present or can not be converted to the target type, the
predicate will still succeed.