Article View: fa.caml
Article #88Re: [Caml-list] Why should I use .mli files?
From: Radu Grigore
Date: Wed, 31 Oct 2012 14:32
Date: Wed, 31 Oct 2012 14:32
20 lines
2439 bytes
2439 bytes
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 read MLI files like this: "Out of these 60 functions you are most likely to need these 3." If an MLI file is big, then it fails to identify the important parts. Those big MLI files are also annoying to maintain. So, just don't write big MLI files. The one case where MLIs tend to be big is when the module includes many type declarations. In that case you can often pull out all type declarations into a separate ML file, which you *don't* pair up with an MLI file. On a more advanced level, you need interfaces when you mess around with functors. But, playing with functors in OCaml feels a bit like playing with templates in C++ or with Arrows in Haskell: more seductive than productive.
Technical Details
Message-ID:
<ad3d7d50-e9b1-44e4-8781-35f7e73f560e@googlegroups.com>Path:
arc1-ca.pugleaf.net!gf5ni7629245qab.0!nntp.google.com!c7no827143qap.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mailReferences:
<fa.4zzWyGZIo+GsGOz7cSC34yWTunY@ifi.uio.no>Show Full Headers
Complete Article Headers
X-Google-Thread: c0fe4b917e,7f9c343d72340b37
X-Google-Attributes: gidc0fe4b917e,public,usenet
X-Google-NewGroupId: yes
X-Google-Language: ENGLISH,ASCII-7-bit
Received: by 10.224.189.16 with SMTP id dc16mr17144709qab.0.1351693951857;
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: arc1-ca.pugleaf.net!gf5ni7629245qab.0!nntp.google.com!c7no827143qap.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
Newsgroups: fa.caml
Date: Wed, 31 Oct 2012 07:32:06 -0700 (PDT)
In-Reply-To: <fa.4zzWyGZIo+GsGOz7cSC34yWTunY@ifi.uio.no>
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: <fa.4zzWyGZIo+GsGOz7cSC34yWTunY@ifi.uio.no>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <ad3d7d50-e9b1-44e4-8781-35f7e73f560e@googlegroups.com>
Subject: Re: [Caml-list] Why should I use .mli files?
From: Radu Grigore <radugrigore@gmail.com>
Cc: caml-list <caml-list@inria.fr>
Injection-Date: Wed, 31 Oct 2012 14:32:31 +0000
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable