English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

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, 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