Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] tpyping question
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: skaller <skaller@o...>
Subject: Re: [Caml-list] tpyping question
On Mon, 2003-08-11 at 12:46, Jacques Garrigue wrote:
> From: skaller <skaller@ozemail.com.au>
> 
> > type x = [`A | `B of int | `V of float];;
> > let g (a:x) = a;;
> > let f a = match a with
> > | `A -> g a
> > (* | `B _ *) | _ -> g a;;
> > 
> > Compiles fine, but gives an error if the comments are
> > removed.

> On the other hand, this code is meaningless, as _ is more general
> than `B _, and the order of or-patterns is not significant.

Yup. However, meaningless is not the same as wrong.
The extra case arose because I had a bug and 
wanted to print a diagnostic. When I commented the
print out, I got the error: I wanted to leave the
pattern match there as a stub.

I have had some other perplexing problems with
multiple tags, perhaps if you fix the above problem
they'll go a way .. sorry, I worked around them
so don't have an example at the moment.


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