Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
* Typage des modules
@ 1999-06-22 15:38 Daniel Bonniot
  1999-06-23 13:19 ` Sylvain BOULM'E
  1999-06-23 17:00 ` David Monniaux
  0 siblings, 2 replies; 3+ messages in thread
From: Daniel Bonniot @ 1999-06-22 15:38 UTC (permalink / raw)
  To: caml-list


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




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1999-06-23 19:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-06-22 15:38 Typage des modules Daniel Bonniot
1999-06-23 13:19 ` Sylvain BOULM'E
1999-06-23 17:00 ` David Monniaux

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox