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 D888A7F249 for ; Wed, 31 Oct 2012 16:32:16 +0100 (CET) Received-SPF: None (mail4-smtp-sop.national.inria.fr: no sender authenticity information available from domain of alain@frisch.fr) identity=pra; client-ip=193.252.23.210; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="alain@frisch.fr"; x-sender="alain@frisch.fr"; x-conformance=sidf_compatible Received-SPF: None (mail4-smtp-sop.national.inria.fr: no sender authenticity information available from domain of alain@frisch.fr) identity=mailfrom; client-ip=193.252.23.210; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="alain@frisch.fr"; x-sender="alain@frisch.fr"; x-conformance=sidf_compatible Received-SPF: None (mail4-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@msa.smtpout.orange.fr) identity=helo; client-ip=193.252.23.210; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="alain@frisch.fr"; x-sender="postmaster@msa.smtpout.orange.fr"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AuQAAJVDkVDB/BfSlGdsb2JhbABEwBaDfAEBAQEJCwkJFAMkgh4BAQU4QAEQCxgJFg8JAwIBAgFFBg0BBwEBiAa8Tot4hjsDlXaFaY1J X-IronPort-AV: E=Sophos;i="4.80,687,1344204000"; d="scan'208";a="161027941" Received: from msa01.smtpout.orange.fr (HELO msa.smtpout.orange.fr) ([193.252.23.210]) by mail4-smtp-sop.national.inria.fr with ESMTP; 31 Oct 2012 16:32:16 +0100 Received: from [192.168.1.108] ([86.195.137.225]) by mwinf5d01 with ME id HrYE1k00p4ry3ty03rYEeb; Wed, 31 Oct 2012 16:32:15 +0100 Message-ID: <50914480.1050408@frisch.fr> Date: Wed, 31 Oct 2012 16:32:16 +0100 From: Alain Frisch User-Agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:16.0) Gecko/20121026 Thunderbird/16.0.2 MIME-Version: 1.0 To: Francois Berenger CC: caml-list References: <508F22BD.7010103@riken.jp> In-Reply-To: <508F22BD.7010103@riken.jp> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Caml-list] Why should I use .mli files? On 10/30/2012 01:43 AM, Francois Berenger wrote: > Here is my stupid question of the day: > what's the use of those .mli files? An argument which I haven't seen mentioned (but I did not read all the thread) is that providing an explicit .mli file give the compiler a chance to detect unused declarations (types, values) in your module (declarations which are not used internally and not exported). FWIW, we have a tiny parser extension which allows us to put an interface on top of the current unit, without having to provide a proper .mli file. This is used in our "addins", which typically register themselves into some kind of registry but don't export too many values otherwise (most often, none). We can write: sig ... end ....... which is just sugar for: include (....... : sig ... end) (without this extension, we would end up with many empty .mli files) Alain