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
Private type syntax and error message
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2008-09-12 (14:19)
From: Dario Teixeira <darioteixeira@y...>
Subject: Re: [Caml-list] Private type syntax and error message
> What do you expect it to do that might work? If it created
> an abstract type 
> the type would be useless, having no way to construct or
> destructure values 
> of that type...


I think the idea is that the type would be declared inside
a module that would provide constructor functions.  Moreover,
because private is not abstract, it would allow the outside
world to pattern-match on values of that type.  This is actually
a very useful feature.

Btw, the code works on 3.11 CVS!

Dario Teixeira