Haskell98 version of the submission functions.
- class InputHandle h
- class HasValue i where
- 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)
- deF0 :: r -> F0 x -> r
- deF1 :: (a x -> r) -> F1 a x -> r
- deF2 :: (a x -> b x -> r) -> F2 a b x -> r
- deF3 :: (a x -> b x -> c x -> r) -> F3 a b c x -> r
- deF4 :: (a x -> b x -> c x -> d x -> r) -> F4 a b c d x -> r
- deF5 :: (a x -> b x -> c x -> d x -> e x -> r) -> F5 a b c d e x -> r
- deF6 :: (a x -> b x -> c x -> d x -> e x -> f x -> r) -> F6 a b c d e f x -> r
- deF7 :: (a x -> b x -> c x -> d x -> e x -> f x -> g x -> r) -> F7 a b c d e f g x -> r
- deF8 :: (a x -> b x -> c x -> d x -> e x -> f x -> g x -> h x -> r) -> F8 a b c d e f g h x -> r
- deFL :: ([a x] -> r) -> FL a x -> r
- deFA :: (a -> b x -> r) -> FA a b x -> r
- deValueF0 :: t -> F0 t1 -> t
- deValueF1 :: HasValue i => (a -> t) -> F1 (i a) VALID -> t
- deValueF2 :: (HasValue i1, HasValue i) => (a -> a1 -> t) -> F2 (i a) (i1 a1) VALID -> t
- deValueF3 :: (HasValue i2, HasValue i, HasValue i1) => (a -> a1 -> a2 -> t) -> F3 (i a) (i1 a1) (i2 a2) VALID -> t
- deValueF4 :: (HasValue i3, HasValue i1, HasValue i, HasValue i2) => (a -> a1 -> a2 -> a3 -> t) -> F4 (i a) (i1 a1) (i2 a2) (i3 a3) VALID -> t
- deValueF5 :: (HasValue i4, HasValue i2, HasValue i, HasValue i1, HasValue i3) => (a -> a1 -> a2 -> a3 -> a4 -> t) -> F5 (i a) (i1 a1) (i2 a2) (i3 a3) (i4 a4) VALID -> t
- deValueF6 :: (HasValue i5, HasValue i3, HasValue i1, HasValue i, HasValue i2, HasValue i4) => (a -> a1 -> a2 -> a3 -> a4 -> a5 -> t) -> F6 (i a) (i1 a1) (i2 a2) (i3 a3) (i4 a4) (i5 a5) VALID -> t
- deValueF7 :: (HasValue i6, HasValue i4, HasValue i2, HasValue i, HasValue i1, HasValue i3, HasValue i5) => (a -> a1 -> a2 -> a3 -> a4 -> a5 -> a6 -> t) -> F7 (i a) (i1 a1) (i2 a2) (i3 a3) (i4 a4) (i5 a5) (i6 a6) VALID -> t
- deValueF8 :: (HasValue i7, HasValue i5, HasValue i3, HasValue i1, HasValue i, HasValue i2, HasValue i4, HasValue i6) => (a -> a1 -> a2 -> a3 -> a4 -> a5 -> a6 -> a7 -> t) -> F8 (i a) (i1 a1) (i2 a2) (i3 a3) (i4 a4) (i5 a5) (i6 a6) (i7 a7) VALID -> t
- deValueFL :: HasValue i => ([a] -> t) -> FL (i a) VALID -> t
- deValueFA :: HasValue i => (t1 -> a -> t) -> FA t1 (i a) VALID -> t
- submit :: (CGIMonad cgi, InputHandle h) => h INVALID -> (h VALID -> cgi ()) -> HTMLField cgi x y ()
- submit0 :: CGIMonad cgi => cgi () -> HTMLField cgi x y ()
- defaultSubmit :: (CGIMonad cgi, InputHandle h) => h INVALID -> (h VALID -> cgi ()) -> HTMLField cgi x y ()
- data DTree cgi x y
- submitx :: DTree cgi x y -> HTMLField cgi x y ()
- dtleaf :: CGIMonad cgi => cgi () -> DTree cgi x y
- dtnode :: (CGIMonad cgi, InputHandle h) => h INVALID -> (h VALID -> DTree cgi x y) -> DTree cgi x y
- submitLink :: (CGIMonad cgi, InputHandle h) => h INVALID -> (h VALID -> cgi ()) -> HTMLCons x y cgi ()
- submitLink0 :: CGIMonad cgi => cgi () -> HTMLCons x y cgi ()
- defaultSubmitLink :: (CGIMonad cgi, InputHandle h) => h INVALID -> (h VALID -> cgi ()) -> HTMLCons x y cgi ()
- activate :: (CGIMonad cgi, InputHandle (i a), HasValue i) => (a -> cgi ()) -> HTMLField cgi x y (i a INVALID) -> HTMLField cgi x y (i a INVALID)
Documentation
class InputHandle h Source
InputHandle F0 | |
InputHandle (RadioGroup a) | |
InputHandle (InputField a) | |
InputHandle (SelectionGroup a) | |
InputHandle a => InputHandle (FL a) | |
InputHandle a => InputHandle (F1 a) | |
InputHandle b => InputHandle (FA a b) | |
(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) |
F3 (a x) (b x) (c x) |
(InputHandle a, InputHandle b, InputHandle c) => InputHandle (F3 a b c) |
F4 (a x) (b x) (c x) (d x) |
(InputHandle a, InputHandle b, InputHandle c, InputHandle d) => InputHandle (F4 a b c d) |
F5 (a x) (b x) (c x) (d x) (e x) |
(InputHandle a, InputHandle b, InputHandle c, InputHandle d, InputHandle e) => InputHandle (F5 a b c d e) |
F6 (a x) (b x) (c x) (d x) (e x) (f x) |
(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 Source
F7 (a x) (b x) (c x) (d x) (e x) (f x) (g x) |
(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 Source
F8 (a x) (b x) (c x) (d x) (e x) (f x) (g x) (h x) |
(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) |
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
FL [a x] |
InputHandle a => InputHandle (FL a) |
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.
FA a (b x) |
InputHandle b => InputHandle (FA a b) |
deF8 :: (a x -> b x -> c x -> d x -> e x -> f x -> g x -> h x -> r) -> F8 a b c d e f g h x -> rSource
deValueF3 :: (HasValue i2, HasValue i, HasValue i1) => (a -> a1 -> a2 -> t) -> F3 (i a) (i1 a1) (i2 a2) VALID -> tSource
deValueF4 :: (HasValue i3, HasValue i1, HasValue i, HasValue i2) => (a -> a1 -> a2 -> a3 -> t) -> F4 (i a) (i1 a1) (i2 a2) (i3 a3) VALID -> tSource
deValueF5 :: (HasValue i4, HasValue i2, HasValue i, HasValue i1, HasValue i3) => (a -> a1 -> a2 -> a3 -> a4 -> t) -> F5 (i a) (i1 a1) (i2 a2) (i3 a3) (i4 a4) VALID -> tSource
deValueF6 :: (HasValue i5, HasValue i3, HasValue i1, HasValue i, HasValue i2, HasValue i4) => (a -> a1 -> a2 -> a3 -> a4 -> a5 -> t) -> F6 (i a) (i1 a1) (i2 a2) (i3 a3) (i4 a4) (i5 a5) VALID -> tSource
deValueF7 :: (HasValue i6, HasValue i4, HasValue i2, HasValue i, HasValue i1, HasValue i3, HasValue i5) => (a -> a1 -> a2 -> a3 -> a4 -> a5 -> a6 -> t) -> F7 (i a) (i1 a1) (i2 a2) (i3 a3) (i4 a4) (i5 a5) (i6 a6) VALID -> tSource
deValueF8 :: (HasValue i7, HasValue i5, HasValue i3, HasValue i1, HasValue i, HasValue i2, HasValue i4, HasValue i6) => (a -> a1 -> a2 -> a3 -> a4 -> a5 -> a6 -> a7 -> t) -> F8 (i a) (i1 a1) (i2 a2) (i3 a3) (i4 a4) (i5 a5) (i6 a6) (i7 a7) VALID -> tSource
:: (CGIMonad cgi, InputHandle h) | |
=> h INVALID | input field handles to be validated and passed to callback action |
-> (h VALID -> cgi ()) | callback maps valid input handles to a CGI action |
-> HTMLField cgi x y () | returns a field so that attributes can be attached |
Create a submission button with attached action.
submit0 :: CGIMonad cgi => cgi () -> HTMLField cgi x y ()Source
Create a continuation button that takes no parameters.
defaultSubmit :: (CGIMonad cgi, InputHandle h) => h INVALID -> (h VALID -> cgi ()) -> HTMLField cgi x y ()Source
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.
Abstract type of decisions trees. These trees provide structured validation.
dtleaf :: CGIMonad cgi => cgi () -> DTree cgi x ySource
Create a leaf in a decision tree from a CGI action.
dtnode :: (CGIMonad cgi, InputHandle h) => h INVALID -> (h VALID -> DTree cgi x y) -> DTree cgi x ySource
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 :: (CGIMonad cgi, InputHandle h) => h INVALID -> (h VALID -> cgi ()) -> HTMLCons x y cgi ()Source
Create an ordinary link serving as a submission button.
defaultSubmitLink :: (CGIMonad cgi, InputHandle h) => h INVALID -> (h VALID -> cgi ()) -> HTMLCons x y cgi ()Source