caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Ivan Gotovchits <ivg@ieee.org>
To: William Smith <bills@emu-bark.com>
Cc: Caml-list <caml-list@inria.fr>
Subject: Re: [Caml-list] Declaring a parameterized type in a .mli
Date: Mon, 08 Apr 2013 07:57:49 +0400	[thread overview]
Message-ID: <878v4tr7wi.fsf@golf.niidar.ru> (raw)
In-Reply-To: <516236E1.7090102@emu-bark.com> (William Smith's message of "Sun, 07 Apr 2013 23:17:53 -0400")

William Smith <bills@emu-bark.com> writes:


> module Id = GenericID( IDRoot )
Compiler is right =) You can't do this in a module type specification. 

Though you can define a signature of your module in some *.ml file and
use it later in your module type declaration.

For example:

<file sig.ml>:
   module type Id = sig
       type t
       val compare : t -> t -> int
       val to_string : t -> string
       val cons : unit -> t
   end

   module type Root = sig ... end



<file  genericId.mli>
   open Sig
   module Make(Root:Root): Id

   module DefaultId : Id
   
-- 
         (__) 
         (oo) 
   /------\/ 
  / |    ||   
 *  /\---/\ 
    ~~   ~~   
...."Have you mooed today?"...

  reply	other threads:[~2013-04-08  3:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-08  3:17 William Smith
2013-04-08  3:57 ` Ivan Gotovchits [this message]
2013-04-08  4:05   ` Markus Mottl
2013-04-08  4:09     ` Ivan Gotovchits

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=878v4tr7wi.fsf@golf.niidar.ru \
    --to=ivg@ieee.org \
    --cc=bills@emu-bark.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;
as well as URLs for NNTP newsgroup(s).