Simple iterator abstract datatype, intended to iterate efficiently on collections while performing some transformations.
Find a file
2014-05-20 22:07:26 +02:00
bench Add a reading bench for persistent sequences. 2014-05-20 22:07:26 +02:00
examples moved example stuff in examples/ 2013-03-08 16:18:30 +01:00
tests cleanup of Infix (removed some operators); 2014-04-16 17:56:54 +02:00
.gitignore use oasis 2014-04-13 21:54:42 +02:00
.merlin removed deprecated Bench and replace it with Benchmark 2014-05-20 21:56:08 +02:00
.ocamlinit .ocamlinit file 2013-08-28 15:02:06 +02:00
_oasis use oasis 2014-04-13 21:54:42 +02:00
_tags add bin_annot 2014-04-24 01:11:46 +02:00
CHANGELOG changelog 2014-05-19 15:12:52 +02:00
configure use oasis 2014-04-13 21:54:42 +02:00
LICENSE Add README and license 2013-01-27 23:45:30 +01:00
Makefile Add a reading bench for persistent sequences. 2014-05-20 22:07:26 +02:00
META use oasis 2014-04-13 21:54:42 +02:00
myocamlbuild.ml use oasis 2014-04-13 21:54:42 +02:00
README.md push documentation to private server 2013-05-28 14:02:55 +02:00
sequence.ml apparently drup doesn't like polymorphic variants 2014-05-19 14:58:11 +02:00
sequence.mldylib use oasis 2014-04-13 21:54:42 +02:00
sequence.mli Sequence.persistent_lazy added, for caching without upfront cost 2014-05-19 14:51:12 +02:00
sequence.mllib use oasis 2014-04-13 21:54:42 +02:00
sequence.odocl use oasis 2014-04-13 21:54:42 +02:00
setup.ml use oasis 2014-04-13 21:54:42 +02:00

Sequence

Simple sequence abstract datatype, intended to transfer a finite number of elements from one data structure to another. Some transformations on sequences, like filter, map, take, drop and append can be performed before the sequence is iterated/folded on.

Sequence is not designed to be as general-purpose or flexible as, say, Batteries' Enum.t. Rather, it aims at providing a very simple and efficient way of iterating on a finite number of values, only allocating (most of the time) one intermediate closure to do so. For instance, iterating on keys, or values, of a Hashtbl.t, without creating a list.

Build

You need OCaml, say OCaml 3.12 or OCaml 4.0.

$ make

If you have OUnit installed, you can build and run tests with

$ make tests
$ ./run_tests.native

If you have Bench installed, you can build and run benchmarks with

$ make benchs
$ ./benchs.native

To see how to use the library, check the examples directory. tests.ml has a few examples of how to convert basic data structures into sequences, and conversely.

Examples

The module examples/sexpr.mli exposes the interface of the S-expression example library. It requires OCaml>=4.0 to compile, because of the GADT structure used in the monadic parser combinators part of examples/sexpr.ml.

Documentation

See the online API.

License

Sequence is available under the BSD license.