{"id":16613181,"url":"https://github.com/c-cube/choice","last_synced_at":"2025-10-29T18:31:00.308Z","repository":{"id":9037794,"uuid":"10799819","full_name":"c-cube/choice","owner":"c-cube","description":"Choice operator in OCaml, providing a backtracking monad","archived":false,"fork":false,"pushed_at":"2022-01-26T17:09:46.000Z","size":63,"stargazers_count":25,"open_issues_count":2,"forks_count":6,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-07T21:35:32.174Z","etag":null,"topics":["backtracking","continuations","monad","ocaml","pure"],"latest_commit_sha":null,"homepage":"https://c-cube.github.io/choice/","language":"OCaml","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/c-cube.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-06-19T16:50:56.000Z","updated_at":"2025-01-09T09:36:01.000Z","dependencies_parsed_at":"2022-08-27T12:21:23.193Z","dependency_job_id":null,"html_url":"https://github.com/c-cube/choice","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c-cube%2Fchoice","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c-cube%2Fchoice/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c-cube%2Fchoice/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c-cube%2Fchoice/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/c-cube","download_url":"https://codeload.github.com/c-cube/choice/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238864424,"owners_count":19543537,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["backtracking","continuations","monad","ocaml","pure"],"created_at":"2024-10-12T01:46:23.577Z","updated_at":"2025-10-29T18:30:59.990Z","avatar_url":"https://github.com/c-cube.png","language":"OCaml","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Choice [![build](https://github.com/c-cube/choice/actions/workflows/main.yml/badge.svg)](https://github.com/c-cube/choice/actions/workflows/main.yml)\n\nChoice monad. See\n[the Haskell library](http://hackage.haskell.org/packages/archive/logict/0.2.3/doc/html/Control-Monad-Logic.html)\nor [this paper](http://homes.sice.indiana.edu/ccshan/logicprog/LogicT-icfp2005.pdf)\n\nSee [online documentation](https://c-cube.github.io/choice/).\n\n## Example\n\n```ocaml\n\u003e #require \"choice\";;\n\u003e open Choice.Infix;;\n\u003e let c = Choice.lift2 (fun x y -\u003e x,y)\n  (Choice.of_list [1;2;3;4]) (Choice.of_list [\"1\"; \"3\"]);;\nval c : (int * string) Choice.t = \u003cabstr\u003e\n\u003e let c2 = Choice.filter c (fun (x,y) -\u003e x = int_of_string y);;\nval c2 : (int * string) Choice.t = \u003cabstr\u003e\n\u003e let c3 = Choice.take 2 c2;;\nval c3 : (int * string) Choice.t = \u003cabstr\u003e\n\u003e Choice.run_n 4 c3;;\n- : (int * string) list = [(3, \"3\"); (1, \"1\")]\n```\n\n## Build\n\nYou need OCaml \u003e= 4.03.0 and dune.\n\n    $ make\n    $ make install\n\n## License\n\nThe code is free, released under the BSD-2 license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fc-cube%2Fchoice","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fc-cube%2Fchoice","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fc-cube%2Fchoice/lists"}