Version française
Home     About     Download     Resources     Contact us    
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: -- (:)
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.

					Regards,
					C.S.C.

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

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