Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Benoit deBoursetty <b-db@graphics.lcs.mit.edu>
To: Caml mailing list <caml-list@inria.fr>
Subject: modification to the O'CaML sets.ml
Date: Mon, 17 May 1999 19:53:39 -0400 (EDT)	[thread overview]
Message-ID: <Pine.SGI.3.93.990517183050.59952A-100000@turpentine.lcs.mit.edu> (raw)
In-Reply-To: <199905141108.NAA02693@pauillac.inria.fr>

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




           reply	other threads:[~1999-05-19 17:45 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <199905141108.NAA02693@pauillac.inria.fr>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.SGI.3.93.990517183050.59952A-100000@turpentine.lcs.mit.edu \
    --to=b-db@graphics.lcs.mit.edu \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox