Version française
Home     About     Download     Resources     Contact us    
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: -- (:)
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
should.)

	- Andreas

-- 
Andreas Rossberg, rossberg@ps.uni-sb.de

"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 caml-list-request@inria.fr.  Archives: http://caml.inria.fr