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
[Caml-list] Getting rid of impossible polymorphic variant tags from infered types
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-03-03 (10:40)
From: Claudio Sacerdoti Coen <sacerdot@c...>
Subject: Re: [Caml-list] Getting rid of impossible polymorphic variant tags from infered types
> But this gives me the worst of both worlds, no?

 It is a bit heavyweight, but not too bad.

> I have to define a function 
> f_r for every type I might want to use in place of foo,

 Wasn't it your goal to define f_r in the first place?

> *and* the type checker can still see the `Fnord that isn't there:

 You are right here. Indeed, you should define your own case-analysis
 operator (whose principal argument would have type [> `NoFnord] foo)
 and use it in place of the match ... with.
 Withouth proper syntax sugar the code becomes clumsy.
 This is a drawback of phantom types.

> So the "| #foo_flat as v -> v :: init" version seems to be the only 
> workable solution.


Real name: Claudio Sacerdoti Coen
PhD Student in Computer Science at University of Bologna
E-mail: sacerdot@cs.unibo.it

To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners