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 mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by sympa.inria.fr (Postfix) with ESMTPS id 9476B7F24A for ; Wed, 31 Oct 2012 15:32:33 +0100 (CET) Received-SPF: None (mail1-smtp-roc.national.inria.fr: no sender authenticity information available from domain of radugrigore@gmail.com) identity=pra; client-ip=209.85.161.190; receiver=mail1-smtp-roc.national.inria.fr; envelope-from="radugrigore@gmail.com"; x-sender="radugrigore@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail1-smtp-roc.national.inria.fr: domain of radugrigore@gmail.com designates 209.85.161.190 as permitted sender) identity=mailfrom; client-ip=209.85.161.190; receiver=mail1-smtp-roc.national.inria.fr; envelope-from="radugrigore@gmail.com"; x-sender="radugrigore@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail1-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-gg0-f190.google.com) identity=helo; client-ip=209.85.161.190; receiver=mail1-smtp-roc.national.inria.fr; envelope-from="radugrigore@gmail.com"; x-sender="postmaster@mail-gg0-f190.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AjcCAIs1kVDRVaG+jmdsb2JhbAA6CsAUg1AIIwEBAQEJCwkJEgYjgh4BAQEEAQEBDwJIHRALGC4jEQEFARw7h1EBEpx3YgkDjDCHbAoZgQ2Ie4t4EIMHgyQDiFqbfT+EMQ X-IronPort-AV: E=Sophos;i="4.80,687,1344204000"; d="scan'208";a="179702695" Received: from mail-gg0-f190.google.com ([209.85.161.190]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 31 Oct 2012 15:32:32 +0100 Received: by mail-gg0-f190.google.com with SMTP id y1so927478ggc.27 for ; Wed, 31 Oct 2012 07:32:31 -0700 (PDT) Received: by 10.229.175.2 with SMTP id v2mr1976543qcz.19.1351693948276; Wed, 31 Oct 2012 07:32:28 -0700 (PDT) Path: glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: fa.caml Date: Wed, 31 Oct 2012 07:32:06 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=138.37.90.78; posting-account=e5mzsQoAAAB7g9y7Bkgam0zJDHRr7bCB NNTP-Posting-Host: 138.37.90.78 References: User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-IP: 138.37.90.78 MIME-Version: 1.0 Message-ID: From: Radu Grigore To: fa.caml@googlegroups.com Cc: caml-list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Caml-list] Why should I use .mli files? On Tuesday, October 30, 2012 12:44:27 AM UTC, Francois Berenger wrote: > what's the use of those .mli files? They are good for documentation. Most projects don't fit in one human head= , at any one moment. When you approach code that is new to you or that you= forgot, it is helpful to know which are the important bits. MLI files are= one good mechanism to point to the important parts of a big module. I rea= d MLI files like this: "Out of these 60 functions you are most likely to ne= ed these 3." If an MLI file is big, then it fails to identify the important parts. Thos= e big MLI files are also annoying to maintain. So, just don't write big ML= I files. The one case where MLIs tend to be big is when the module include= s many type declarations. In that case you can often pull out all type dec= larations into a separate ML file, which you *don't* pair up with an MLI fi= le. On a more advanced level, you need interfaces when you mess around with fun= ctors. But, playing with functors in OCaml feels a bit like playing with t= emplates in C++ or with Arrows in Haskell: more seductive than productive.