Deriving a polymorphic mapping module

From: Mike Spivey (
Date: Thu Dec 09 1999 - 12:20:02 MET

From: Mike Spivey <>
Subject: Deriving a polymorphic mapping module
Message-Id: <>
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


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