Commit 6de3e9c8 authored by Michael Hanus 's avatar Michael Hanus

Fix for checking parameterized form operations, README extended

parent 28ee0e67
......@@ -13,6 +13,21 @@ the form and a result page shown after submitting the form.
To implement the event handlers inside a form without a process,
the read IO action is executed again when a form is submitted.
All operations and smart constructors to implement
interactive web pages are defined in the library `HTML.Base`.
A form inside a web page must be defined as a
**public top-level operation** of type `HtmlFormDef`, like
myForm :: HtmlFormDef String
myForm = formDefWithID "Module.myForm" readData viewData
The first argument of a form definition is the qualified name
of the operation (this will be checked by `curry2cgi`).
The second argument is an IO action to read some data
used in the form, and the third argument is the actual view
of the form which usually contains buttons with event handlers
that are invoked when a form is submitted.
Some simple examples for dynamic web pages can be found in the
directory `examples`.
......
......@@ -43,7 +43,7 @@ extractFormOps prog =
(filter hasFormDefType (functions prog))
in (map funcName fds1, map funcName fds2)
where
hasFormDefType fdecl = case resultType (typeOfQualType (funcType fdecl)) of
hasFormDefType fdecl = case typeOfQualType (funcType fdecl) of
CTApply (CTCons tc) _ -> tc == ("HTML.Base","HtmlFormDef")
_ -> False
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment