Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
how to upset the ocaml type system....
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-08-29 (15:48)
From: Daniel de Rauglaudre <daniel.de_rauglaudre@i...>
Subject: Re: [Caml-list] how to upset the ocaml type system....

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