digestive-functors-0.5.0.3: A practical formlet library

Safe HaskellNone

Text.Digestive.View

Contents

Synopsis

Documentation

data View v Source

Constructors

forall a m . Monad m => View 

Fields

viewName :: Text
 
viewContext :: Path
 
viewForm :: FormTree Identity v m a
 
viewInput :: [(Path, FormInput)]
 
viewErrors :: [(Path, v)]
 
viewMethod :: Method
 

Instances

Functor View 
Show v => Show (View v) 

Obtaining a view

getForm :: Monad m => Text -> Form v m a -> m (View v)Source

postForm :: Monad m => Text -> Form v m a -> Env m -> m (View v, Maybe a)Source

Operations on views

subViews :: View v -> [View v]Source

Returns all immediate subviews of a view

Querying a view

Low-level

absolutePath :: Text -> View v -> PathSource

Determine an absolute Path for a field in the form

absoluteRef :: Text -> View v -> TextSource

Determine an absolute path and call fromPath on it. Useful if you're writing a view library...

Form encoding

Input

fieldInputText :: forall v. Text -> View v -> TextSource

fieldInputChoice :: forall v. Text -> View v -> [(Text, v, Bool)]Source

Returns a list of (identifier, view, selected?)

fieldInputBool :: forall v. Text -> View v -> BoolSource

Errors

errors :: Text -> View v -> [v]Source

childErrors :: Text -> View v -> [v]Source