Deriving a polymorphic mapping module

From: Mike Spivey (mike@comlab.ox.ac.uk)
Date: Thu Dec 09 1999 - 12:20:02 MET


From: Mike Spivey <mike@comlab.ox.ac.uk>
To: caml-list@inria.fr
Subject: Deriving a polymorphic mapping module
Message-Id: <E11w1cA-0001uZ-00@spivey.oriel.ox.ac.uk>
Date: Thu, 9 Dec 1999 11:20:02 +0000

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'.



This archive was generated by hypermail 2b29 : Sun Jan 02 2000 - 11:58:29 MET