package choice

All checked builds pass
  1. Overview
  2. Docs
Choice monad, for easy backtracking

Install

dune-project
 Dependency

Authors

Maintainers

Sources

v0.4.tar.gz
md5=90f12307c085deba053997bded3a4b84
sha512=9078b75ba63ae5afcbea80e7b9838c721b69e95190f787f399e18dfbd39735abdf0c8b22cfae34c6801475f542d530bee5f0665284c4df9a4b14c4fb638a3188

Description

Added to opam-repository:

README

Choice build status

Choice monad. See the Haskell library or this paper

See online documentation.

Example

> #require "choice";;
> open Choice.Infix;;
> let c = Choice.lift2 (fun x y -> x,y)
  (Choice.of_list [1;2;3;4]) (Choice.of_list ["1"; "3"]);;
val c : (int * string) Choice.t = <abstr>
> let c2 = Choice.filter c (fun (x,y) -> x = int_of_string y);;
val c2 : (int * string) Choice.t = <abstr>
> let c3 = Choice.take 2 c2;;
val c3 : (int * string) Choice.t = <abstr>
> Choice.run_n 4 c3;;
- : (int * string) list = [(3, "3"); (1, "1")]

Build

You need OCaml >= 4.03.0 and dune.

    $ make
$ make install

License

The code is free, released under the BSD-2 license.

Dependencies (3)

  1. seq
  2. ocaml >= "4.03.0"
  3. dune >= "1.1"

Dev Dependencies (3)

  1. odoc with-doc
  2. gen with-test
  3. ounit with-test

Optional Dependencies

None

Used by

None

Conflicts

None

Build status

Results of building choice with each compiler on check.ci.ocaml.org, run of against opam-repository 7cdc698. All results for this package.

Each result links to its build log. To keep crawlers from overloading the site, build logs require a GitHub sign-in (see ocurrent/opam-health-check). On your first log, GitHub asks you to “Authorize opam-health-check”, the OCurrent app that runs these checks; it sees only your public profile, not your repositories. The sign-in lasts 30 days.

Version OCaml 4.11 OCaml 4.14 OCaml 5.2 OCaml 5.4 OCaml 5.5
0.4 (this version) good good good good good
  • good Package successfully built
  • partial One of the dependencies failed to build
  • bad Package failed to build
  • n/a Package is not available in this environment
  • internal Internal failure