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
Polymorphic variant typing
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2005-02-16 (06:41)
From: Jacques Garrigue <garrigue@m...>
Subject: Re: [Caml-list] Polymorphic variant typing
From: Gilles Dubochet <dubochet@urbanet.ch>
> > The main reason for this choice is avoiding making rows explicit,
> > i.e. having a multi-sorted type algebra. Note also that ocaml object
> > types, while originally based on Remy's system, are hiding their
> > row-variables, and can be described in the same formalism.

> Just to make it crystal clear for me: You say that the "main reason for 
> this choice is avoiding making rows explicit", does this mean that the 
> O'Caml team feels that row-based type information is too complicated 
> for an average user since you either steer away of hide it in an object 
> model?

Basically yes. Hence the clever tricks to have types containing hidden
row variables, like #t, [< t], [> t]. Having explicit row variables
was considered at some point, but it was not done because types would
become much more verbose. Consider for instance that with variants,
presence/absence information is needed for each tag.

On the other hand, advanced features like explicit polymorphism require
some understanding of the presence of hidden variables, and how they
interact, so at that level of proficiency it's not clear whether
hiding them really helps. And I'm now playing with abstract rows,
which makes the decision even less clear...

Jacques Garrigue