Version française
Home     About     Download     Resources     Contact us    
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: -- (:)
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