Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: "Matej Košík" <5764c029b688c1c0d24a2e97cd764f@gmail.com>
To: Caml List <caml-list@inria.fr>
Subject: [Caml-list] concerning using of `deriving' syntactic plugin
Date: Wed, 07 Mar 2012 11:49:16 +0000	[thread overview]
Message-ID: <4F574B3C.5000207@gmail.com> (raw)

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.

             reply	other threads:[~2012-03-07 11:49 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-07 11:49 Matej Košík [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F574B3C.5000207@gmail.com \
    --to=5764c029b688c1c0d24a2e97cd764f@gmail.com \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox