Hi Simon,
For your exact case, you want to use 'optionalText' instead of 'text':
http://hackage.haskell.org/package/digestive-functors-0.7.1.1/docs/Text-Digestive-Form.html#v:optionalText
But, more generally, look into the 'validate' and 'validateM'
functions. They allow you to transform values, potentially failing
because they are invalid. For example, 'optionalText' is defined with
'validate':
optionalText :: Monad m => Maybe Text -> Form v m (Maybe Text)
optionalText def = validate opt (text def)
where
opt t
| T.null t = return Nothing
| otherwise = return $ Just t
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "Snap Framework" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
snap_framewor...@googlegroups.com.
> For more options, visit
https://groups.google.com/d/optout.