Turning strict warnings back on
(env (dev (flags :standard %{dune-warnings})))
Auto-installing printers for dune utop
Add a module with an .mli file with a [@@ocaml.toplevel_printer] decorated function that type-checks as a formatter:
val pp : Format.formatter -> < look : Format.formatter -> unit ; .. > -> unit
[@@ocaml.toplevel_printer]
This module doesn't need to have anything else. For example, if the types that need printers are in lib/world.ml, the decorated function can be by itself in lib/world_top.ml. A division like this is a little more convenient if lib/world.ml's interface is a work in progress. But in this case, the module may not get loaded right away: if you start dune utop and then generate a value of the type, it'll still have the default printer. You can force it get to loaded by referencing the printer in an .ocamlinit in the working directory:
Mylib.World_top.pp;;
#utop_prompt_dummy;;