package exenum
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=fb00581a24543ef3211ad90c079a421c143c823481b3b8d6170a5a4899b11f2e
md5=31ec3baafaff2fbd49eb420728fbf6db
Description
The exenum library offers constructors to build enumerations for datatypes, that is, functions from (arbitrarily large) integers to values. Such enumerations are typically used for unit testing. The library is efficient: the n-th element of an enumeration is returned without having computed the (n-1) previous elements. Complexity is in log(n), except for some pathological datatypes. See the homepage for details: http://exenum.forge.ocamlcore.org/ Inspired by Feat: Functional Enumeration of Algebraic Types, by Duregard, Jansson, Wang, Chalmers University. As an example, consider the following datatype: type term = Var of string | App of term * term | Lambda of string * term Using exenum, one may easily generate zillions of different lambda-terms. In our specific example, term number 2000000000000 happens to be ((((x v) (fun u -> y)) ((fun u -> y) (fun y -> y))) (((x v) (fun u -> v)) (fun u -> y))) Efficiency: computing lambda-term number 1E200 is instantaneous (on an antique Intel Centrino).
Published: 14 Dec 2015
Dependencies (4)
- num
-
ocamlbuild
build
-
ocamlfind
build
-
ocaml
< "5.0.0"
Dev Dependencies
None
Used by (1)
-
cryptodbm
< "0.84.2"
Conflicts
None