From: Daniel Bonniot <dbonniot@ens-lyon.fr>
To: caml-list@inria.fr
Subject: Typage des modules
Date: Tue, 22 Jun 1999 17:38:54 +0200 [thread overview]
Message-ID: <376FAE0E.9C1AD8AE@ens-lyon.fr> (raw)
Bonjour,
Comment resoudre le probleme suivant ?
Le module A declare un type a, le module B renvoie une valeur de type a
et A utilise B dans son implementation :
(* a.mli *)
type a
val v:a
(* a.ml *)
type a = { x: int}
let v = B.f {x=3}
(* b.mli *)
val f : A.a-> A.a
(* b.ml *)
let f x =x
Voici le resultat des compilations:
moo>ls
a.ml a.mli b.ml b.mli
moo>ocamlc -c a.mli
moo>ocamlc -c b.mli
moo>ocamlc -c a.ml
File "a.ml", line 2, characters 12-17:
This expression has type a but is here used with type A.a
moo>
Cette erreur est logique etant donne le systeme de typage des modules,
mais comment ecrire ce genre de dependances ?
Daniel Bonniot
next reply other threads:[~1999-06-22 22:01 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-06-22 15:38 Daniel Bonniot [this message]
1999-06-23 13:19 ` Sylvain BOULM'E
1999-06-23 17:00 ` David Monniaux
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=376FAE0E.9C1AD8AE@ens-lyon.fr \
--to=dbonniot@ens-lyon.fr \
--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