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: skaller <skaller@u...>
Subject: Re: [Caml-list] Dummy polymorphic constructors
On Fri, 2004-12-17 at 09:38, John Prevost wrote:
> 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 = [ ]

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

Polymorphic variants are extensible and algebraic .. 
an abstract type is neither.

-- 
John Skaller, mailto:skaller@users.sf.net
voice: 061-2-9660-0850, 
snail: PO BOX 401 Glebe NSW 2037 Australia
Checkout the Felix programming language http://felix.sf.net