From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id TAA26412 for caml-redistribution; Wed, 19 May 1999 19:45:18 +0200 (MET DST) Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id BAA11071 for ; Tue, 18 May 1999 01:55:21 +0200 (MET DST) Received: from graphics.lcs.mit.edu (graphics.lcs.mit.edu [18.24.2.30]) by nez-perce.inria.fr (8.8.7/8.8.7) with ESMTP id BAA16929 for ; Tue, 18 May 1999 01:55:20 +0200 (MET DST) Received: from turpentine.lcs.mit.edu (turpentine.lcs.mit.edu [18.24.2.91]) by graphics.lcs.mit.edu (8.9.0/8.9.0) with ESMTP id TAA14156 for ; Mon, 17 May 1999 19:53:40 -0400 (EDT) Received: from localhost (b-db@localhost) by turpentine.lcs.mit.edu (8.9.0/8.9.0) with SMTP id TAA40711 for ; Mon, 17 May 1999 19:53:39 -0400 (EDT) Date: Mon, 17 May 1999 19:53:39 -0400 (EDT) From: Benoit deBoursetty Reply-To: Benoit deBoursetty To: Caml mailing list Subject: modification to the O'CaML sets.ml In-Reply-To: <199905141108.NAA02693@pauillac.inria.fr> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: weis Those who need the 1-type-variable polymorphic set data structure I've talked of recently will find this file useful : http://www.polytechnique.fr/eleves/1996/boursetty/polyset.ml !! Warning !! The URL will stop being effective at the beginning of July. Would anyone download this very small file to a more persistent website ? It is a small modification to the original set.ml In fact, only type declarations are modified, the code is just the same. Doesn't this mean that the compiler polymorphism handling could be enhanced ? In the case of sets I feel like declaring something like (* This is not valid o'caml *) module type 'a Comparison = sig val compare : 'a -> 'a -> int end and a functor from modules with type 'a Comparison to modules with type (* Neither is this *) module type 'a Set = sig type 'a t val empty: 'a t val is_empty: 'a t val mem: 'a -> 'a t -> bool val add: 'a -> 'a t -> 'a t . . . end That is only my personal, programmer's point of view. I don't know of the typing problems behind it. Benoit de Boursetty