deriving
deriving copied to clipboard
Show on a -> b
Thanks to people @ #ocaml chatroom I was able to find this implementation to make deriving derive show for datatypes containing functions:
method function_ ctxt f = <:module_expr< Defaults (struct
type $Ast.TyDcl (loc, "a", [], atype_expr ctxt (`Function f), [])$
let format formatter _ = Format.pp_print_string formatter "<func>"
end) >>
However I failed at this pmap.ml: https://github.com/HaxeFoundation/ocamllibs/blob/master/extlib/pMap.ml#L21
The preprocessor failed, and I was not able to come up with a manual instance yet (will try to ask on the chatroom tomorrow again).
I guess this would require adding new Show2 Show3 modules taking show instances for the type parameters k' v' ?