Browse thread
how to upset the ocaml type system....
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: | 2007-08-29 (14:58) |
From: | Oliver Bandel <oliver@f...> |
Subject: | Re: [Caml-list] how to upset the ocaml type system.... |
Zitat von Christophe Raffalli <Christophe.Raffalli@univ-savoie.fr>: > Daniel de Rauglaudre a écrit : > > 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 ) ;; > > > > > This is strange, it is problematic even with -rectypes while this is > not necessary if the subtypes are shared ... I already so ocaml > printing some types with sharing, so why is this not the case here ? > (I am using 3.09.2) [...] Sorry, if I can't follow why this discussion was started. Is this a purely-academic talk, or does it have any relevance for programmers who want to solve a programming problem? Where could the problem behind this kind of functions occure in practical programming? I tested the above code and it needed a lot of time to execute in the toplevel. I stopped this then, before the toplevel were ready. I never had such a behavior of so long needed time for any kind of code. So I doubt that this is a problem that matters in the realworld. But possibly I'm wrong. Can you please elaobrate on this? Is this more than a academic mental exercise? Ciao, Oliver