[Caml-list] type generalization of recursive calls

2010-02-17 Thread Stéphane Gimenez
Hi, I just realized that ocaml generalizes the type of a recursively defined function *only* for calls which are outside it's own definition. Recursive calls cannot use a generalized type. In fact, I'm tring to work with such a data type: type 'a t = | E | D of 'a t * 'a t | O of 'a | I

Re: WAS Re: [Caml-list] Re: The need to specify 'rec' in a recursive function defintion

2010-02-17 Thread Andrej Bauer
Moreover, the burden of rec is tiny so I don't think it is worth discussing in such detail. Ah, but you are forgetting Wadler's Law. ___ Caml-list mailing list. Subscription management: http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list Archives:

Re: [Caml-list] type generalization of recursive calls

2010-02-17 Thread Damien Guichard
Hello, First, you really need strong tyupe checking because your definition is actually incorrect. Second, see polymorphic-recursion : http://alaska-kamtchatka.blogspot.com/2009/05/polymorphic-recursion.html Be sure to read the comments by bluestorm. There is also pa_polyrec, a syntax

Re: [Caml-list] type generalization of recursive calls

2010-02-17 Thread Damien Guichard
I have to apologize because your definition is actually correct. Sorry i have read it too fast and didn't see map burried in type casting. It seems to me your are doing structural recursion on some binary tree structure. Presumably to fast-merge binary heaps or something like that. pa_polyrec is

Re: [Caml-list] type generalization of recursive calls

2010-02-17 Thread Boris Yakobowski
Hi Gim, On Wed, Feb 17, 2010 at 5:34 PM, Stéphane Gimenez stephane.gime...@pps.jussieu.fr wrote: Questions:  - Is it theoreticaly safe to generalize recursive calls ? Yes. And this is done in explicitly-typed languages, such as in Coq.  - Is there a syntactical trick to use generalized

[Caml-list] ANN: ocamlnet-3.0test2

2010-02-17 Thread Gerd Stolpmann
Hi list, it is my pleasure to announce the second test version of the upcoming ocamlnet3 library. This version mainly includes a large number of bug fixes compared to the first version, but also a few additions: * netcamlbox: a fast ipc mechanism for sending ocaml values to another

Re: [Caml-list] [ANN] Proview PDF Editor for Mac OS X - written (mostly) in OCaml

2010-02-17 Thread Mihamina Rakotomandimby
John Whitington j...@coherentgraphics.co.uk : There will be a new release of CamlPDF in a few weeks, with some new functionality and a new introductory manual, making it easier for people to get into its somewhat complicated API. Thank you very much! -- Architecte Informatique chez