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
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:
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
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
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
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
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