Abstract
We define HTML as an embedded domain specific language in Haskell. To this end, we have designed and implemented a combinator library which provides the means to create and modify HTML elements. Haskell’s type classes are employed to enforce well-formed HTML to a large degree. Haskell can then be used as a meta language to map structured documents to HTML, to define conditional content, to extract information from the documents, or to define entire web sites. We introduce container-passing style as a programming convention for the library. We also pinpoint some shortcomings of Haskell’s type system that make the task of this library’s implementor tedious.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Per Bjesse, Koen Claessen, Mary Sheeran, and Satnam Singh. Lava: Hardware design in Haskell. In Paul Hudak, editor, Proc. International Conference on Functional Programming 1998, pages 174–184, Baltimore, USA, September 1998. ACM Press, New York.
Tim Bray, Jean Paoli, and C.M. Sperberg-MacQueen. Extensible markup language (xml) 1.0 (w3c recommendation). http://www.w3.org/TR/REC-xml, feb 1998.
Daniel Cabeza and Manuel Hermenegildo. Www programming using computational logic systems (and the PiLLoW/CIAO library). http://www.clip.dia.fi.upm.es/Software/pillow/pillow/_www6/pillow/_www6.h%tml, March 1997.
Allaire Corp. HomeSite. http://www.allaire.com/.
Ralf S. Engelschall. Website meta language (wml). http://www.engelschall.com/sw/wml/.
Haskell98, a non-strict, purely functional language. http://www.haskell.org, December 1998.
John E. Hopcroft and Jeffrey D. Ullman. Introduction to automata theory, languages and computation. Addison-Wesley, 1979.
John Hughes. Generalising monads to arrows. Science of Computer Programming, 1999. To appear.
SoftQuad Software Inc. HoTMetaL. http://www.softquad.com/.
Mark P. Jones. A theory of qualified types. In Bernd Krieg-Brückner, editor, Proc. 4th European Symposium on Programming’ 92, volume 582 of Lecture Notes in Computer Science, pages 287–306, Rennes, France, February 1992. Springer-Verlag.
Mark P. Jones. Gofer, Functional Programming Environment, June 1994. Version 2.30.
Mark P. Jones. Hugs Online — embracing functional programming. http://www. haskell.org/hugs/, June 1999.
Sheng Liang, Paul Hudak, and Mark Jones. Monad transformers and modular interpreters. In Proc. 22nd Annual ACM Symposium on Principles of Programming Languages, pages 333–343, San Francisco, CA, January 1995. ACM Press.
Seng Wai Loke and Andrew Davison. Logic programming with the World-Wide Web. pages 235–245, Washington DC, USA, mar 1996.
Konstantin Läufer. Type classes with existential types. Journal of Functional Programming, 6(3):485–517, May 1996.
Konstantin Läufer and Martin Odersky. An extension of ML with first-class abstract types. In Proc. ACM SIGPLAN Workshop on ML and its Applications, pages 78–91, San Francisco, CA, June 1992.
John Matthews, John Launchbury, and Byron Cook. Microprocessor specification in Hawk. In IEEE International Conference on Computer Languages, ICCL 1998, Chicago, USA, May 1998. IEEE Computer Society Press.
Erik Meijer. Server-side web scripting with Haskell. Journal of Functional Programming, 1999. To appear.
Microsoft. Microsoft Frontpage98. http://www.microsoft.com/frontpage.
NetObjects Fusion. http://www.netobjects.com.
J. K. OusterHout. Tcl and the Tk Toolkit. Addison-Wesley, 1994.
PC Magazine. Web authoring tools. http://www.zdnet.com/pcmag/features/htmlauthor//_open.htm, January 20 1998.
John Punin and Mukkai Krishnamoorthy. ASHE (a simple HTML editor) — xhtml. http://www.cs.rpi.edu/~puninj/ASHE/ URL }, November 1996.
Didier Rémy. Typing record concatenation for free. In Proc. 19th Annual ACM Symposium on Principles of Programming Languages, pages 166–176, Albuquerque, New Mexico, January 1992. ACM Press.
Internet Software Technologies. HTMLed Pro32. http://www.ist.ca.
Texinfo. http://texinfo.org.
Ton Vullinghs, Wolfram Schulte, and Thilo Schwinn. The design of a functional GUI library using constructor classes. In PSI-96: Andrei Ershov Second International Memorial Conference, Perspectives of System Informatics, volume 1181 of Lecture Notes in Computer Science, pages 398–408, Novosibirsk, Russia, June 1996. Springer-Verlag.
Ton Vullinghs, Daniel Tuijnman, and Wolfram Schulte. Lightweight GUIs for functional programming. In Doaitse Swierstra and Manuel Hermenegildo, editors, International Symposium on Programming Languages, Implementations, Logics and Programs (PLILP’ 95), volume 982 of Lecture Notes in Computer Science, pages 341–356, Utrecht, The Netherlands, September 1995. Springer-Verlag.
Malcolm Wallace and Colin Runciman. Haskell and XML: Generic combinators or type-based translation? pages 148–259.
Mitchell Wand. Type inference for record concatenation and multiple inheritance. In Proc. of the 4th Annual Symposium on Logic in Computer Science, pages 92–97, Pacific Grove, CA, June 1989. IEEE Computer Society Press. To appear in Information and Computation.
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 1999 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Thiemann, P. (1999). Modeling HTML in Haskell. In: Pontelli, E., Santos Costa, V. (eds) Practical Aspects of Declarative Languages. PADL 2000. Lecture Notes in Computer Science, vol 1753. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-46584-7_18
Download citation
DOI: https://doi.org/10.1007/3-540-46584-7_18
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-66992-0
Online ISBN: 978-3-540-46584-3
eBook Packages: Springer Book Archive