caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] concerning using of `deriving' syntactic plugin
@ 2012-03-07 11:49 Matej Košík
  2012-03-07 12:31 ` Gabriel Scherer
  2012-03-07 12:34 ` Yaron Minsky
  0 siblings, 2 replies; 10+ messages in thread
From: Matej Košík @ 2012-03-07 11:49 UTC (permalink / raw)
  To: Caml List

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.

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2012-03-08  2:49 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-07 11:49 [Caml-list] concerning using of `deriving' syntactic plugin Matej Košík
2012-03-07 12:31 ` Gabriel Scherer
2012-03-07 16:44   ` Matej Košík
2012-03-07 17:06     ` Jérémie Dimino
2012-03-07 12:34 ` Yaron Minsky
2012-03-07 16:44   ` Matej Košík
2012-03-07 17:10     ` Markus Mottl
2012-03-07 17:28       ` Matej Košík
2012-03-07 20:47         ` Till Varoquaux
2012-03-08  2:49         ` Markus Mottl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).