snaplet-fay-0.3.3.2: Fay integration for Snap with request- and pre-compilation.

Safe HaskellNone

Snap.Snaplet.Fay

Synopsis

Documentation

data Fay Source

Configuration

Instances

initFay :: SnapletInit b FaySource

Snaplet initialization

fayServe :: Handler b Fay ()Source

Serves the compiled Fay scripts using the chosen compile mode.

fayax :: (Data f1, Read f1, Show f2) => (f1 -> Handler h1 h2 f2) -> Handler h1 h2 ()Source

Send and receive JSON. | Automatically decodes a JSON request into a Fay record which is | passed to g. The handler g should then return a Fay record (of | a possibly separate type) which is encoded and passed back as a | JSON response. | If you only want to send JSON and handle input manually, use toFayax. | If you want to receive JSON and handle the response manually, use fromFayax

toFayax :: Show f2 => Handler h1 h2 f2 -> Handler h1 h2 ()Source

fayax only sending JSON.

fromFayax :: (Data f1, Read f1) => (f1 -> Handler h1 h2 ()) -> Handler h1 h2 ()Source

fayax only recieving JSON.