ABSTRACT
XML programming involves idioms for expressing 'structure shyness' such as the descendant axis of XPath or the default templates of XSLT. We initiate a discussion of the relationships between such XML idioms and generic functional programming, while focusing on the (Haskell-based) 'Scrap your boilerplate' style of generic programming (SYB). This work gives insight into mechanisms for traversal and selection. We compare SYB and XSLT. We approximate XPath in SYB. We make a case for SYB's programmability, when compared to XPath's fixed combinators. We allude to strengthened type checking for SYB traversals so as to reject certain, trivial behaviors.
- D. Colazzo, G. Ghelli, P. Manghi, and C. Sartiani. Types for path correctness of XML queries. In ICFP'04, Proceedings, pages 126--137. ACM Press, 2004. Google Scholar
Digital Library
- J. English. HXML, 2002. Web site: http://www.flightlab.com/~joe/hxml/.Google Scholar
- T. Hallgren. Fun with functional dependencies. In Joint Winter Meeting of the Dep. of Science and Computer Eng., Chalmers University of Technology and Goteborg University, Varberg, Sweden, Jan. 2001. http://www.cs.chalmers.se/~hallgren/Papers/wm01.html.Google Scholar
- R. Hinze. A new approach to generic functional programming. In POPL'00, Proceedings, pages 119--132. ACM Press, 2000. Google Scholar
Digital Library
- R. Hinze and J. Jeuring. Weaving a web. Journal of Functional Programming, 11(6):681--689, 2001. Google Scholar
Digital Library
- R. Hinze, J. Jeuring, and A. Löh. Type-indexed data types. Science of Computer Programming, 51(1--2):117--151, 2004. Google Scholar
Digital Library
- G. P. Huet. The Zipper. Journal of Functional Programming, 7(5):549--554, 1997. Google Scholar
Digital Library
- P. Jansson and J. Jeuring. PolyP--a polytypic programming language extension. In POPL'97, Proceedings, pages 470--482. ACM Press, 1997. Google Scholar
Digital Library
- M. Kay. What kind of language is XSLT? IBM developerWorks, 2001--2005. http://www-128.ibm.com/developerworks/xml/library/x-xslt/?dwzone=x.Google Scholar
- M. Kay. Comparing XSLT and XQuery. In Proceedings of XTech 2005: XML, the Web and beyond, 2005. http://www.idealliance.org/proceedings/xtech05/papers/02-03-01/.Google Scholar
- O. Kiselyov and S. Krishnamurthi. SXSLT: Manipulation Language for XML. In V. Dahl and P. Wadler, editors, PADL'03, Proceedings, volume 2562 of LNCS, pages 256--272. Springer-Verlag, 2003. Google Scholar
Digital Library
- O. Kiselyov, R. Lämmel, and K. Schupke. Strongly typed heterogeneous collections. In Haskell Workshop 2004, Proceedings. ACM Press, Sept. 2004. Google Scholar
Digital Library
- O. Kiselyov and K. Lisovsky. XML, XPath, XSLT implementations as SXML, SXPath, and SXSLT, Sept. 2002. Presented at the International Lisp Conference (2002); http://okmij.org/ftp/.Google Scholar
- R. Lämmel and S. Peyton Jones. Scrap your boilerplate, website, http://www.cs.vu.nl/boilerplate/, 2003--2006.Google Scholar
- R. Lämmel, E. Visser, and J. Visser. Strategic programming meets adaptive programming. In AOSD'03, Proceedings, pages 168--177. ACM Press, 2003. Google Scholar
Digital Library
- K. J. Lieberherr, B. Patt-Shamir, and D. Orleans. Traversals of object structures: Specification and Efficient Implementation. ACM TOPLAS, 26(2):370--412, 2004. Google Scholar
Digital Library
- C. McBride. Faking It (Simulating Dependent Types in Haskell). Journal of Functional Programming, 12(4--5):375--392, July 2002. Google Scholar
Digital Library
- Microsoft Corp. XLinq overview, 2005. http://msdn.microsoft.com/netframework/future/linq/, Note that XLinq is now called 'LINQ to XML'.Google Scholar
- M. Neubauer, P. Thiemann, M. Gasbichler, and M. Sperber. A Functional Notation for Functional Dependencies. In Haskell Workshop 2001, Proceedings, ENTCS, pages 101--120. Elsevier, 2001.Google Scholar
- M. Neubauer, P. Thiemann, M. Gasbichler, and M. Sperber. Functional logic overloading. In POPL'02, Proceedings, pages 233--244. ACM Press, 2002. Google Scholar
Digital Library
- K. Normark. XML Transformations in Scheme with LAML--a Minimalistic Approach, Oct. 2003. Presented at the International Lisp Conference (2003); http://www.cs.aau.dk/~normark/laml/.Google Scholar
- T. Sheard and S. Peyton Jones. Template meta-programming for Haskell. In Haskell Workshop 2002, Proceedings, pages 1--16. ACM Press, 2002. Google Scholar
Digital Library
- E. Visser, Z. el Abidine Benaissa, and A. Tolmach. Building program optimizers with rewriting strategies. In ICFP'98, Proceedings, pages 13--26. ACM Press, 1998. Google Scholar
Digital Library
- W3C. Document Object Model (DOM), 1997--2003. http://www.w3.org/DOM/.Google Scholar
- W3C. XML Path Language (XPath), Version 1.0, W3C Recommendation, 16 Nov. 1999. http://www.w3.org/TR/xpath.Google Scholar
- W3C. XSL Transformations (XSLT), Version 1.0, W3C Recommendation, 16 Nov. 1999. http://www.w3.org/TR/xslt.Google Scholar
- W3C. XQuery 1.0: An XML Query Language, W3C Candidate Recommendation, 3 Nov. 2005. http://www.w3.org/TR/xquery/.Google Scholar
- W3C. XML Path Language (XPath), Version 2.0, W3C Candidate Recommendation, 8 June 2006. http://www.w3.org/TR/xpath20/.Google Scholar
- W3C. XQuery 1.0 and XPath 2.0 Formal Semantics, W3C Candidate Recommendation, 8 June 2006. http://www.w3.org/TR/xquery-semantics/.Google Scholar
- W3C. XSL Transformations (XSLT) Version 2.0, W3C Candidate Recommendation, 8 June 2006. http://www.w3.org/TR/xslt20/.Google Scholar
- M. Wallace and C. Runciman. Haskell and XML: generic combinators or type-based translation? In ICFP'99, Proceedings, pages 148--159. ACM Press, 1999. Google Scholar
Digital Library
Index Terms
Scrap your boilerplate with XPath-like combinators
Recommendations
Scrap your boilerplate with XPath-like combinators
Proceedings of the 2007 POPL ConferenceXML programming involves idioms for expressing 'structure shyness' such as the descendant axis of XPath or the default templates of XSLT. We initiate a discussion of the relationships between such XML idioms and generic functional programming, while ...
Scrap your boilerplate: prologically!
PPDP '09: Proceedings of the 11th ACM SIGPLAN conference on Principles and practice of declarative programming"Scrap Your Boilerplate" (SYB) is an established style of generic functional programming. The present paper reconstructs SYB within the Prolog language with the help of the univ operator and higher-order logic programming techniques. We pay attention to ...
Scrap more boilerplate: reflection, zips, and generalised casts
ICFP '04: Proceedings of the ninth ACM SIGPLAN international conference on Functional programmingWriting boilerplate code is a royal pain. Generic programming promises to alleviate this pain by allowing the programmer to write a generic "recipe" for boilerplate code, and use that recipe in many places. In earlier work we introduced the "Scrap your ...






Comments