Safe Haskell | None |
---|
- class FromRequest id where
- fromPath :: ByteString -> Maybe id
- parseRead :: Read a => ByteString -> Maybe a
Documentation
class FromRequest id whereSource
Instances of this class can be parsed from the remaining path information at the current route, and potentially also the URL parameters.
fromPath :: ByteString -> Maybe idSource
Parse a value from the remaining path information. A value of
Nothing
indicates that the parse failed.
FromRequest Int | |
FromRequest () | |
FromRequest a => FromRequest [a] | |
FromRequest a => FromRequest (Maybe a) | |
FromRequest (CI String) | |
FromRequest (CI ByteString) | |
FromRequest (CI ByteString) | |
FromRequest (CI Text) | |
FromRequest a => FromRequest (Either a b) | |
(FromRequest a, FromRequest b) => FromRequest (a, b) | |
(FromRequest a, FromRequest b, FromRequest c) => FromRequest (a, b, c) | |
(FromRequest a, FromRequest b, FromRequest c, FromRequest d) => FromRequest (a, b, c, d) |
parseRead :: Read a => ByteString -> Maybe aSource
A convenient helper function that wraps a read failure into Nothing
instead of throwing an error.