Browse thread
[Caml-list] Doubly-linked list
[
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: | Diego Olivier Fernandez Pons <Diego-Olivier.FERNANDEZ-PONS@c...> |
| Subject: | Re: Polymorphic recursion 9Was Re: [Caml-list] Doubly-linked list) |
Brian Rogoff a écrit
> Oh I'm not arguing that point, I totally agree that it's omission is a
> bad thing. However, not everyone agrees, since you it becomes a lot tougher
> to build a monomorphizing compiler if you allow it, though it has been
> suggested that the same tricks you use to manually remove polymorphic
> recursion could be used in an SSC (sufficiently smart compiler).
I do not agree with your analysis since I really do not believe anyone
could think that polymorphic recursion is useless. But it is a
_difficult_ subject and the Caml Team is working on it (you can read
their research summary)
Actually, I do not even think that including some tricks in the
compiler is a manageable solution.
> Anyways, since OCaml 3.05 allows first class polymorphism on records, you
> don't even need to use "polymorphic recots" to get non-uniform recursion;
> simply mapping the OOP to records does the trick. Here's the first example
> from OKasaki which uses polymorphic recursion, done in OCaml with this
> direct approach
[...]
Your trick is very interesting but I am afraid I cannot include that
kind of code in a library whose purpose is also to be a pedagogical
support for a data structure course in Caml and an example for
beginners (maybe released as independent modules ?)
Diego Olivier
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners