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 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 9FCE9BC6B for ; Wed, 29 Aug 2007 02:56:34 +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 l7T0uYZ9029307 for ; Wed, 29 Aug 2007 02:56:34 +0200 Received: by yquem.inria.fr (Postfix, from userid 25991) id 4199CBC6B; Wed, 29 Aug 2007 02:56:34 +0200 (CEST) Date: Wed, 29 Aug 2007 02:56:34 +0200 From: Daniel de Rauglaudre To: caml-list@inria.fr Subject: Re: [Caml-list] how to upset the ocaml type system.... Message-ID: <20070829005634.GA7888@yquem.inria.fr> References: <20070828131850.GA32264@pulp.rsise.anu.edu.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070828131850.GA32264@pulp.rsise.anu.edu.au> User-Agent: Mutt/1.5.9i X-Miltered: at discorde with ID 46D4C442.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; rauglaudre:01 rauglaudre:01 ocaml:01 inference:01 ocamlc:01 ocamlc:01 28,:98 wrote:01 caml-list:01 oops:01 algorithm:01 compiling:02 mmm:03 let:03 let:03 Hi, On Tue, Aug 28, 2007 at 11:18:50PM +1000, Pietro Abate wrote: > the other day I was looking for a fringe case to show me the worst > complexity of the type inference algorithm... Interesting. To see the resulting time, I changed the code into: let f = let x1 = fun x -> (x,x) in let x2 = fun y -> x1 ( x1 y ) in let x3 = fun y -> x2 ( x2 y ) in let x4 = fun y -> x3 ( x3 y ) in let x5 = fun y -> x4 ( x4 y ) in x5 ( fun z -> z ) ;; (I stopped at x5 to have a correct answering time.) Compiling with -i to display the resulting type: ocamlc -c -i t.ml Oops... lines and lines and lines... Mmm.... let's see: ocamlc -c -i t.ml | wc -l 16385 -- Daniel de Rauglaudre http://pauillac.inria.fr/~ddr/