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 2FC567F249 for ; Thu, 1 Nov 2012 16:27:08 +0100 (CET) Received-SPF: None (mail1-smtp-roc.national.inria.fr: no sender authenticity information available from domain of didier.cassirame@gmail.com) identity=pra; client-ip=209.85.219.54; receiver=mail1-smtp-roc.national.inria.fr; envelope-from="didier.cassirame@gmail.com"; x-sender="didier.cassirame@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail1-smtp-roc.national.inria.fr: domain of didier.cassirame@gmail.com designates 209.85.219.54 as permitted sender) identity=mailfrom; client-ip=209.85.219.54; receiver=mail1-smtp-roc.national.inria.fr; envelope-from="didier.cassirame@gmail.com"; x-sender="didier.cassirame@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-oa0-f54.google.com) identity=helo; client-ip=209.85.219.54; receiver=mail1-smtp-roc.national.inria.fr; envelope-from="didier.cassirame@gmail.com"; x-sender="postmaster@mail-oa0-f54.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AlMCAFaTklDRVds2m2dsb2JhbABEhhe9TAgjAQEBAQEICRQUJ4IeAQEEASMdARsdAQMMBgUEBzcCAiEBAREBBQEcBhOHcwEDCQaeCotjT4J2hRcKGScNWYh1AQUMiwhnhSiBEwOUI4FVizKDMBYphBI X-IronPort-AV: E=Sophos;i="4.80,693,1344204000"; d="scan'208";a="179825212" Received: from mail-oa0-f54.google.com ([209.85.219.54]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 01 Nov 2012 16:27:07 +0100 Received: by mail-oa0-f54.google.com with SMTP id n9so4543649oag.27 for ; Thu, 01 Nov 2012 08:27:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=1ex9yJWfEGF9zLn556MHVcs2KogcZ8qjRwzBu6QAVno=; b=G1K+kHFNPzjbqGM7NcaccmEAbyJDeLg8/aSLzcK6bAXE8aMPAmTGVKwxS4Ei5n8CnN sEJdufZAA8q7QlTwHrFmfwDZ+bDrhPEWncJ0zUuDSFNq1EVFwzCUvzv5+rdS+CZSYCpp GpRNZ9pzxGOH0Hx1nH1LguskYc7W9q0/4+lXRaTd9+dRXFp+lIH8b6TgdDMS4h+l6TKP e+iPlqlbuFp18VfVkhf9diKaKPqtiiZjsDk9emlu5RlEH5fqHU2YSC4eMzDhVUjUtMzC 1VQYp45RH1TeSVegbpS4L9Qv94h6xnO6hsLAx9L8dIanh58B2yh3NP0id6gL7wh7hqgk Bweg== Received: by 10.182.172.74 with SMTP id ba10mr33637782obc.83.1351783626233; Thu, 01 Nov 2012 08:27:06 -0700 (PDT) MIME-Version: 1.0 Received: by 10.60.137.198 with HTTP; Thu, 1 Nov 2012 08:26:46 -0700 (PDT) In-Reply-To: <94654D4E-20EE-4690-91EA-9BBD1CF111C5@first.in-berlin.de> References: <508F22BD.7010103@riken.jp> <94654D4E-20EE-4690-91EA-9BBD1CF111C5@first.in-berlin.de> From: Didier Cassirame Date: Thu, 1 Nov 2012 16:26:46 +0100 Message-ID: To: Oliver Bandel Cc: Francois Berenger , caml-list Content-Type: multipart/alternative; boundary=e89a8f839f6fdad70c04cd70a6c8 Subject: Re: [Caml-list] Why should I use .mli files? --e89a8f839f6fdad70c04cd70a6c8 Content-Type: text/plain; charset=UTF-8 2012/10/31 Oliver Bandel > > > Am 30.10.2012 um 16:52 schrieb Didier Cassirame < > didier.cassirame@gmail.com>: > > > > > Thinking about it, there's at least one case where mli files are not so > useful: When you have several modules which must all comply with a certain > module type. In that case, all the mli files would be identical, and a > modification of the module type would necessitate to change all the .mli. > > Sounds like you reformulated an advantagenas being a disadvantage. > If someone changes a type of a module by accident, it,will pop up as > problem. > Also I wonder, if a type that is used by other modules > might not also need to change the mplementation. > Yes, reading my words now, maybe the wording wasn't that great. When you're using functors, you usually expect a very specific interface for lifted modules. In fact, it's not so clear cut, but I think it's good practice to conform the lifted modules to the module type that the functor expects. Ah, also, one cannot make a functor of a ml/mli file. That's the kind of situation I was thinking about, because I more or less had the problem, for one of my projects. I am still not sure about the best way to split the code in several files (The practice for functors is to have a Make functor within the module, which is Ok, but if I want to have each module in its own file, I don't know how to do it properly). didier --e89a8f839f6fdad70c04cd70a6c8 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

2012/10/31 Oliver Bandel <olive= r@first.in-berlin.de>


Am 30.10.2012 um 16:52 schrieb Didier Cassirame <didier.cassirame@gmail.com>= :

>
> Thinking about it, there's at least one case where mli files are n= ot so useful: When you have several modules which must all comply with a ce= rtain module type. In that case, all the mli files would be identical, and = a modification of the module type would necessitate to change all the .mli.=

Sounds like you reformulated an advantagenas being a disadvantage.
If someone changes a type of a module by accident, it,will pop up as
problem.
Also I wonder, if a type that is used by other modules
might not also need to change the mplementation.

Y= es, reading my words now, maybe the wording wasn't that great.
When= you're using functors, you usually expect a very specific interface fo= r lifted modules. In fact, it's not so clear cut, but I think it's = good practice to conform the lifted modules to the module type that the fun= ctor expects. Ah, also, one cannot make a functor of a ml/mli file.

That's the kind of situation I was thinking about, because I more o= r less had the problem, for one of my projects. I am still not sure about t= he best way to split the code in several files (The practice for functors i= s to have a Make functor within the module, which is Ok, but if I want to h= ave each module in its own file, I don't know how to do it properly).
didier
--e89a8f839f6fdad70c04cd70a6c8--