English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
cyclic types
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2005-01-30 (05:57)
From: brogoff <brogoff@s...>
Subject: Re: [Caml-list] cyclic types
On Sun, 30 Jan 2005, Damien Doligez wrote:
> On Jan 29, 2005, at 18:33, Radu Grigore wrote:
> > Can you give an example of why rectypes by default is dangerous?
> IIRC, rectypes are off by default because they trade a small increment
> in expressive power for a large degradation of the intelligibility of
> type-checking error messages.  I don't think they are dangerous in the
> sense of breaking the type system.

Right, that's what I meant. They certainly don't break the type system.
There was a fairly lengthy discussion of this topic about 5 years ago, but
since browsing the archives now is a lot harder than when I started, I'll let
someone else dig up the pointer.

In almost all cases, you can achieve the effect of -rectypes by introducing
an extra constructor.

I think the degradation in intelligibility you mention is only in the case of
-rectypes being the default. If (optional) type annotations could drive the
inference, I think we'd have the best of both worlds. It seems like
FPL type systems are going to have to move in the direction of the more
programmer supplied annotations anyways.

-- Brian