From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by sympa.inria.fr (Postfix) with ESMTPS id DDCF17ED47 for ; Mon, 23 Jul 2012 09:30:21 +0200 (CEST) Received-SPF: None (mail4-smtp-sop.national.inria.fr: no sender authenticity information available from domain of ivg@ieee.org) identity=pra; client-ip=95.108.130.94; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="lisp-hacker@yandex.ru"; x-sender="ivg@ieee.org"; x-conformance=sidf_compatible Received-SPF: Pass (mail4-smtp-sop.national.inria.fr: domain of lisp-hacker@yandex.ru designates 95.108.130.94 as permitted sender) identity=mailfrom; client-ip=95.108.130.94; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="lisp-hacker@yandex.ru"; x-sender="lisp-hacker@yandex.ru"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail4-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@forward12.mail.yandex.net) identity=helo; client-ip=95.108.130.94; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="lisp-hacker@yandex.ru"; x-sender="postmaster@forward12.mail.yandex.net"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AlICAOD8DFBfbIJelWdsb2JhbABEhSu0CSIBAQEBCQsJCRIpgk6CBAwuh3adRKA2kiADiEiFKYdYknE X-IronPort-AV: E=Sophos;i="4.77,638,1336341600"; d="scan'208";a="151418382" Received: from forward12.mail.yandex.net ([95.108.130.94]) by mail4-smtp-sop.national.inria.fr with ESMTP; 23 Jul 2012 09:30:20 +0200 Received: from web14f.yandex.ru (web14f.yandex.ru [95.108.131.156]) by forward12.mail.yandex.net (Yandex) with ESMTP id 7B527C212DB for ; Mon, 23 Jul 2012 11:30:17 +0400 (MSK) Received: from 127.0.0.1 (localhost.localdomain [127.0.0.1]) by web14f.yandex.ru (Yandex) with ESMTP id 674EB72B0001; Mon, 23 Jul 2012 11:30:15 +0400 (MSK) Received: from wimax-client.yota.ru (wimax-client.yota.ru [178.176.172.152]) by web14f.yandex.ru with HTTP; Mon, 23 Jul 2012 11:30:14 +0400 From: Ivan Envelope-From: lisp-hacker@yandex.ru To: "caml-list@inria.fr" MIME-Version: 1.0 Message-Id: <2300481343028614@web14f.yandex.ru> Date: Mon, 23 Jul 2012 11:30:14 +0400 X-Mailer: Yamail [ http://yandex.ru ] 5.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain Subject: [Caml-list] coping with circular dependencies 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)