Are you familiar with type-conv and the family of syntax-extensions that go along with it? You can do thinks like:
type t = { foo: int; bar: string }with sexp, compare, bin_io
Hi,
I would like to print out the response of a modified Ocaml's typechecker
to various inputs.
One way to do it would be to write a pretty-printer by hand.
Before I do that, I would like to apply "deriving" machinery:
http://code.google.com/p/deriving/wiki/Introduction
to this (chore) job.
In some cases I do not know what to do.
E.g., file "types/types.mli" contains the following definition:
and value_kind =
Val_reg
| Val_prim of Primitive.description
| Val_ivar of mutable_flag * string
| Val_self of
(Ident.t * type_expr) Meths.t ref *
(Ident.t * mutable_flag * virtual_flag * type_expr) Vars.t ref *
string * type_expr
| Val_anc of (string * Ident.t) list * string
| Val_unbound
If I add
deriving (Show)
at the end of the above definition, I get an error:
Error: Unbound module Meths.Show_t
That is expected but I am not sure what to do. That is, I am not sure
what is the official way to "deriving"-sify the "Meth" module which
defined in the following way:
module Meths = Map.Make(OrderedString)
without the need to modify files "map.ml{i,}".
Is something like that possible?
Thank you very much in advance for any help.
--
Caml-list mailing list. Subscription management and archives:
https://sympa-roc.inria.fr/wws/info/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs