caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] coping with circular dependencies
@ 2012-07-23  7:30 Ivan
  0 siblings, 0 replies; only message in thread
From: Ivan @ 2012-07-23  7:30 UTC (permalink / raw)
  To: caml-list

In a simplified form I've the following setup:

module a defines a type with some functions:

(* file a.mli *)
  type t
  ...
  val of_string: string -> t

module b is a parser, defining function parse, that can produce values of types A.t from, for example, strings:

(* file b.mli *)
  type t = A.t
  ...
  val parse_a : string -> t
  
When I try to compile this simple example, compiler refuses to accept it, reasoning that :

Error: The implementation a.ml does not match the interface a.cmi:
       Values do not match:
         val of_string : string -> B.t
       is not included in
         val of_string : string -> t


Are there're any solutions,  satisfying the following constraints:
1) I want A.t to be an abstract type.
2) IRL a.mli and b.mli are rather large files (b is produces from mll and mly files)




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-07-23  7:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-23  7:30 [Caml-list] coping with circular dependencies Ivan

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).