Currently I'm trying to use Batteries with ppx_deriving.show or something similar.
I am wondering how to use them together usefully.
To create dumping functions, I feel ppx_deriving.show is useful. But I have a little bit troubles using them together like the followings.
open Batteries
type t = { a: (int,int) Map.t }
[@@deriving show]
Now Map.pp is not defined, so it can't be compiled.
My adhoc fix is that I create module Map which include Batteries.Map and define function pp.
open Batteries
module Map = struct
include Map
let pp f g fmt t = ... (* create dump function by man hand *)
end
type t = { a: (int,int) Map.t }
[@@deriving show]
It works, but it is painful for me to adapt all of data structures...
Core with ppx_deriving.sexp is an alternative choice, but I prefer Batteries with ppx_deriving.show.
Does anybody know how to solve the problem?