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=1.1 required=5.0 tests=AWL,SPF_SOFTFAIL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 49C5ABC69 for ; Thu, 22 Feb 2007 02:10:03 +0100 (CET) Received: from mail.davidb.org (mail.davidb.org [66.93.32.219]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l1M1A1lx019249 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 22 Feb 2007 02:10:02 +0100 Received: from localhost ([127.0.0.1]) by mail.davidb.org with esmtpa (Exim 4.62 #1 (Debian)) id 1HK2T8-0003fW-Ph; Wed, 21 Feb 2007 17:09:58 -0800 Message-ID: <45DCED65.7070107@davidb.org> Date: Wed, 21 Feb 2007 17:09:57 -0800 From: David Brown User-Agent: Thunderbird 1.5.0.9 (X11/20061221) MIME-Version: 1.0 To: Jacques Garrigue Cc: sds@gnu.org, caml-list@inria.fr Subject: Re: [Caml-list] warning on value shadowing References: <45DCAE89.1050904@gnu.org> <20070222.095436.125900161.garrigue@math.nagoya-u.ac.jp> In-Reply-To: <20070222.095436.125900161.garrigue@math.nagoya-u.ac.jp> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Miltered: at discorde with ID 45DCED69.002 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; haskell:01 overloading:01 iirc:01 haskell:01 foo:01 baz:01 foo:01 ocaml:01 wrote:01 caml-list:01 caml-list:01 shorter:02 garrigue:03 types:03 types:03 Jacques Garrigue wrote: > Haskell has types too, but it also has overloading, which confuse > things a bit, and IIRC there are no qualified identifiers, when you > want to make explicit which definition you want to use. You can import in Haskell as qualified, which is frequently done with shorter names. import qualified LongName as L and then use L.foo It also allows other tricks such as import qualified LongName as L import LongName (baz) which will import the symbol 'baz' from LongName, and the rest of LongName is accessed qualified (L.foo). This kind of stuff can be done in OCaml too, but gets tedious, especially with types. The other odd difference is that in Haskell, importing puts the names into the current module. If the current module is exporting everything, then these names will be exported from it as well. Dave