An idiom's guide to formlets ?

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 oer 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.

[1]  John Hughes,et al.  Generalising monads to arrows , 2000, Sci. Comput. Program..

[2]  Claus Brabrand,et al.  The bigwig Project , 2000 .

[3]  Marinus J. Plasmeijer,et al.  iTasks: executable specifications of interactive work flow systems for the web , 2007, ICFP '07.

[4]  Michael Hanus,et al.  Type-oriented construction of web user interfaces , 2006, PPDP '06.

[5]  Robert Harper,et al.  Typed closure conversion , 1996, POPL '96.

[6]  Philip Wadler,et al.  Monads for functional programming , 1995, NATO ASI PDC.

[7]  Peter Thiemann,et al.  An embedded domain-specific language for type-safe server-side web scripting , 2005, TOIT.

[8]  Matthias Felleisen,et al.  Programming the Web with High-Level Programming Languages , 2001, ESOP.

[9]  Anders Møller,et al.  The Design Space of Type Checkers for XML Transformation Languages , 2004, ICDT.

[10]  Conor McBride,et al.  Applicative programming with effects , 2008, J. Funct. Program..

[11]  Michael Hanus,et al.  Putting declarative programming into the web: translating curry to javascript , 2007, PPDP '07.

[12]  Aske Simon Christensen,et al.  Extending Java for high-level Web service construction , 2002, TOPL.

[13]  Michael Bächle,et al.  Ruby on Rails , 2006, Softwaretechnik-Trends.

[14]  Ken Friis Larsen,et al.  Typing XHTML Web Applications in ML , 2004, PADL.

[15]  Engin Kirda,et al.  Layout, Content and Logic Separation in Web Engineering , 2001, Web Engineering.

[16]  Vincent Balat,et al.  Ocsigen: typing web interaction with objective Caml , 2006, ML '06.

[17]  Martin Elsman,et al.  A Functional Approach to Web Publishing (Second Edition) , 2007 .

[18]  Marinus J. Plasmeijer,et al.  iData for the World Wide Web - Programming Interconnected Web Forms , 2006, FLOPS.

[19]  Eugenio Moggi,et al.  Computational lambda-calculus and monads , 1989, [1989] Proceedings. Fourth Annual Symposium on Logic in Computer Science.

[20]  Nick Benton,et al.  Monads and Effects , 2000, APPSEM.

[21]  Thomas Ball,et al.  Mawl: A Domain-Specific Language for Form-Based Services , 1999, IEEE Trans. Software Eng..

[22]  Philip Wadler,et al.  Links: Web Programming Without Tiers , 2006, FMCO.