Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Void type?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-07-31 (15:27)
From: Markus Mottl <markus.mottl@g...>
Subject: Re: [Caml-list] Re: Void type?
On 7/31/07, Chris King <> wrote:
> Personally I would use the second.  That way, when you come across a
> void value (say, in pattern matching a variant), you can take care of
> that match case without resorting to "assert false" (whether directly
> or via void_elim):

This is the exact reason why I used this solution: the compiler
essentially proves to you that this branch will never be taken,
because it is impossible to create a value that is a member of any
type (without black magic, that is).  This is important if you want to
check your code for uncaught exceptions, especially if you eventually
want to do this mechanically.


Markus Mottl