Open to new job opportunities? Check out the JS positions from Toughbyte.

A pattern matching implementation in JavaScript

Pattern matching is a convenient technique for manipulating nested data structures available in many programming languages. There is also a proposal to add pattern matching to JavaScript. Recently we needed to perform transformations on nested XML documents. To tackle the problem we wrote a pattern matching implementation in plain JavaScript that was used to define transformation rules to be applied via a bottom-up rewrite of the XML document to a fixed point. This talk introduces the basic functional programming techniques behind the approach and its concrete implementation.