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
[Caml-list] classes vs modules
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2001-05-28 (08:24)
From: Andreas Rossberg <rossberg@p...>
Subject: Re: [Caml-list] classes vs modules
Markus Mottl wrote:
> Out of curiousity, would it be unsound to allow functions like the
> following:
>   let f (cmp : 'a -> 'a -> bool) =
>     let module SomeSet =
>       Set.Make (struct type t = 'a let compare = cmp end) in
>     ()

It would be sound. Actually, Moscow ML allows it as an extension to SML.
(Though I am not completely sure whether OCaml's odd semantics of type
variables in annotations makes a difference. But I do not see how it

	- Andreas

Andreas Rossberg,

"Computer games don't affect kids.
 If Pac Man affected us as kids, we would all be running around in
 darkened rooms, munching pills, and listening to repetitive music."
To unsubscribe, mail  Archives: