Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Virgile Prevosto <virgile.prevosto@m4x.org>
To: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] module type...
Date: Thu, 11 Nov 2004 10:48:49 +0100	[thread overview]
Message-ID: <20041111104849.29e7e506@mpiat2314> (raw)
In-Reply-To: <20041111090931.GA13972@pulp.anu.edu.au>

Hello,
Le 11.11.2004, à 20:09:31, Pietro Abate a écrit:
> 
> below the extended version of the problem with the same error...
> 
> any advice on how to modify my modules/classes design to overcome this
> problem ? what I'm trying to do is to have set, setofset,
> setofsetofset etc using the same code base and functors...
> 

You can use a variant of the solution (a), with t still being abstract
in ElType and the use of explicit type equalities (see the reference
manual,<http://pauillac.inria.fr/ocaml/htmlman/manual004.html>, section
2.4) for each of the implementations:

> module type ElType  =
>     sig
>         type t (* type t is abstract here. *)
>         val copy : t -> t
>         val to_string : t -> string
>     end

> module TermType : ElType 

                      with type t = int 
                      (* TermType.t is unifiable with int *)
  ... 
> module SetOfTerm = MakeSet (TermType) (Set.Make);;
> 
> module SetOfTermType : ElType 

                      with type t = SetOfTerm.set
                      (* SetOfTermType.t is unifiable with
                         Set.OfTerm.set *)
  ...
-- 
E tutto per oggi, a la prossima volta
Virgile


  reply	other threads:[~2004-11-11  9:48 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-11  8:35 Pietro Abate
2004-11-11  8:56 ` [Caml-list] " skaller
2004-11-11  9:09   ` Pietro Abate
2004-11-11  9:48     ` Virgile Prevosto [this message]
2004-11-12 16:11       ` Specifying abstract type in a record josh
2004-11-12 16:33         ` [Caml-list] " Luc Maranget
2004-11-12 16:37         ` Aleksey Nogin
2004-11-12 16:37         ` Richard Jones
2004-11-12 16:40         ` Andrew Bagdanov
2004-11-12 16:44         ` Matt Gushee

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=20041111104849.29e7e506@mpiat2314 \
    --to=virgile.prevosto@m4x.org \
    --cc=caml-list@yquem.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