{"id":15766904,"url":"https://github.com/ryloric/bs-list","last_synced_at":"2025-10-24T10:52:51.476Z","repository":{"id":143866614,"uuid":"179671260","full_name":"ryloric/bs-list","owner":"ryloric","description":"BuckleScript bindings for funkia/list","archived":false,"fork":false,"pushed_at":"2019-04-05T12:25:46.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2024-10-11T13:37:16.366Z","etag":null,"topics":["bucklescript-bindings","ocaml","reasonml"],"latest_commit_sha":null,"homepage":"","language":"OCaml","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ryloric.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-04-05T11:43:25.000Z","updated_at":"2019-04-05T12:25:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"dca364ff-80cf-4690-8ba1-6190132e365c","html_url":"https://github.com/ryloric/bs-list","commit_stats":{"total_commits":3,"total_committers":1,"mean_commits":3.0,"dds":0.0,"last_synced_commit":"0cf9751fcc2b0be8b49eb78a69036588ccea0268"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryloric%2Fbs-list","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryloric%2Fbs-list/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryloric%2Fbs-list/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryloric%2Fbs-list/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ryloric","download_url":"https://codeload.github.com/ryloric/bs-list/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246458000,"owners_count":20780677,"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":["bucklescript-bindings","ocaml","reasonml"],"created_at":"2024-10-04T13:03:19.125Z","updated_at":"2025-10-24T10:52:51.390Z","avatar_url":"https://github.com/ryloric.png","language":"OCaml","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bs-list\n\n  Bucklescript bindings to [funkia/list](https://github.com/funkia/list)\n\n  Currently compiles to function-application-style in javascript. \n\n## Install \n```\nnpm i -s bs-list\n```\nadd `bs-list` to `bs-dependencies` in `bsconfig.json`\n\n## Sample Usage \n\n``` OCaml\nlet () = \n  let open Flist in \n  lst [|1;2;3|]\n  |\u003e map ~f:(fun x -\u003e x + 1)\n  |\u003e adjust 2 ~f:(fun x -\u003e x * 2)\n  |\u003e foldl ~f:(fun x acc -\u003e x * acc) 0\n  |\u003e Js.log\n```\n\nPlease look at `list`'s [docs](https://github.com/funkia/list/README.md) for all the available functions.\n\n## Why\n\nIn an ideal scenario, we should be able to write code using OCaml's `'a list` type in the usual way,using recursion and pattern matching, and then make `bsc` compile it down to whatever representation \nwe want `'a list` to have in Javascript. In a way we are mapping idiomatic OCaml's `'a list` api to whatever is our preffered/efficient js representation. \n\nUnfortunately, `bsc` doesn't let us do that at the moment, it has it's own representation of `'a list` which is a two element array of `[head, tail]` where `tail` is another array, with empty list being `0`. It's not efficient, but you get to use pattern matching. The other option is to use Js.Array, but the api is lacking, doesn't have any of the nice things `'a list` has. \n\nUsing `funkia/list` is a compromise, it has a pretty comprehensive api like `'a list` but can't use pattern matching, is very efficient like `Js.Array` but has a nicer api.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryloric%2Fbs-list","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fryloric%2Fbs-list","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryloric%2Fbs-list/lists"}