From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.4 required=5.0 tests=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id 5D152BBAF; Thu, 20 Nov 2008 10:29:02 +0100 (CET) X-IronPort-AV: E=Sophos;i="4.33,639,1220220000"; d="scan'208";a="20161190" Received: from peray.inria.fr (HELO ausone.inria.fr) ([128.93.8.98]) by mail1-relais-roc.national.inria.fr with ESMTP; 20 Nov 2008 10:29:02 +0100 Received: by ausone.inria.fr (Postfix, from userid 501) id 4C0C72AF2953; Thu, 20 Nov 2008 10:28:07 +0100 (CET) Content-Type: text/plain; charset=UTF-8 Cc: Paolo Donadeo , Caml_mailing list Subject: Re: [Caml-list] Wanted: your feedback on the hierarchy of OCaml Batteries Included From: Nicolas Pouillard To: Maxence Guesdon References: <1227002178.6170.25.camel@Blefuscu> <200811182330.03947.jon@ffconsultancy.com> <1227076192.6290.7.camel@Blefuscu> <4b5157c30811190146l2c6a5e2cv4a085bcc14ae5f4@mail.gmail.com> <20081119211124.51610ae9@alcazar.inria.fr> In-Reply-To: <20081119211124.51610ae9@alcazar.inria.fr> Date: Thu, 20 Nov 2008 10:28:07 +0100 Message-Id: <1227172839-sup-5973@ausone.inria.fr> User-Agent: Sup/git X-Spam: no; 0.00; ocaml:01 maxence:01 ocaml:01 lib:01 lib:01 constructors:01 cheers:01 beginners:01 wrote:01 caml-list:01 functions:01 data:02 data:02 define:02 modules:02 Excerpts from Maxence Guesdon's message of Wed Nov 19 21:11:24 +0100 2008: > On Wed, 19 Nov 2008 10:46:24 +0100 > "Paolo Donadeo" wrote: > > > Couldn't we take inspiration from the Python standard library [1]? > > Python hasn't namespace but is provided with a module system similar > > to OCaml *and* the standard library is really impressive. > > > > And nobody can say Python is a bureaucratic language like Java :-) > > > > > > [1] http://www.python.org/doc/2.5.2/lib/lib.html > > Hello, > > I think a hierarchy in the documentation is very useful: it helps beginners > understand the big picture about all available modules and help developers > find the functions they look for. But in the code, I think it is really > more convenient to only have one level of "standard" modules. > > By the way, I, too, always prefix idents with the module they come from, > (like in List.length) and only "open" a module to use fields and > constructors, so using Data.Containers.List.length or whatever is longer > than "List.length" is not an option. Having a shortcut "List" for > Data.Containers.List does not convince me, because the problem will remain > with modules with no shortcut. > > So hierarchy in documentation: yes; in the code: no. No one (I guess) would recommend you to use fully qualified paths as in Data.Containers.List.length of course. Data.Containers.List.length is the external name, made to be well organized not to be quick to type, the way to use it to open it *OR* to define an internal name for it : module L = Data.Containers.List And then use L.length, L.map... I know that the choice of name qualification, opening, or local modules is controversial, however I would like to point out that the external name don't need to be the same than the internal name. Cheers, -- Nicolas Pouillard aka Ertai