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-08-01 (16:23)
From: Markus Mottl <markus.mottl@g...>
Subject: Re: [Caml-list] Re: Void type?
On 8/1/07, Tom <> wrote:
> I am still not convinced about the usability of the void type... Why simply
> not declare type b as abstract?
> module Myreq = struct
>         type a = whatever
>         type b
> end
> Essentially, it means the same, just less typing.

Less typing in the type definition, but more typing handling a
function or match branch that makes use of a value of type b.  You'd
either have to raise an exception there, or do something unsafe.  The
"void"-solution is much cleaner.


Markus Mottl