The Lemonade project aims at providing a comprehensive standard monad library for OCaml.
It implements the following monads:
- Lemonade_Continuation for continuation passing style programming.
- Lemonade_Lazy for lazy computations.
- Lemonade_List for computations yielding several possible results.
- Lemonade_Maybe for computations yielding zero or one result.
- Lemonade_Ok for computations failing with context information, as in yojson.
- Lemonade_Reader for computations explicitly depending on some environment.
- Lemonade_Retry for retryable computations.
- Lemonade_State for computations modifying a state.
- Lemonade_Success for computations failing with context information.
- Lemonade_Writer for computations writing a log book.
It is easy to install Lemonade using opam and its pinning feature. In a shell visiting the repository, say
% autoconf
% opam pin add lemonade .
It is also possible to install Lemonade manually. The installation procedure is based on the portable build system BSD Owl Scripts written for BSD Make.
-
Verify that prerequisites are installed:
-
Get the source, either by cloning the repository or by exploding a distribution tarball.
-
Optionally run
autoconf
to produce a configuration script. This is only required if the script is not already present. -
Run
./configure
, you can choose the installation prefix with--prefix
. -
Run
make build
. -
Optionally run
make test
to test your build. -
Finally run
make install
.
Depending on how BSD Make is called on your system, you may need to
replace make
by bsdmake
or bmake
in steps 5, 6, and 7.
The GNU Make program usually give up the ghost, croaking
*** missing separator. Stop.
when you mistakingly use it instead of
BSD Make.
Step 7 requires that you can su -
if you are not already root
.
Lemonade is free software: copying it and redistributing it is very
much welcome under conditions of the CeCILL-B licence
agreement, found in the COPYING file of the
distribution, apart from the file ppx/ppx_lemonade.ml
which derives
from the file ppx_lwt_ex.ml
and is licensed under the LGPL version
2.1 with the additional exemption that compiling, linking, and/or
using OpenSSL is allowed.
Michael Grünewald in Aachen, on November 12, 2015