Pla is a simple library and ppx syntax extension to create composable templates based on verbatim strings.

You can find the code and a quick description of it’s features

https://modlfo.github.io/pla/

In a nutshell, the ppx transforms quoted strings in the form {pla| …. |pla} to templates. Inside templates it’s possible to add markers whose contents is replaced by other templates, for example:

let name = Pla.string “pla” ;;
let t = {pla|The library name is <#name#>|pla} ;;

will produce “The library name is Pla”

When compiled, the markers are type-safe.

Pla does not provide advanced pretty-printing features but it produces fast functions to create large amounts of text.

Leonardo