- class FormInput i f | i -> f where
- getInputString :: i -> Maybe String
- getInputText :: i -> Maybe Text
- getInputFile :: i -> Maybe f
- inputString :: (Monad m, Functor m, FormInput i f) => (FormId -> Maybe String -> v) -> Maybe String -> Form m i e v String
- inputRead :: (Monad m, Functor m, FormInput i f, Read a, Show a) => (FormId -> Maybe String -> v) -> e -> Maybe a -> Form m i e v a
- inputBool :: (Monad m, Functor m, FormInput i f) => (FormId -> Bool -> v) -> Bool -> Form m i e v Bool
- inputChoice :: (Monad m, Functor m, FormInput i f, Monoid v, Eq a) => (FormId -> String -> Bool -> a -> v) -> a -> [a] -> Form m i e v a
- inputFile :: (Monad m, Functor m, FormInput i f) => (FormId -> v) -> Form m i e v (Maybe f)
Documentation
class FormInput i f | i -> f whereSource
Class which all backends should implement. a
is here the type that is
used to represent a value uploaded by the client in the request
getInputString :: i -> Maybe StringSource
Parse the input into a string. This is used for simple text fields among other things
getInputText :: i -> Maybe TextSource
Parse the input value into Text
. The default implementation uses
'T.pack . getInputString', a more efficient version may be implemented.
getInputFile :: i -> Maybe fSource
Get a file descriptor for an uploaded file