caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Mike Spivey <mike@comlab.ox.ac.uk>
To: caml-list@inria.fr
Subject: Deriving a polymorphic mapping module
Date: Thu, 9 Dec 1999 11:20:02 +0000	[thread overview]
Message-ID: <E11w1cA-0001uZ-00@spivey.oriel.ox.ac.uk> (raw)

Given the functor-based Map module in the standard library of OCaml,
is there any way of defining polymorphic mappings, like the old module
provided with Caml Light, that has a polymorphic interface and always
uses the polymorphic compare function?  If not, then this seems to me
to be a weakness in the module system.

Looking at the Hashtbl module, I see that it in fact contains two
completely independent implementations of hash tables, one polymorphic
and one using a functor, so I guess the answer is 'no'.

-- Mike Spivey

----8<--------8<--------8<--------8<--------8<--------8<--------8<----

Mauvaise traduction francaise:

Etant donne la module Map du bibliotheque standardise de OCaml,
existe-t-il aucune facon de definer des mappings polymorphes, comme
l'ancien module map de Caml Light, qui a une interface polymorphe, et
utilise toujours la fonction compare polymorphe?  Si ca n'existe pas,
ce me semble une faiblesse de la systeme de modules.

En regardant la module Hashtbl, je vois qu'il contient en effet deux
implantations des hash tables, l'une polymorphe et l'autre basee sur
un functor.  Donc, je crois que la reponse est 'non'.




             reply	other threads:[~1999-12-09 20:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-12-09 11:20 Mike Spivey [this message]
1999-12-09 21:50 ` Benoit de Boursetty

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=E11w1cA-0001uZ-00@spivey.oriel.ox.ac.uk \
    --to=mike@comlab.ox.ac.uk \
    --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;
as well as URLs for NNTP newsgroup(s).