Designing a Generic Graph Library Using ML Functors.
Sylvain Conchon, Jean-Christophe Filliâtre, Julien Signoles · Trends in Functional Programming · 2007
This paper details the design and implementation of OCAMLGRAPH, a highly generic graph library for the programming language OCAML. This library features a large set of graph data structures—directed or undirected, with or without labels on vertices and edges, as persistent or mutable data structures, etc.—and a large set of graph algorithms. Algorithms are written independently from graph data structures, which allows combining user data structure (resp. algorithm) with OCAMLGRAPH algorithm (resp. data structure). Genericity is obtained through massive use of the OCAML module system and its functions, the so-called functors.