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 (08:52)
From: Richard Jones <rich@a...>
Subject: Re: [Caml-list] Re: Void type?
On Mon, Jul 30, 2007 at 07:13:21PM -0400, Brian Hurt wrote:
> So how do I use that module and say, in the type system, "I will never 
> pass in a b"?  This is where the void type comes in.  I can declare:
> module Myreq = struct
> 	type a = whatever;;
> 	type b = void;;
> end;;
> module Myexample = Example(Myreq);;

Similar to Markus Mottl's practical example.  [I'm so glad that we're
getting practical uses out of this discussion ...]

The question is, which void type definition do you use?

  type void


  type void = { v: 'a. 'a }

It seems to me that your example could use either.  Markus uses the
second definition, but I don't understand particularly why he couldn't
use either.


Richard Jones
Red Hat