snap-extras-0.12.1.0: A collection of useful helpers and utilities for Snap web applications.

Safe HaskellNone
LanguageHaskell2010

Snap.Extras.FormUtils

Contents

Synopsis

Transformers

maybeTrans :: (Eq a, IsString a) => a -> Result v (Maybe a) Source

Transform to Nothing if field is empty string

readMayTrans :: Read a => Text -> Result v (Maybe a) Source

Maybe read into target value

readTrans :: (Read a, IsString v) => Text -> Result v a Source

Read into target value

Compiled splices

editFormSplice Source

Arguments

:: (Monad m, MonadSnap n) 
=> (n (Maybe a) -> HeistT n m b)

Function for generating a splice from an optional default value calculated at runtime.

-> (ByteString -> n (Maybe a))

Function for retrieving the form default by ID.

-> HeistT n m b 

Constructs a generalized edit form splice that looks up an ID param specified by the by attribute. You might use this splice as follows:

<editFormSplice by="id">

If you don't specify the by attribute, the default is by="id".