Scrap your boilerplate with XPath-like combinators
Author(s)
Ralf Lämmel
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.