From d0c858ab9dd84dfd6aac671283b5adf8e1756911 Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Mon, 11 Feb 2013 11:52:54 +0100 Subject: [PATCH] update of README; in Makefile, only build tests if required, because it requires ocaml4 --- Makefile | 5 ++++- README.md | 18 ++++++++++++++---- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 4ec85d7..2efe05b 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,10 @@ LIB = $(addprefix _build/, $(TARGETS)) INSTALL = $(LIB) sequence.mli all: - ocamlbuild tests.native $(TARGETS) $(DOC) + ocamlbuild $(TARGETS) $(DOC) + +tests: + ocamlbuild tests.native install: all ocamlfind install $(NAME) META $(INSTALL) diff --git a/README.md b/README.md index 77e3068..57658c8 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,15 @@ Sequence ======== Simple sequence abstract datatype, intented to transfer a finite number of -elements from one data structure to another. It also provides a tiny -library for S-expressions, convertible to streams of tokens, and conversely. +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 ===== @@ -13,8 +20,11 @@ You need OCaml, say OCaml 3.12 or OCaml 4.0. $ make To see how to use it, check `tests.ml`. `sequence.ml` has a few examples of how to convert -data structures into sequences, and conversely. The module `sexpr.mli` exposes the interface -of the S-expression library. +data structures into sequences, and conversely. + +The module `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 `sexpr.ml`. License =======