Polymorphic Data Types, Objects, Modules and Functors: is it too.much.? Sylvain Boulmé, Thérèse Hardin, Renaud Rioboo
To cite this version:
Sylvain Boulmé, Thérèse Hardin, Renaud Rioboo. Polymorphic Data Types, Objects, Modules and Functors: is it too.much.?. [Research Report] lip6.2000.014, LIP6. 2000. hal-02548309
HAL Id: hal-02548309 https://hal.archives-ouvertes.fr/hal-02548309 Submitted on 20 Apr 2020
HAL is a multi-disciplinary open access L’archive ouverte pluridisciplinaire HAL, est archive for the deposit and dissemination of sci- destinée au dépôt et à la diffusion de documents entific research documents, whether they are pub- scientifiques de niveau recherche, publiés ou non, lished or not. The documents may come from émanant des établissements d’enseignement et de teaching and research institutions in France or recherche français ou étrangers, des laboratoires abroad, or from public or private research centers. publics ou privés.
Polymorphic Data Types Ob jects Mo dules and
Functors is it to o much
S Boulm e T Hardin R Riob o o
March
Abstract
Abstraction is a p owerful to ol for developers and it is o ered by numerous features
such as p olymorphism classes mo dules and functors A working programmer
may b e confused with this abundance We develop a computer algebra library which is
b eing certi ed Rep orting this exp erience made with a language Ocaml o ering all
these features we argue that they are all needed together We compare several ways
of using classes to represent algebraic concepts trying to follow as close as p ossible
mathematical sp eci cation Then we show how to combine classes and mo dules to
pro duce co de having very strong typing prop erties Currently this library is made of
one hundred units of functional co de and b ehaves faster than analogous ones such as
Axiom