ContentsIndex
Submit98
Description
Haskell98 version of the submission functions.
Synopsis
class HasValue i where
value :: i a VALID -> a
class InputHandle h where
validate :: h INVALID -> Either [ValidationError] (h VALID)
isBound :: h INVALID -> Bool
data F0 x = F0
data F1 a x = F1 (a x)
data F2 a b x = F2 (a x) (b x)
data F3 a b c x = F3 (a x) (b x) (c x)
data F4 a b c d x = F4 (a x) (b x) (c x) (d x)
data F5 a b c d e x = F5 (a x) (b x) (c x) (d x) (e x)
data F6 a b c d e f x = F6 (a x) (b x) (c x) (d x) (e x) (f x)
data F7 a b c d e f g x = F7 (a x) (b x) (c x) (d x) (e x) (f x) (g x)
data F8 a b c d e f g h x = F8 (a x) (b x) (c x) (d x) (e x) (f x) (g x) (h x)
data FL a x = FL [a x]
data FA a b x = FA a (b x)
submit :: InputHandle h => h INVALID -> (h VALID -> CGI ()) -> HTMLField x y ()
submit0 :: CGI () -> HTMLField x y ()
defaultSubmit :: InputHandle h => h INVALID -> (h VALID -> CGI ()) -> HTMLField x y ()
newtype DTree x y = DTree {
unDTree :: (HTMLField x y ())
}
submitx :: DTree x y -> HTMLField x y ()
dtleaf :: CGI () -> DTree x y
dtnode :: InputHandle h => h INVALID -> (h VALID -> DTree x y) -> DTree x y
Documentation
class HasValue i where
Methods
value :: i a VALID -> a
Instances
HasValue InputField
HasValue RadioGroup
HasValue SelectionGroup
class InputHandle h where
Methods
validate :: h INVALID -> Either [ValidationError] (h VALID)
isBound :: h INVALID -> Bool
Instances
InputHandle (InputField a)
InputHandle F0
InputHandle a => InputHandle (F1 a)
(InputHandle a, InputHandle b) => InputHandle (F2 a b)
(InputHandle a, InputHandle b, InputHandle c) => InputHandle (F3 a b c)
(InputHandle a, InputHandle b, InputHandle c, InputHandle d) => InputHandle (F4 a b c d)
(InputHandle a, InputHandle b, InputHandle c, InputHandle d, InputHandle e) => InputHandle (F5 a b c d e)
(InputHandle a, InputHandle b, InputHandle c, InputHandle d, InputHandle e, InputHandle f) => InputHandle (F6 a b c d e f)
(InputHandle a, InputHandle b, InputHandle c, InputHandle d, InputHandle e, InputHandle f, InputHandle g) => InputHandle (F7 a b c d e f g)
(InputHandle a, InputHandle b, InputHandle c, InputHandle d, InputHandle e, InputHandle f, InputHandle g, InputHandle h) => InputHandle (F8 a b c d e f g h)
InputHandle a => InputHandle (FL a)
InputHandle b => InputHandle (FA a b)
InputHandle (RadioGroup a)
InputHandle (SelectionGroup a)
data F0 x
Constructors
F0
Instances
InputHandle F0
data F1 a x
Constructors
F1 (a x)
Instances
InputHandle a => InputHandle (F1 a)
data F2 a b x
Constructors
F2 (a x) (b x)
Instances
(InputHandle a, InputHandle b) => InputHandle (F2 a b)
data F3 a b c x
Constructors
F3 (a x) (b x) (c x)
Instances
(InputHandle a, InputHandle b, InputHandle c) => InputHandle (F3 a b c)
data F4 a b c d x
Constructors
F4 (a x) (b x) (c x) (d x)
Instances
(InputHandle a, InputHandle b, InputHandle c, InputHandle d) => InputHandle (F4 a b c d)
data F5 a b c d e x
Constructors
F5 (a x) (b x) (c x) (d x) (e x)
Instances
(InputHandle a, InputHandle b, InputHandle c, InputHandle d, InputHandle e) => InputHandle (F5 a b c d e)
data F6 a b c d e f x
Constructors
F6 (a x) (b x) (c x) (d x) (e x) (f x)
Instances
(InputHandle a, InputHandle b, InputHandle c, InputHandle d, InputHandle e, InputHandle f) => InputHandle (F6 a b c d e f)
data F7 a b c d e f g x
Constructors
F7 (a x) (b x) (c x) (d x) (e x) (f x) (g x)
Instances
(InputHandle a, InputHandle b, InputHandle c, InputHandle d, InputHandle e, InputHandle f, InputHandle g) => InputHandle (F7 a b c d e f g)
data F8 a b c d e f g h x
Constructors
F8 (a x) (b x) (c x) (d x) (e x) (f x) (g x) (h x)
Instances
(InputHandle a, InputHandle b, InputHandle c, InputHandle d, InputHandle e, InputHandle f, InputHandle g, InputHandle h) => InputHandle (F8 a b c d e f g h)
data FL a x
Constructors
FL [a x]
Instances
InputHandle a => InputHandle (FL a)
data FA a b x
Constructors
FA a (b x)
Instances
InputHandle b => InputHandle (FA a b)
submit
:: InputHandle h
=> h INVALIDinput field handles to be validated and passed to callback action
-> (h VALID -> CGI ())callback maps valid input handles to a CGI action
-> HTMLField x y ()returns a field so that attributes can be attached
Create a submission button with attached action.
submit0 :: CGI () -> HTMLField x y ()
Create a continuation button that takes no parameters.
defaultSubmit :: InputHandle h => h INVALID -> (h VALID -> CGI ()) -> HTMLField x y ()
Create a submission button whose attached action is fired whenever the form is submitted without explicitly clicking any submit button. This can happen if an input field has an attached onclick=submit() action.
newtype DTree x y
Abstract type of decisions trees. These trees provide structured validation.
Constructors
DTree
unDTree :: (HTMLField x y ())
Instances
submitx :: DTree x y -> HTMLField x y ()
Create a submission button whose validation proceeds according to a decision tree. Trees are built using dtleaf and dtnode.
dtleaf :: CGI () -> DTree x y
Create a leaf in a decision tree from a CGI action.
dtnode :: InputHandle h => h INVALID -> (h VALID -> DTree x y) -> DTree x y
Create a node in a decision tree. Takes an invalid input field and a continuation. Validates the input field and passes it to the continuation if the validation was successful. The continuation can dispatch on the value of the input field and produces a new decision tree.
Produced by Haddock version 0.5