exenumversion

Build efficient enumerations for datatypes. Inspired by Feat for Haskell.

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: https://github.com/lebotlan/ocaml-exenum 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)))

AuthorDidier Le Botlan <github.lebotlan@dfgh.net>
LicenseMIT
Published
Homepagehttps://github.com/lebotlan/ocaml-exenum
Issue Trackerhttps://github.com/lebotlan/ocaml-exenum/issues
MaintainerDidier Le Botlan <github.lebotlan@dfgh.net>
Dependencies
Optional dependencies
Conflicts
Source [http] https://github.com/lebotlan/ocaml-exenum/archive/v0.84.0.tar.gz
sha256=d1d0f10e592895ecce69fe31cacd7572077dff4f960a6f16d223f56274be4a8f
md5=f4d7c0bf20a74918f68919ff28739b4f
Edithttps://github.com/ocaml/opam-repository/tree/master/packages/exenum/exenum.0.84/opam
No package is dependent