"Prettify" ocaml compiler error messages
Find a file
2018-09-27 19:21:02 +02:00
lib Dunification and 4.07 version 2018-09-27 19:21:02 +02:00
tests Dunification and 4.07 version 2018-09-27 19:21:02 +02:00
.gitignore Version 0.1 2017-06-27 12:11:46 +02:00
.merlin Version 0.1 2017-06-27 12:11:46 +02:00
dune-project Dunification and 4.07 version 2018-09-27 19:21:02 +02:00
harmatia.opam Dunification and 4.07 version 2018-09-27 19:21:02 +02:00
LICENSE Version 0.1 2017-06-27 12:11:46 +02:00
OCAML_LICENSE Version 0.1 2017-06-27 12:11:46 +02:00
README.md Fix readme 2017-06-27 12:31:25 +02:00

Harmatia is a for-fun example of compiler plugins for Ocaml. Harmatia uplifts Ocaml error messages to the world of unicode:

  • Digraph are replaced by their unicode equivalent
  • Short type names are transliterated to the greek alphabet
  • The characters < and > are reserved to relation orders and are replaced by angle brackets and when they were used as brackets.
  • <hv> boxes are replaced with <hov> boxes
Before After
->
[|1|] ⟦1⟧
'a α
...
..
< f:'a.'a -> 'a > ⟨f:α.α ⟶ α⟩

How to use harmatia

Unfortunately, compiler plugins currently do no work with toplevel.

Otherwise, first install the harmatia opam package

  • clone this repository
  • opam pin add harmatia path_to_the_cloned path

Once installed use the -plugin option of either ocamlc or ocamlopt

  • ocamlc -plugin $(ocamlfind query harmatia)/harmatia