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.0 required=5.0 tests=none autolearn=disabled version=3.1.3 Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id CAD82BC69 for ; Wed, 29 Aug 2007 17:48:26 +0200 (CEST) Received: from yquem.inria.fr (yquem.inria.fr [128.93.8.37]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l7TFmQwh026592 for ; Wed, 29 Aug 2007 17:48:26 +0200 Received: by yquem.inria.fr (Postfix, from userid 25991) id 6F2FEBC69; Wed, 29 Aug 2007 17:48:26 +0200 (CEST) Date: Wed, 29 Aug 2007 17:48:26 +0200 From: Daniel de Rauglaudre To: caml-list@inria.fr Subject: Re: [Caml-list] how to upset the ocaml type system.... Message-ID: <20070829154826.GB27197@yquem.inria.fr> References: <20070828131850.GA32264@pulp.rsise.anu.edu.au> <20070829005634.GA7888@yquem.inria.fr> <46D55122.2090709@univ-savoie.fr> <1188399496.46d589880d7a3@webmail.in-berlin.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1188399496.46d589880d7a3@webmail.in-berlin.de> User-Agent: Mutt/1.5.9i X-Miltered: at discorde with ID 46D5954A.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; rauglaudre:01 rauglaudre:01 ocaml:01 0200,:01 bandel:01 inference:01 wrote:01 oliver:01 caml-list:01 functions:01 algorithm:01 algorithm:01 tree:02 variables:02 variables:02 Hi, On Wed, Aug 29, 2007 at 04:58:16PM +0200, Oliver Bandel wrote: > Where could the problem behind this kind of functions > occure in practical programming? This example is just academic. The resulting value of this example is an enormous value composed of a tree of couples of couples of couples of couples... (and so on, depending on the level), and all "leaves" are the same identical function. No interest. But this reminds that the algorithm of type inference is exponential of exponential in number of created type variables. In most programs, many of these type variables are identical, and the algorithm shares them using references. In this example, all created type variables are different. The result is a very complicated type, unuseful in practice. -- Daniel de Rauglaudre http://pauillac.inria.fr/~ddr/