Simple iterator abstract datatype, intended to iterate efficiently on collections while performing some transformations.
Find a file
Simon Cruanes 855428b2e9 more doc
2013-10-20 21:05:26 +02:00
examples moved example stuff in examples/ 2013-03-08 16:18:30 +01:00
tests optimized MList, with twice as fast insertion (on big tests); 2013-03-11 00:54:28 +01:00
.gitignore generation of sequence.install file 2013-10-17 14:29:55 +02:00
.merlin basic building blocks for testing 2013-03-08 16:18:52 +01:00
.ocamlinit .ocamlinit file 2013-08-28 15:02:06 +02:00
CHANGELOG version 0.3.4 2013-03-08 15:31:48 +01:00
LICENSE Add README and license 2013-01-27 23:45:30 +01:00
Makefile fixed makefile after merge 2013-10-17 14:56:09 +02:00
META version 0.3.4 2013-03-08 15:31:48 +01:00
README.md push documentation to private server 2013-05-28 14:02:55 +02:00
sequence.ml bugfix in Sequence.take 2013-10-03 21:54:51 +02:00
sequence.mli more doc 2013-10-20 21:05:26 +02:00
sequence.odocl generate documentation 2013-01-28 01:08:15 +01: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.