Mustache templates are popular logic-less templates that can be used in web development as well as in any other domain where interpolation of data into some sort of template is needed.
It is actually a problem that can be solved elegantly in Haskell using a few Isos and Traversals. We’ll use the linear library for representing the data and the lens library for accessing it.
Rather than wait for the official results, I ran the benchmarks with a handful of frameworks on a dedicated server. The results are, I think, enough to put these concerns to rest.
dbrecord-opaleye is a haskell library that automatically takes care of changing the shape of your model depending on the operation (projection, aggregation, left join).
If we keep all of the field-to-type mappings at the type-level representation of a datatype, we can use that to not have to write IsLabel instances manually. As an added bonus, we’ll get anonymous records!
This text demonstrates the difficulties people often face when learning Haskell. It is perhaps biased by my own experiences, so it may emphasize things that C and Scheme have taught me. Those would be paranoia and flexibility.