Round-Tripping Balls: Building A Bi-Directional Printer/Parser

This talk is about a paper “Invertible syntax descriptions”, and some real world use of the ideas therein.

Traditionally, developers have written printers and parsers separately, even if the source and destination are intended to be isomorphic. We will go through the ideas of a paper, and then build up a library for writing JSON printers and parsers at the same time.

By unifying printers and parsers like this, we can reduce duplication, increase maintainability and get some correctness for free.

To understand what’s going on you will need to know:

  • Haskell, including a strong grasp of Functor, Applicative, Monad and Alternative type classes.
  • What JSON looks like
  • Roughly, what “isomorphism” means.

To fully appreciate some of the ideas, you may want to know:

  • Basic category theory (functors and isomorphisms)
  • What the Control.Lens notion of a Prism is.

Target Audience


schedule Submitted 10 months ago