Version française
Home     About     Download     Resources     Contact us    
Browse thread
Dummy polymorphic constructors
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: John Prevost <j.prevost@g...>
Subject: Re: [Caml-list] Dummy polymorphic constructors
On Thu, 16 Dec 2004 20:22:57 +0100, Alex Baretta <alex@barettadeit.com> wrote:
> Currently ocaml does not support empty polymorphic variant sum types.
> Say, I cannot write the following.
> 
> type empty = [ ]
> 
> This fails due to a syntax error rather than a typing error, which is a
> sensible, given that the type expression I have written is actually
> perfectly meaningful.

I'm somewhat confused as to why this is different from simply
declaring a new opaque type:

type empty

Since there is no way to construct a value of the type, nor any way to
deconstruct such a value, how is it different?

John.