caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jean-Christophe Filliatre <filliatr@lri.fr>
To: "Merijn de Jonge" <merijn.de.jonge@gmail.com>
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Writing Identity Functors (or Wrapper modules) in OCAML
Date: Mon, 27 Feb 2006 16:06:45 +0100	[thread overview]
Message-ID: <17411.5509.49103.254957@gargle.gargle.HOWL> (raw)
In-Reply-To: <f40e02a60602270649w5959ac06ldf2bf1f9820bbb72@mail.gmail.com>


Merijn de Jonge writes:
 > 
 > I've problems in writing an Identity Functor in OCAML that I want to use as
 > a wrapper module.

A type representation is missing: you should write your wrapper as

======================================================================
      module Wrapper (X: IHelloWorld) : IHelloWorld =
       struct
         type helloWorldType = X.helloWorldType = Hello | World
         let hello = X.hello
       end
======================================================================

See the paragraph "Re-exported variant type or record type: an
equation, a representation." in section 6.8.1 of the Ocaml manual
(http://caml.inria.fr/pub/docs/manual-ocaml/manual016.html)

Hope this helps,
-- 
Jean-Christophe Filliâtre (http://www.lri.fr/~filliatr)


      parent reply	other threads:[~2006-02-27 15:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-27 14:49 Merijn de Jonge
2006-02-27 15:04 ` [Caml-list] " Julien Signoles
2006-02-27 15:13   ` [Caml-list] Writing Identity Functors (or Wrapper modules) inOCAML Sebastian Egner
2006-02-27 15:20     ` Merijn de Jonge
2006-02-27 15:06 ` Jean-Christophe Filliatre [this message]

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=17411.5509.49103.254957@gargle.gargle.HOWL \
    --to=filliatr@lri.fr \
    --cc=caml-list@yquem.inria.fr \
    --cc=merijn.de.jonge@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).