* [Caml-list] [ANN] exenum.0.6: exhaustive enumerations for datatypes
@ 2013-11-12 14:00 Didier Le Botlan
0 siblings, 0 replies; only message in thread
From: Didier Le Botlan @ 2013-11-12 14:00 UTC (permalink / raw)
To: caml-list
Hi list,
Let me introduce exenum, the "exhaustive enumeration"(1) library.
<shameless teaser>
You all probably wonder what "the" 42,000th lambda-term is. It happens
to be (((fun x -> v) (v v)) ((x x) v)) (2)
As for "the" 10^400th lambda-term, it is
((((((fun x -> (v v)) ((fun v -> y) (fun x -> x))) ((fun v -> (x
x))[...and 20 more lines...]
(1) where "exhaustive" means that every value (of the given datatype) is
eventually enumerated.
(2) where variables are restricted to "x", "y", "u", "v".
</teaser>
In short :
- exenum makes it easy to build enumerations for any datatype.
- Very handy to carry out intensive unit testing
(Students' motto : "If you know your code is unsound, test it anyway, it
might work by accident").
- exenum is inspired by FEAT for Haskell.
- Impress coq's users with statements such as: "I have successfully
checked my code up to index 17 !"
- Quick overview and API on the homepage:
http://exenum.forge.ocamlcore.org/
- Install with: opam install exenum
* * *
As a side dish, let me mention the oasis- and ocamlbuild-based packaging
I used for this library.
For quite a while, I had been looking for a neat way to pack an ocaml
library, that is:
- Only one main module is "exported" to users (or, say, just a couple
of modules).
- The library may define several internal modules, but they should
remain hidden (that is, as hidden as possible). In particular, they
should not pollute the global module namespace.
I was not able to find satisfactory examples on the net (most likely,
though, I have not searched enough).
Finally, I wrote an _oasis file as follows (excerpt):
## Exported library
Library "exenum"
Path: src/
Modules: ExEnum
BuildDepends: exenum.internals
Install: true
## This library packs internal modules, so that they may not conflict
with anything else.
Library "exenum_internals"
Path: src/
Modules: Convenience
InternalModules: Exen, ExtArray, Parts, Shuffle
FindlibParent: exenum
FindlibName: internals
Pack: true
Thus, the internal modules are all packed in an ocaml module
"Exenum_Internals" (the -pack option of ocamlc). Only the main module
"ExEnum" and "Exenum_internals" are visible at top-level.
See details at the bottom of:
http://exenum.forge.ocamlcore.org/
--
D. Le Botlan
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2013-11-12 14:00 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-12 14:00 [Caml-list] [ANN] exenum.0.6: exhaustive enumerations for datatypes Didier Le Botlan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox