ContentsIndex
Submit98
Description
Haskell98 version of the submission functions.
Synopsis
class InputHandle h
class HasValue i where
value :: i a VALID -> a
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 ()
data DTree 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
submitLink :: InputHandle h => h INVALID -> (h VALID -> CGI ()) -> HTMLCons x y CGI ()
submitLink0 :: CGI () -> HTMLCons x y CGI ()
defaultSubmitLink :: InputHandle h => h INVALID -> (h VALID -> CGI ()) -> HTMLCons x y CGI ()
activate :: (InputHandle (i a), HasValue i) => (a -> CGI ()) -> HTMLField x y (i a INVALID) -> HTMLField x y (i a INVALID)
Documentation
class InputHandle h
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)
class HasValue i where
Methods
value :: i a VALID -> a
Instances
HasValue InputField
HasValue RadioGroup
HasValue SelectionGroup
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
FL is required to pass an unknown number of handles of the same type need to the callback function in a form submission. The handles need to be collected in a list and then wrapped in the FL data constructor
Constructors
FL [a x]
Instances
InputHandle a => InputHandle (FL a)
data FA a b x
FA comes handy when you want to tag an input handle with some extra information, which is not itsefl an input handle and which is not validated by a form submission. The tag is the first argument and the handle is the second argument of the data constructor.
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.
data DTree x y
Abstract type of decisions trees. These trees provide structured validation.
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.
submitLink :: InputHandle h => h INVALID -> (h VALID -> CGI ()) -> HTMLCons x y CGI ()
Create an ordinary link serving as a submission button.
submitLink0 :: CGI () -> HTMLCons x y CGI ()
Create a continuation link.
defaultSubmitLink :: InputHandle h => h INVALID -> (h VALID -> CGI ()) -> HTMLCons x y CGI ()
activate :: (InputHandle (i a), HasValue i) => (a -> CGI ()) -> HTMLField x y (i a INVALID) -> HTMLField x y (i a INVALID)
Attach a CGI action to the value returned by the input field. Activation means that data is submitted as soon as it is entered.
Produced by Haddock version 0.6