Browse thread
how to upset the ocaml type system....
-
Pietro Abate
- David Allsopp
- Daniel de Rauglaudre
[
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: | -- (:) |
| From: | Daniel de Rauglaudre <daniel.de_rauglaudre@i...> |
| Subject: | Re: [Caml-list] how to upset the ocaml type system.... |
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/