Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Wolfgang Lux <lux@heidelbg.ibm.com>
To: Xavier Leroy <Xavier.Leroy@inria.fr>
Cc: Guy.Cousineau@ens.fr, caml-list@pauillac.inria.fr
Subject: Re: CSL modules
Date: Tue, 05 Mar 96 10:03:33 +0100	[thread overview]
Message-ID: <9603050903.AA36425@idse.heidelbg.ibm.com> (raw)
In-Reply-To: (Your message of Mon, 04 Mar 96 15:05:49 N.) <199603041405.PAA26261@pauillac.inria.fr>


> This is easily done using a signature constraint to specify exactly
> how much of C should remain visible:
> 
> module type SIGA =
>   sig
>     type ta = A | B of int
>     val xa : ta
>   end
> module type SIGB =
>   sig
>     type tb = C | D of string
>     val xb : tb
>   end
> 

[ alternate (and better) definition of SIGC and F deleted]

> module type SIGC =
>   sig
>     type ta = A.ta              (* concrete *)
>     type tb                     (* abstract *)
>     val xa : ta
>     val xb : tb
>   end
> module F(A: SIGA)(B: SIGB) =
>   (struct
>      type ta = A.ta
>      type tb = B.tb
>      let xa = A.xa
>      let xb = B.xb
>    end : SIGC)
> module C = F(A)(B)
> 

Being curious I tried this and got an error from CSL 1.14, which I
really don't understand. After defining SIGA and SIGB and the
following two sample modules

module A : SIGA =
  struct
    type ta = A | B of int
    let xa = B 4
  end
module B : SIGB =
  struct
    type tb = C | D of string
    let xb = D "hello"
  end

I can define SIGC, but when I enter the definition of F, CSL returns
the following error:

Signature mismatch:
Modules do not match:
  sig type ta = A.ta type tb = B.tb val xa : A.ta val xb : B.tb end
is not included in
  SIGC
Type declarations do not match:
  type ta = A.ta
is not included in
  type ta = A.ta

Any clues?

Wolfgang

----
Wolfgang Lux
WZH Heidelberg, IBM Germany             Internet: lux@heidelbg.ibm.com
+49-6221-59-4546                        VNET:     LUX at HEIDELBG
+49-6221-59-3500 (fax)	                EARN:     LUX at DHDIBMIP





  reply	other threads:[~1996-03-05 10:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-03-01 15:24 Guy.Cousineau
1996-03-04 14:05 ` Xavier Leroy
1996-03-05  9:03   ` Wolfgang Lux [this message]
1996-03-06  9:28     ` Xavier Leroy
1996-03-05  9:55   ` Christophe Raffalli

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=9603050903.AA36425@idse.heidelbg.ibm.com \
    --to=lux@heidelbg.ibm.com \
    --cc=Guy.Cousineau@ens.fr \
    --cc=Xavier.Leroy@inria.fr \
    --cc=caml-list@pauillac.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