caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Yamagata Yoriyuki <yoriyuki@mbg.ocn.ne.jp>
To: ronniec95@lineone.net
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Module/functor question
Date: Mon, 15 Mar 2004 04:22:18 +0900 (JST)	[thread overview]
Message-ID: <20040315.042218.07646200.yoriyuki@mbg.ocn.ne.jp> (raw)
In-Reply-To: <20040314190527.GA1898@cradle>

From: ronniec95@lineone.net
Subject: [Caml-list] Module/functor question
Date: Sun, 14 Mar 2004 19:05:28 +0000

> but I cannot figure out how to declare Foo having a signature of
> Serialiser and then use it in main somehow. Assume also that I have
> lots of other modules which have same basic interface but additional
> methods specific to the modules.

You do not need to declare.  Foo.Make will accept any module whose
signature is an *extension* of Serializer.

> (* was hoping for something like this *)
> let _ = let m = module Sender(Foo.Make) in
> 	m.serialisetoxml (Foo.Make (Xml.parse_from "..."));

By the way, a correct code would be

   let _ =
      let module M = Sender(Foo.Make) in
      M.serialisetoxml (Foo.Make (Xml.parse_from "..."));

--
Yamagata Yoriyuki

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


  reply	other threads:[~2004-03-14 19:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-14 19:05 ronniec95
2004-03-14 19:22 ` Yamagata Yoriyuki [this message]
2004-03-14 23:46   ` ronniec95
2004-03-15 12:34     ` Andreas Rossberg
2004-03-15 16:20       ` ronniec95

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=20040315.042218.07646200.yoriyuki@mbg.ocn.ne.jp \
    --to=yoriyuki@mbg.ocn.ne.jp \
    --cc=caml-list@inria.fr \
    --cc=ronniec95@lineone.net \
    /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).