snaplet-rest-0.1.0: REST resources for the Snap web framework

Safe HaskellNone

Snap.Snaplet.Rest.FromRequest

Synopsis

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.

Methods

fromPath :: ByteString -> Maybe idSource

Parse a value from the remaining path information. A value of Nothing indicates that the parse failed.

parseRead :: Read a => ByteString -> Maybe aSource

A convenient helper function that wraps a read failure into Nothing instead of throwing an error.