TY - UNPB
T1 - An idiom’s guide to formlets
AU - Cooper, Ezra
AU - Lindley, Sam
AU - Wadler, Philip
AU - Yallop, Jeremy
PY - 2007
Y1 - 2007
N2 - We present a novel approach to HTML form abstraction, which we call formlets. A formlet hides the underlying representation of a data type. For instance, a date formlet may allow a user to enter a date as a single text field, or separate fields for day, month, and year, or a combination of pulldown menus, or a custom JavaScript calendar widget; any consumer of the data from the form would see only the abstract data type Date. Remarkably, this form of abstraction is unsupported in almost all web frameworks, and not fully supported in any web framework of which we are aware.Formlets are defined in terms of Conor McBride’s idioms (also called applicative functors), a program structuring technique halfway between Moggi’s monads and Hughes’s arrows. We have implemented formlets in the Links programming language. The core functionality is implemented entirely in library code. In addition we offer syntactic sugar which makes formlets particularly easy to use.We show how to extend formlets to support validation by composing the underlying idiom with an additional idiom.
AB - We present a novel approach to HTML form abstraction, which we call formlets. A formlet hides the underlying representation of a data type. For instance, a date formlet may allow a user to enter a date as a single text field, or separate fields for day, month, and year, or a combination of pulldown menus, or a custom JavaScript calendar widget; any consumer of the data from the form would see only the abstract data type Date. Remarkably, this form of abstraction is unsupported in almost all web frameworks, and not fully supported in any web framework of which we are aware.Formlets are defined in terms of Conor McBride’s idioms (also called applicative functors), a program structuring technique halfway between Moggi’s monads and Hughes’s arrows. We have implemented formlets in the Links programming language. The core functionality is implemented entirely in library code. In addition we offer syntactic sugar which makes formlets particularly easy to use.We show how to extend formlets to support validation by composing the underlying idiom with an additional idiom.
M3 - Working paper
BT - An idiom’s guide to formlets
ER -