diff --git a/.babelrc b/.babelrc
deleted file mode 100644
index 76ac9c5fc..000000000
--- a/.babelrc
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "presets": [
- "next/babel"
- ],
- "plugins": [
- ]
-}
diff --git a/.env b/.env
new file mode 100644
index 000000000..431fdc073
--- /dev/null
+++ b/.env
@@ -0,0 +1,2 @@
+VERSION_LATEST="v11.0.0"
+VERSION_NEXT="v12.0.0"
\ No newline at end of file
diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 000000000..b17d448d5
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1,4 @@
+*.res linguist-language=ReScript
+*.resi linguist-language=ReScript
+
+/public/playground-bundles/** binary linguist-vendored
diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml
new file mode 100644
index 000000000..2931b7fef
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/config.yml
@@ -0,0 +1,20 @@
+blank_issues_enabled: false
+contact_links:
+ - name: 🚀 rescript-compiler
+ url: https://github.com/rescript-lang/rescript/issues
+ about: Please report problems about the ReScript compiler, build system and tools here.
+ - name: 💻 rescript-vscode
+ url: https://github.com/rescript-lang/rescript-vscode/issues
+ about: VSCode language support, LSP
+ - name: 📦 create-rescript-app
+ url: https://github.com/rescript-lang/create-rescript-app/issues
+ about: ReScript's project generator
+ - name: ⚛️ rescript-react
+ url: https://github.com/rescript-lang/rescript-react/issues
+ about: ReScript bindings to React.js
+ - name: 🌐 rescript-core
+ url: https://github.com/rescript-lang/rescript-core/issues
+ about: New ReScript standard library
+ - name: 💬 ReScript Forum
+ url: https://forum.rescript-lang.org/
+ about: For discussions about ReScript, please visit the official ReScript forum.
diff --git a/.github/ISSUE_TEMPLATE/documentation_issue.md b/.github/ISSUE_TEMPLATE/documentation_issue.md
new file mode 100644
index 000000000..95cb9bae2
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/documentation_issue.md
@@ -0,0 +1,7 @@
+---
+name: 🚨 Documentation issue
+about: Create an issue to help us improve the rescript-lang.org documentation website
+title: ""
+labels: ""
+assignees: ""
+---
diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml
index 9ca8d15b3..ecd03a074 100644
--- a/.github/workflows/pull-request.yml
+++ b/.github/workflows/pull-request.yml
@@ -4,13 +4,15 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v2
- - uses: actions/setup-node@v2
+ - uses: actions/checkout@v4
+ - uses: actions/setup-node@v4
with:
- node-version: 14.x
+ node-version: 20
+ cache: npm
- run: npm ci
- run: npx rescript
- run: npm test
+ - run: npm run ci:format
- name: Format check
run: npx rescript format -check -all
diff --git a/.gitignore b/.gitignore
index b56aab4f3..31b182d6e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,6 +7,7 @@ public/blog/feed.xml
node_modules/
.next/
+out/
index_data/*.json
# Generated via test examples script
@@ -15,14 +16,23 @@ _tempFile.cmj
_tempFile.cmt
# these docs are checked in, but we consider them frozen.
-pages/docs/manual/v8.0.0/
-pages/docs/manual/v9.0.0/
+# pages/docs/manual/v8.0.0/
+# pages/docs/manual/v9.0.0/
.bsb.lock
.merlin
lib/
-.vscode/
.vercel
src/**/*.mjs
+scripts/gendocs.mjs
+scripts/generate_*.mjs
+
+# Generated via generate-llms script
+public/llms/manual/**/llm*.txt
+public/llms/react/**/llm*.txt
+pages/docs/**/**/llms.mdx
+
+public/playground-bundles/
+public/_redirects
diff --git a/.node-version b/.node-version
new file mode 100644
index 000000000..7af24b7dd
--- /dev/null
+++ b/.node-version
@@ -0,0 +1 @@
+22.11.0
diff --git a/.nowignore b/.nowignore
deleted file mode 100644
index 5b3ad333e..000000000
--- a/.nowignore
+++ /dev/null
@@ -1,2 +0,0 @@
-.next/
-node_modules/
diff --git a/.prettierignore b/.prettierignore
new file mode 100644
index 000000000..35fb054b6
--- /dev/null
+++ b/.prettierignore
@@ -0,0 +1 @@
+data/api/**/*.json
diff --git a/.prettierrc b/.prettierrc
new file mode 100644
index 000000000..564d6bf5a
--- /dev/null
+++ b/.prettierrc
@@ -0,0 +1,2 @@
+plugins:
+ - "@prettier/plugin-oxc"
diff --git a/.vscode/extensions.json b/.vscode/extensions.json
new file mode 100644
index 000000000..241f2c935
--- /dev/null
+++ b/.vscode/extensions.json
@@ -0,0 +1,3 @@
+{
+ "recommendations": ["esbenp.prettier-vscode", "chenglou92.rescript-vscode"]
+}
diff --git a/CHANGELOG.md b/CHANGELOG.md
index b84fef4c6..a46ed2ce6 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,5 @@
# Changelog
-
This changelog documents significant changes that caused a new version in the manual, or other related resources.
We don't create a version fork for every minor release, and try to make docs "append only" as much as possible. Usually when we introduce a new feature we add a `since 9.0` annotation to a specific section, and be done with it.
@@ -13,8 +12,7 @@ Here are the notes on major changes we did, and how the version corresponds to s
### latest
-- 9.1 related
- -
+- ## 9.1 related
### v9.0 (v8.3 - v9.0)
@@ -34,5 +32,3 @@ Here are the notes on major changes we did, and how the version corresponds to s
### v8.0.0 (v6 - v8.3)
- Docs with Reason / OCaml syntax before the new syntax
-
-
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index fb223a8fc..d80d2ea86 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -6,8 +6,8 @@ Please make sure to check out our [Code of Conduct](CODE_OF_CONDUCT.md) and make
## Ways to contribute
-- Writing docs for the manual (Check for issues that are marked with a [`manual`](https://github.com/reason-association/rescript-lang.org/issues?q=is%3Aissue+is%3Aopen+label%3A"manual") and [`help wanted`](https://github.com/reason-association/rescript-lang.org/issues?q=is%3Aissue+is%3Aopen+label%3A"help+wanted") tag)
-- Joining in discussions on our [issue tracker](https://github.com/reason-association/rescript-lang.org/issues)
+- Writing docs for the manual (Check for issues that are marked with a [`manual`](https://github.com/rescript-lang/rescript-lang.org/issues?q=is%3Aissue+is%3Aopen+label%3A"manual") and [`help wanted`](https://github.com/rescript-lang/rescript-lang.org/issues?q=is%3Aissue+is%3Aopen+label%3A"help+wanted") tag)
+- Joining in discussions on our [issue tracker](https://github.com/rescript-lang/rescript-lang.org/issues)
- Give feedback for improvements (incomplete / missing docs, bad wording,
search user experience / design, etc.)
- Advanced: Help building platform features (design system, automatic testing, markdown parsing, etc.)
@@ -16,7 +16,7 @@ Please make sure to check out our [Code of Conduct](CODE_OF_CONDUCT.md) and make
### Find an issue
-Before you start any work or submit any PRs, make sure to check our [issue tracker](https://github.com/reason-association/rescript-lang.org/issues) for any issues or discussions on the topic.
+Before you start any work or submit any PRs, make sure to check our [issue tracker](https://github.com/rescript-lang/rescript-lang.org/issues) for any issues or discussions on the topic.
If you can't find any relevant issues, feel free to create a new one to start a discussion. We usually assign issues to a responsible person to prevent confusion and duplicate work, so always double check if an issue is currently being worked on, or talk to the current assignee to take over the task.
@@ -24,15 +24,15 @@ If you can't find any relevant issues, feel free to create a new one to start a
The project follows very specific goals and tries to deliver the highest value with the least amount of resources. Please help us focus on the tasks at hand and don't submit any code / bigger refactorings without any proper discussion on the issue tracker. Otherwise your PR might not be accepted!
-If you need inspiration on what to work on, you can check out issues tagged with [`good first issue`](https://github.com/reason-association/rescript-lang.org/issues?q=is%3Aissue+is%3Aopen+label%3A"good+first+issue") or [`help wanted`](https://github.com/reason-association/rescript-lang.org/issues?q=is%3Aissue+is%3Aopen+label%3A"help+wanted").
+If you need inspiration on what to work on, you can check out issues tagged with [`good first issue`](https://github.com/rescript-lang/rescript-lang.org/issues?q=is%3Aissue+is%3Aopen+label%3A"good+first+issue") or [`help wanted`](https://github.com/rescript-lang/rescript-lang.org/issues?q=is%3Aissue+is%3Aopen+label%3A"help+wanted").
### Discuss an issue
We really appreciate all input from users, community members and potential contributors. Please make sure to consider the other person's opinion and don't assume any common knowledge.
-**Most importantly: Keep it professional and be nice to each other**
+**Most importantly: Keep it professional and be nice to eachother**
-There might be situations where others don't understand a proposed feature or have different opinions on certain writing styles. That's fine, discussions are always welcome! Communicate in clear actionables, make your plans clear and always stick to the original topic.
+There might be situations where others don't understand a proposed feature or have different opinions on certain writing styles. That's fine, discussions are always welcome! Communicate in clear actionables, make your plans clear and always to stick to the original topic.
If other contributors disagree with certain proposals and don't change their mind after longer discussions, please don't get discouraged when an issue gets closed / postponed. Everyone tries their best to make the platform better, and to look at it in another perspective: Closed issues are also a highly valuable resource for others to understand technical decisions later on.
@@ -40,11 +40,11 @@ If other contributors disagree with certain proposals and don't change their min
Open Source development can be a challenge to coordinate, so please make sure to block enough time to work on your tasks and show commitment when taking on some work. Let other contributors know if your time schedule changes significantly, and also let others know if you can't finish a task.
-We value your voluntary work, and of course it's fine to step back from a ticket for any reason (we can also help you if you are getting stuck). Please talk to us in any case, otherwise we might re-assign the ticket to other contributors.
+We value your voluntary work, and of course it's fine to step back from a ticket for any reasons (we can also help you if you are getting stuck). Please talk to us in any case, otherwise we might re-assign the ticket to other contributors.
### Communication Channels
-- [Issue Tracker](https://github.com/reason-association/rescript-lang.org/issues)
+- [Issue Tracker](https://github.com/rescript-lang/rescript-lang.org/issues)
- [ReScript Discourse (General / mostly unrelated discussions)](http://forum.rescript-lang.org)
## Working on the rescript-lang.org
@@ -55,7 +55,7 @@ We try to keep our contribution guidelines to a minimum. Please keep following r
The less code we write, the better. If there's a way to do rendering on the server, or enhance existing markdown files, we prefer that over client-side rendering and external loading.
-We also try to keep our third-party dependencies to a minimum. We use specific frameworks to make things work (`unified`, `remark`, `mdx`, `bs-platform`, etc). Please try to keep a small JS footprint, especially for client side code (to keep the bundle size small).
+We also try to keep our third-party dependencies to a minimum. We use specific frameworks to make things work (`unified`, `remark`, `mdx`, `bs-platform`, etc). Please try to keep a small JS footprint, especially for client side code (to keep the bundle size small).
### Think about the target audience & UX
@@ -66,13 +66,13 @@ Always check if there are any designs for certain UI components and think about
### Technical Writing (Documentation)
- Think and write in a JS friendly mindset when explaining concepts / showing examples.
-- No `foo` examples if somewhat possible. Try to establish practical context in your showcase examples.
+- No `foo` examples if somewhat possible. Try to establish practical context in your show case examples.
- No references to `OCaml`. ReScript is its own language, and we don't rely on external resources of our host language.
- If possible, no references to `Reason` examples / external resources. Our goal is to migrate everything to ReScript syntax.
### Tailwind for CSS Development
-We use [TailwindCSS](https://tailwindcss.com) for our component styling. Check out the [tailwind.config.js](tailwind.config.js) file for configured tailwind features, colors, border-radius values etc.. If you are not familiar with Tailwind, check out existing components for inspiration.
+We use [TailwindCSS](https://tailwindcss.com) for our component styling. Check out the [tailwind.config.js](tailwind.config.js) file for configured tailwind features, colors, border-radius values etc.. If you are not familiar with Tailwind, check out existing components for inspiration.
We sometimes also need to fall back to common css (with tailwind `@apply` directives to enforce our style system). You can find the CSS main entrypoint in [styles/main.css](styles/main.css).
diff --git a/README.md b/README.md
index 60b62b0c2..7837c53ad 100644
--- a/README.md
+++ b/README.md
@@ -1,22 +1,21 @@
-[](CODE_OF_CONDUCT.md)
-
-
-
# rescript-lang.org
+[](CODE_OF_CONDUCT.md)
+
This is the official documentation platform for the [ReScript](https://rescript-lang.org) programming language.
-**Please report any technical issues with ReScript to the [compiler repository](https://github.com/rescript-lang/rescript-compiler).**
+**Please report any technical issues with ReScript to the [compiler repository](https://github.com/rescript-lang/rescript).**
**In case you are missing some specific documentation:**
+
- Some language / compiler feature may not be documented yet
- Create an issue to let us know what you are missing
- In case you want to contribute missing docs, please refer to our [Contribution section](#contributing)
## System Requirements
-- `node@16.x` or higher (for ES6 module compat)
-- `npm@7` or higher (package-lock v2)
+- `node@20` or higher
+- `npm@10` or higher
## Setup
@@ -27,10 +26,7 @@ npm i
# Initial build
npx rescript
-# Only needed for initial clone (or content H2 changes)
-npm run update-index
-
-# Build the index data
+# Build the index data. Only needed for initial clone (or content H2 changes)
npm run update-index
# In a new tab
@@ -42,7 +38,7 @@ open localhost:3000
In case you want to run ReScript in watchmode:
```sh
-npx rescript build -w
+npx rescript -w
```
## Build Index Data
@@ -82,9 +78,10 @@ build specific pages (file `index_data/x.json` not found).
### Markdown Codeblock Tests
We check the validity of our code examples marked with:
-- `` ```res example `` (ReScript code snippet)
-- `` ```res sig `` (signature)
-- `` ```res prelude `` (ReScript code snippet available for all subsequent code snippets)
+
+- ` ```res example ` (ReScript code snippet)
+- ` ```res sig ` (signature)
+- ` ```res prelude ` (ReScript code snippet available for all subsequent code snippets)
Run the checks with:
diff --git a/_blogposts/2020-08-10-bucklescript-is-rebranding.mdx b/_blogposts/2020-08-10-bucklescript-is-rebranding.mdx
index f924b55eb..fb0d54ca7 100644
--- a/_blogposts/2020-08-10-bucklescript-is-rebranding.mdx
+++ b/_blogposts/2020-08-10-bucklescript-is-rebranding.mdx
@@ -21,6 +21,7 @@ We're pleased to announce that BuckleScript is getting a brand new name: **ReScr
## Community Situation
BuckleScript started with the idea that **JavaScript programmers deserved a great typed language with a fast and lean toolchain**. This idea took root and, over the years, we've gradually accomplished feats such as:
+
- a state of the art compiled JavaScript output that rivals hand-written JS,
- a fast & reliable toolchain much needed in front-end and Node development,
- various JS interop features that spawned an ecosystem of well typed libraries,
@@ -28,6 +29,7 @@ BuckleScript started with the idea that **JavaScript programmers deserved a grea
- [and recently](/blog/bucklescript-8-1-new-syntax), a fresh syntax made by a major contributor of Reason's old syntax.
These developments have attracted many people into our community. But one bigger challenge persisted: newcomers dropped out at the sheer amount of extra incongruent tools and learning overhead from having to understand OCaml concepts, Reason concepts, and BuckleScript's concepts. Take, for example, what's required to make a React app using BuckleScript:
+
- Knowledge of React.
- Knowledge of JS.
- Knowledge of BuckleScript's specific bindings to React (that we've tried hard to keep to a minimum).
@@ -43,6 +45,7 @@ The adoption barrier is real, and it's about time we finally solve it.
## The Rebranding
Today, we'll start to truly unify the various BuckleScript-related projects under the ReScript umbrella. This includes:
+
- The compiler, build system and the new syntax unified under a single installation.
- Doubling down on editor tooling for ReScript usage.
- A single documentation site (this one), which unifies all the docs and greatly trims down on redundant and stale info.
@@ -61,7 +64,7 @@ There's no dedicated name for the syntax anymore. It's simply called the ReScrip
**Will there be a migration script to gradually convert our code to the new syntax?**
-Yes. See our [migration page](/docs/manual/latest/migrate-from-bucklescript-reason). You can mix and match old and new code for a smoother transition.
+Yes. See our [migration page](/docs/manual/v10.0.0/migrate-from-bucklescript-reason). You can mix and match old and new code for a smoother transition.
**Will BuckleScript (now ReScript) break my existing code?**
@@ -99,7 +102,7 @@ The ReScript community will comprise of the majority of the old Reason community
**The new changes make me worried about the future support I'm going to receive from the team.**
-_Retrospective edit, in 2021_: suffice to day that we've been doing well =).
+_Retrospective edit, in 2021_: suffice to say that we've been doing well =).
## Conclusion
diff --git a/_blogposts/2020-08-28-new-rescript-logo.mdx b/_blogposts/2020-08-28-new-rescript-logo.mdx
index 0d40e3903..1e4c275fb 100644
--- a/_blogposts/2020-08-28-new-rescript-logo.mdx
+++ b/_blogposts/2020-08-28-new-rescript-logo.mdx
@@ -15,11 +15,14 @@ ReScript is the evolution and fusion of Reason and BuckleScript. As we're a desi
Here it is!
-
-
-
+
The old Reason and BuckleScript logo had many limitations:
+
- The icons didn't really work well on round Social Media profile images (or round shapes at all).
- There's no guideline on how the logo works inverted, or on colored background.
- The large red rectangle makes it difficult to balance the logo with other elements.
@@ -27,15 +30,21 @@ The old Reason and BuckleScript logo had many limitations:
The new logo addresses all these and more:
-
+
## Creating Meaning Through Simple Shapes
A minimal logo design is achieved by putting aside all distractions while focusing on legibility, meaning and small details like clear lines, interesting perspective and depth.
-
-
-
+
**The letter "r"**, composed of two shapes, is inspired by Albers, a german-born American Bauhaus artist and typographer. An object should be simple, beautiful, functional and accessible for everyone - a statement which applies to ReScript's principles perfectly.
@@ -43,7 +52,7 @@ A minimal logo design is achieved by putting aside all distractions while focusi
**The red app-shaped background** references the vibrant, playful applications our developers are empowered to create with ReScript.
-**The Logotype** ("rescript") complements the brand mark with its clean look and its embrace of technology while retaining a functional look.
+**The Logotype** ("rescript") complements the brand mark with its clean look and its embrace of technology while retaining a functional look.
We'd like to position ReScript to be a community of product-first developers who care about the fit & finish of their work, while keeping an eye on the quality of their engineering. This interplay of design and engineering is a hard-to-achieve but beautifully worthwhile sweet spot that's frequently been missing in the programmer community; our vibrant logo is our renewed symbolic step toward this mission. Come along with us on our journey!
diff --git a/_blogposts/2020-09-25-release-8-3-2.mdx b/_blogposts/2020-09-25-release-8-3-2.mdx
index b092f53d4..2ad89accb 100644
--- a/_blogposts/2020-09-25-release-8-3-2.mdx
+++ b/_blogposts/2020-09-25-release-8-3-2.mdx
@@ -74,7 +74,7 @@ To get the build output, instead of communicating through IPC, we adopted a simp
This makes the editor integration build-system agnostic, it does not need talk to the build system directly.
It also makes our build tool work with other watchers including Facebook's [watchman](https://facebook.github.io/watchman/).
-Watchman is a more scalable watcher tool for some specific platforms and less memory hungry, however, we still need a watchman-client to get the output of triggered job.
+Watchman is a more scalable watcher tool for some specific platforms and less memory hungry, however, we still need a watchman-client to get the output of triggered job.
We write the output to `.compiler.log` per each build, allowing clients to read compiler diagnostics when they want.
## A better algorithm for removing stale outputs
@@ -86,12 +86,12 @@ There are two ways of removing staled artifacts, the second one is introduced in
- Based on live analysis and prebuilt-in knowledge
-We scan `lib/bs` directory and check some dangling cm{i,t,j,ti} files, if it does not exist in
+We scan `lib/bs` directory and check some dangling `cm{i,t,j,ti}` files, if it does not exist in
the current build set, it is considered stale artifacts. If it is `cmt` file, it would trigger some hooks of `genType`, notably -cmt-rm.
- Based on previous build logs
-We store previous compilation stats. If a file is in the previous compiler output, but no longer in the output of the new build, it is considered stale and can be removed.
-it is considered stale output which can be removed.
+ We store previous compilation stats. If a file is in the previous compiler output, but no longer in the output of the new build, it is considered stale and can be removed.
+ it is considered stale output which can be removed.
In general, strategy two is more reliable and efficient.
@@ -100,11 +100,9 @@ In general, strategy two is more reliable and efficient.
However, strategy one is easier for tooling like `genType`. Not every tool has knowledge of the build system.
-
Sometimes a combination of both strategies is needed.
-- When removing .cm* files, we use the first strategy.
-- When removing generated javascript, we use strategy two,
-
+- When removing .cm\* files, we use the first strategy.
+- When removing generated javascript, we use strategy two,
Happy Hacking!
diff --git a/_blogposts/2020-09-25-release-8-3.mdx b/_blogposts/2020-09-25-release-8-3.mdx
index a3a629be9..71874227f 100644
--- a/_blogposts/2020-09-25-release-8-3.mdx
+++ b/_blogposts/2020-09-25-release-8-3.mdx
@@ -17,9 +17,7 @@ It's focused on type safety, performance and JS interop. It used to be called Bu
npm i bs-platform@8.3.0
```
-The changes are listed [here](https://github.com/rescript-lang/rescript-compiler/blob/master/Changes.md#83), this is a large release, and we will go through some highlighted changes.
-
-
+The changes are listed [here](https://github.com/rescript-lang/rescript/blob/master/Changes.md#83), this is a large release, and we will go through some highlighted changes.
## Lightweight FFI attributes without `bs.` prefix
@@ -27,18 +25,19 @@ In this release, we make the `bs.` prefix optional, this will make the FFI less
For example, the old externals for `readFileAsUtf8Sync` used to be written like this
-
```res
@bs.val @bs.module("fs")
external readFileAsUtf8Sync: (string, @bs.as("utf8") _) => string = "readFileSync"
```
+
```reason
[@bs.val] [@bs.module "fs"]
external readFileAsUtf8Sync: (string, [@bs.as "utf8"] _) => string =
"readFileSync";
```
+
```ocaml
external readFileAsUtf8Sync : string -> (_[@bs.as "utf8"]) -> string = "readFileSync" [@@bs.val] [@@bs.module "fs"]
```
@@ -52,11 +51,13 @@ It can now be simplified as
```res
@val @module("fs") external readFileAsUtf8Sync: (string, @as("utf8") _) => string = "readFileSync"
```
+
```reason
[@val] [@module "fs"]
external readFileAsUtf8Sync: (string, [@as "utf8"] _) => string =
"readFileSync";
```
+
```ocaml
external readFileAsUtf8Sync : string -> (_[@as "utf8"]) -> string = "readFileSync"
[@@val] [@@module "fs"]
@@ -70,8 +71,7 @@ with the exception of the following two that don't have abbreviations:
- `bs.send.pipe` : this attribute was deprecated in favor of `bs.send`; you can still use the existing one for backward compatibility.
- `bs.splice` : this attribute was deprecated in favor of `bs.variadic`; you can still use the existing one for
-backward compatibility.
-
+ backward compatibility.
## default import in Es6 support
@@ -84,11 +84,13 @@ If you use es6 module output, the default bindings will be compiled properly now
let a = input("hello")
```
+
```reason
[@module "hello"] external input: string => string = "default";
let a = input("hello");
```
+
```ocaml
external input : string -> string = "default" [@@module "hello"]
@@ -104,7 +106,6 @@ import Hello from "hello";
var a = Hello("hello");
```
-
## Customized js file extension support
Now user can pick up their js file extension support per module format:
@@ -122,12 +123,10 @@ Now user can pick up their js file extension support per module format:
## More flexible filename support
-To have better integration with other [JS infrastructures](https://github.com/rescript-lang/rescript-compiler/issues/4624),
+To have better integration with other [JS infrastructures](https://github.com/rescript-lang/rescript/issues/4624),
for example, Next.js/React Native, we allow file names like `404.res`,
`Button.Android.res` so that it can just be picked up by those tools
-
-
## Better type based inference for pattern `let {a,b,c} = value`
Previously, for code like this:
@@ -144,6 +143,7 @@ let f = (u: N.t) => {
x + 1
} /* type error */
```
+
```reason
module N = {
type t = {x: int};
@@ -154,6 +154,7 @@ let f = (u: N.t) => {
x + 1;
}; /* type error */
```
+
```ocaml
module N = struct
type t = {
diff --git a/_blogposts/2020-11-17-editor-support-custom-operators-and-more.mdx b/_blogposts/2020-11-17-editor-support-custom-operators-and-more.mdx
index 661b6ea36..43b21fe30 100644
--- a/_blogposts/2020-11-17-editor-support-custom-operators-and-more.mdx
+++ b/_blogposts/2020-11-17-editor-support-custom-operators-and-more.mdx
@@ -8,7 +8,7 @@ description: |
Update on what we're doing around the end of 2020 and early next year.
---
-import Video from "src/components/Video"
+import Video from "src/components/Video";
## Upcoming Improvements
@@ -28,7 +28,7 @@ Hongbo continues to improve the compiler experience in monorepo-like setups. Exp
## Docs
-Patrick is [rearranging the React documentation](https://github.com/reason-association/rescript-lang.org/pull/96), and continues to improve the main documentation site with Cheng Lou.
+Patrick is [rearranging the React documentation](https://github.com/rescript-lang/rescript-lang.org/pull/96), and continues to improve the main documentation site with Cheng Lou.
## Syntax
diff --git a/_blogposts/2020-11-26-editor-support-release-1-0.mdx b/_blogposts/2020-11-26-editor-support-release-1-0.mdx
index 090f101b6..08ae79ed0 100644
--- a/_blogposts/2020-11-26-editor-support-release-1-0.mdx
+++ b/_blogposts/2020-11-26-editor-support-release-1-0.mdx
@@ -9,12 +9,12 @@ description: |
Type hints, jump to definition, error diagnostics, and more.
---
-
## Editor Integration Has Finally Landed
Thank you so much for the wait!
**Here are all the features:**
+
- Highlighting
- Formatting
- Diagnostics
@@ -32,4 +32,8 @@ We'll keep on iterating on the polish of the plugins, and release better [Sublim
Happy thanksgiving!
-
+
diff --git a/_blogposts/2020-12-07-release-8-4.mdx b/_blogposts/2020-12-07-release-8-4.mdx
index a51a0dfe0..bc7484feb 100644
--- a/_blogposts/2020-12-07-release-8-4.mdx
+++ b/_blogposts/2020-12-07-release-8-4.mdx
@@ -19,7 +19,7 @@ It's focused on type safety, performance and JS interop. It used to be called Bu
npm i bs-platform@8.4.2
```
-The changes are listed [here](https://github.com/rescript-lang/rescript-compiler/blob/master/Changes.md#841).
+The changes are listed [here](https://github.com/rescript-lang/rescript/blob/master/Changes.md#841).
We will go through some highlighted changes.
@@ -33,11 +33,10 @@ In this release, we fix the integrity of `bsb -make-world` which allows user to
The fix is well implemented that people who don't do such modifications will not pay for it.
This is one of the highest desired feature request based on the
-[user feedback](https://github.com/rescript-lang/rescript-compiler/issues/4361#issuecomment-739538789), so we will expand a bit here why it is tricky
-to implement it without compromising performance.
+[user feedback](https://github.com/rescript-lang/rescript/issues/4361#issuecomment-739538789), so we will expand a bit here why it is tricky to implement it without compromising performance.
In ReScript compilation scheme, dependencies as packages are treated as a black box,
-changes of dependencies should be *transitive*. The is due to that we have cross module
+changes of dependencies should be _transitive_. The is due to that we have cross module
optimizations and the binary interface itself is a hash of its dependencies.
So for a package dependency chain: A -> B -> C, if A changes and B does not change, C still needs get rebuilt.
Because the intermediate output of B may still change due to the change of A.
@@ -68,6 +67,6 @@ of such stale outptu, such stale `List.cmi` file will break the integrity of the
In this release, we introduced a more robust algorithm that will always remove stale output before the build so
that such integrity is not broken.
-Last but not the least, we continue improving the readability, debuggability of the [generated output](https://github.com/rescript-lang/rescript-compiler/pull/4858) : )
+Last but not the least, we continue improving the readability, debuggability of the [generated output](https://github.com/rescript-lang/rescript/pull/4858) : )
Happy Hacking! -- Hongbo Zhang
diff --git a/_blogposts/2021-02-09-release-9-0.mdx b/_blogposts/2021-02-09-release-9-0.mdx
index a1221f18b..1238d0788 100644
--- a/_blogposts/2021-02-09-release-9-0.mdx
+++ b/_blogposts/2021-02-09-release-9-0.mdx
@@ -16,25 +16,24 @@ ReScript is a robustly typed language that compiles to efficient and human-reada
Use `npm` to install the newest [9.0.1 release](https://www.npmjs.com/package/bs-platform/v/9.0.1) with the following command:
-```
+```sh
npm install bs-platform@9.0.1
```
You can also try our new release in the [Online Playground](/try).
-In this post we will highlight the most notable changes. The full changelog for this release can be found [here](https://github.com/rescript-lang/rescript-compiler/blob/master/Changes.md#90).
+In this post we will highlight the most notable changes. The full changelog for this release can be found [here](https://github.com/rescript-lang/rescript/blob/master/Changes.md#90).
## Compiler Improvements
### New External Stdlib Configuration
-This is a long-awaited [feature request](https://github.com/rescript-lang/rescript-compiler/pull/2171).
+This is a long-awaited [feature request](https://github.com/rescript-lang/rescript/pull/2171).
Our compiler comes with a set of stdlib modules (such as `Belt`, `Pervasives`, etc.) for core functionality. Compiled ReScript code relies on the JS runtime version of these stdlib modules.
In previous versions, users couldn't ship their compiled JS code without defining a `package.json` dependency on `bs-platform`. Whenever a ReScript developer wanted to publish a package just for pure JS consumption / lean container deployment, they were required to use a bundler to bundle up their library / stdlib code, which made things way more complex and harder to understand.
-
To fix this problem, we introduced an `external-stdlib` configuration that allows specifying a pre-compiled stdlib npm package (`@rescript/std`). More details on how to use that feature can be found in our [External Stdlib](/docs/manual/latest/build-external-stdlib) documentation.
### Less Bundle Bloat when Adding ReScript
@@ -47,7 +46,7 @@ We made a small [demo repo](https://github.com/bobzhang/zero-cost-rescript) and
### Improved Code Generation for Pattern Matching
-We fine-tuned our pattern matching engine to optimize the JS output even more. Here is an example of a pretty substantial optimization, based on [this issue](https://github.com/rescript-lang/rescript-compiler/issues/4924):
+We fine-tuned our pattern matching engine to optimize the JS output even more. Here is an example of a pretty substantial optimization, based on [this issue](https://github.com/rescript-lang/rescript/issues/4924):
```res
type test =
@@ -67,8 +66,8 @@ The snippet above will compile to the following JS output:
```js
-function test(x){
- return x === 0
+function test(x) {
+ return x === 0;
}
```
@@ -82,12 +81,11 @@ function test(x) {
}
```
-
As you can see, the 9.0 compiler removes all the unnecessary `typeof` checks!
-This is possible because our optimizer will try to analyze several predicates and get rid of redundant ones. More diffs can be found [here](https://github.com/rescript-lang/rescript-compiler/pull/4927/files?file-filters%5B%5D=.js).
+This is possible because our optimizer will try to analyze several predicates and get rid of redundant ones. More diffs can be found [here](https://github.com/rescript-lang/rescript/pull/4927/files?file-filters%5B%5D=.js).
Another important improvement is that we fixed the pattern match offset issue, which lead to the consequence that magic numbers will not be generated for complex pattern matches anymore.
@@ -153,7 +151,6 @@ type animation = [ #\"ease-in" | #\"ease-out" ]
We introduced this change to allow easier interop with existing JS string enums. In pure ReScript code, we'd still recommend our users to stick with valid identifier names instead (e.g. `easeIn` instead of `ease-in`).
-
## Breaking Changes
This release comes with a minor breaking change that shouldn't have much impact on the upgrade of existing codebases.
@@ -209,5 +206,4 @@ For example, we are tinkering with the idea on using WASM to replace Camlp4, and
We will discuss these topics in a separate development post, but we are already excited about the new possibilities this will bring within the compiler toolchain.
-
Happy Hacking!
diff --git a/_blogposts/2021-03-03-rescript-association-rebranding.mdx b/_blogposts/2021-03-03-rescript-association-rebranding.mdx
index b330f4be9..e216cb619 100644
--- a/_blogposts/2021-03-03-rescript-association-rebranding.mdx
+++ b/_blogposts/2021-03-03-rescript-association-rebranding.mdx
@@ -25,7 +25,7 @@ Founded in 2018, the ReScript Association provides a legal and financial foundat
- [rescript-lang.org](https://rescript-lang.org).
- [Community forum](https://forum.rescript-lang.org) & server.
- ReScript related domains and [analytics data](https://simpleanalytics.com/rescript-lang.org).
-- [genType’s](https://github.com/rescript-association/genType) release automation.
+- [genType’s](https://github.com/rescript-lang/genType) release automation.
- Help maintaining editor related tools such as [rescript-vscode](https://github.com/rescript-lang/rescript-vscode), [vim-rescript](https://github.com/rescript-lang/vim-rescript) and the underlying [editor-support](https://github.com/rescript-lang/rescript-editor-support).
- Design & logo assets (together with our designer) for all of ReScript.
- Helping out on upcoming [ocaml.org](https://ocaml.org) work.
@@ -48,6 +48,7 @@ High quality, long-term Open Source work doesn’t come from some good words and
If your company relies on the ReScript platform for building commercial products, please consider supporting our efforts by [sending a donation](https://rescript-association.org/donate). It’s the best way to future proof your product’s foundation. Alternatively, you can sponsor individual members like [ryyppy](https://github.com/sponsors/ryyppy/) on GitHub Sponsors.
We want to take this opportunity to thank our previous and active sponsors:
+
- [Tezos Foundation](https://tezos.foundation) (2020-21)
- [Ahrefs](https://ahrefs.com) (2019)
- [OCaml Software Foundation](https://ocaml-sf.org) (2018-19)
diff --git a/_blogposts/2021-05-07-release-9-1.mdx b/_blogposts/2021-05-07-release-9-1.mdx
index e5573cf00..56b4e8b15 100644
--- a/_blogposts/2021-05-07-release-9-1.mdx
+++ b/_blogposts/2021-05-07-release-9-1.mdx
@@ -10,7 +10,7 @@ description: |
## Exciting Improvements in ReScript 9.1
-Our recent few releases of ReScript contains [lots of improvements](https://github.com/rescript-lang/rescript-compiler/blob/3134392a364b70c9c172aa6c1dbaa1ac6580265d/Changes.md#91), among which are a few standout features we'd like to further promote. Hope you're as excited as we are about these! It goes without saying, our [updated editor plugin](https://forum.rescript-lang.org/t/ann-rescript-vscode-1-1-1-released/1542/3) works with the new releases.
+Our recent few releases of ReScript contains [lots of improvements](https://github.com/rescript-lang/rescript/blob/3134392a364b70c9c172aa6c1dbaa1ac6580265d/Changes.md#91), among which are a few standout features we'd like to further promote. Hope you're as excited as we are about these! It goes without saying, our [updated editor plugin](https://forum.rescript-lang.org/t/ann-rescript-vscode-1-1-1-released/1542/3) works with the new releases.
### New NPM Package
@@ -41,6 +41,7 @@ The default `rescript` is equivalent to `rescript build` subcommand
```
Here's a table of translation, if you're upgrading your script that is currently using `bsc` and `bsb`:
+
- `bsc -format myFile.res`: `rescript format myFile.res`
- `bsb`: `rescript build` \*
- `bsb -make-world`: `rescript build -with-deps` \*
@@ -53,7 +54,8 @@ This means that you can ditch your old `-make-world` (now the explicit `-with-de
### Polymorphic Variants for Numbers and Strings
-*Drumrolls*
+_Drumrolls_
+
- Poly variants like `#1`, `#42` compile to JavaScript numbers.
- Poly variants like `#hello`, `#world` compile to JavaScript Strings.
@@ -159,6 +161,6 @@ let helloUnicode = (x) =>{
## Conclusion
-Don't miss our various other improvements in [our changelog](https://github.com/rescript-lang/rescript-compiler/blob/3134392a364b70c9c172aa6c1dbaa1ac6580265d/Changes.md#91). As always we try to keep our changes performant, lean and robust. We hope you'll enjoy these.
+Don't miss our various other improvements in [our changelog](https://github.com/rescript-lang/rescript/blob/3134392a364b70c9c172aa6c1dbaa1ac6580265d/Changes.md#91). As always we try to keep our changes performant, lean and robust. We hope you'll enjoy these.
See you next time!
diff --git a/_blogposts/2021-06-25-roadmap-2021-and-new-landing-page.mdx b/_blogposts/2021-06-25-roadmap-2021-and-new-landing-page.mdx
index 543106c1d..013f411a5 100644
--- a/_blogposts/2021-06-25-roadmap-2021-and-new-landing-page.mdx
+++ b/_blogposts/2021-06-25-roadmap-2021-and-new-landing-page.mdx
@@ -7,7 +7,7 @@ description: |
Announcing our roadmap for 2021 / 2022, release cycle plans and new landing page.
---
-import Image from "src/components/Image.mjs"
+import Image from "src/components/Image.mjs";
## Team Update
@@ -21,7 +21,7 @@ It has almost been a year since we originally [launched our new ReScript brand](
- Accessible object system (no need for `Js.t`)
- The release of our new `rescript` npm package and cli to replace `bs-platform`
- Making every part of ReScript fully community owned
-- etc.
+- etc.
Stay tuned, this is just the beginning!
@@ -30,6 +30,7 @@ Stay tuned, this is just the beginning!
We had some thorough discussions about the future of the project and outlined the most important milestones for the next upcoming releases.
**Here's the gist:**
+
- Two release channels: `stable` and `experimental`
- More predictable release dates and better migration steps
- Better communication and discussion for breaking changes
@@ -41,7 +42,11 @@ The detailed roadmap with all our planned changes (and definition of our release
After several iterations, we are happy to announce our new [landing page](/).
-
+
This is an incredible milestone for the documentation, and will act as a foundation for some cool new future improvements, such as:
@@ -49,7 +54,6 @@ This is an incredible milestone for the documentation, and will act as a foundat
- An interactive playground widget for the headline code examples
- New starter templates and guides
-
-Furthermore, in case you are a **production user of ReScript** and you want to see your company logo highlighted on the landing page, please [open an issue](https://github.com/rescript-association/rescript-lang.org/issues) and let us know!
+Furthermore, in case you are a **production user of ReScript** and you want to see your company logo highlighted on the landing page, please [open an issue](https://github.com/rescript-lang/rescript-lang.org/issues) and let us know!
Happy hacking.
diff --git a/_blogposts/2022-08-25-release-10-0-0.mdx b/_blogposts/2022-08-25-release-10-0-0.mdx
index 0cd4ef112..9413fa21d 100644
--- a/_blogposts/2022-08-25-release-10-0-0.mdx
+++ b/_blogposts/2022-08-25-release-10-0-0.mdx
@@ -14,27 +14,33 @@ ReScript version 10 is available! Version 10 is a culmination of over a year's w
npm install rescript@10
```
-All changes are listed [here](https://github.com/rescript-lang/rescript-compiler/blob/10.0_release/CHANGELOG.md). Let's take a tour of a few of the features we're extra excited about.
+All changes are listed [here](https://github.com/rescript-lang/rescript/blob/10.0_release/CHANGELOG.md). Let's take a tour of a few of the features we're extra excited about.
## Faster builds with native M1 support
+
Users with M1 chips should see a notable speedup, as the new ReScript version has full native support for M1.
## Better ergonomics with Unicode support in regular strings
+
You can now use Unicode characters directly in regular strings. This will now produce what you'd expect:
+
```res
let str = "Σ"
```
You can also pattern match on Unicode characters:
+
```res
-switch someCharacter {
- | 'Σ' => "what a fine Unicode char"
- | _ => "Unicode is fun"
+switch someCharacter {
+ | 'Σ' => "what a fine Unicode char"
+ | _ => "Unicode is fun"
}
```
## Experimental optional record fields
+
Previously, a record would always have to define all its optional fields:
+
```res
type user = {
name: string,
@@ -51,6 +57,7 @@ let userWithAge = {
age: Some(34),
}
```
+
For small records like the one above, this is typically fine. But for records with many fields, the friction of having to always set all optional fields explicitly adds up. This release has a new experimental feature called optional record fields, allowing you to rewrite the above to this instead:
```res
@@ -79,7 +86,7 @@ Version 10 brings the building blocks needed for a number of exciting new featur
## Upgrade guide
-Please see the detailed [changelog](https://github.com/rescript-lang/rescript-compiler/blob/10.0_release/CHANGELOG.md) for a list of breaking changes.
+Please see the detailed [changelog](https://github.com/rescript-lang/rescript/blob/10.0_release/CHANGELOG.md) for a list of breaking changes.
Each breaking change lists suggestions on how to upgrade your project.
This can be out of your control in case of dependencies. In that case, please raise issues with the maintainers of those libraries.
diff --git a/_blogposts/2023-02-02-release-10-1.mdx b/_blogposts/2023-02-02-release-10-1.mdx
index 9c2eeb077..18628c6b4 100644
--- a/_blogposts/2023-02-02-release-10-1.mdx
+++ b/_blogposts/2023-02-02-release-10-1.mdx
@@ -27,7 +27,7 @@ This version comes with two major language improvements we've all been waiting f
Alongside the major changes, there have been many bugfixes and other improvements that won't be covered in this post.
-Feel free to check the [Changelog](https://github.com/rescript-lang/rescript-compiler/blob/master/CHANGELOG.md#1011) for all the details.
+Feel free to check the [Changelog](https://github.com/rescript-lang/rescript/blob/master/CHANGELOG.md#1011) for all the details.
## New `async` / `await` syntax
@@ -70,11 +70,10 @@ Way easier on the eyes, don't you think? Note that the new `promise` type is ful
Additionally, we also introduced the `Js.Promise2` module as a stepping stone to migrate `Js.Promise` based code to a first-pipe (->) friendly solution. For the daily practise you'll almost always want to use `async` / `await` to handle promises.
-(*Sidenote*: We are also well aware that our users want a solution to unify `Belt`, `Js` and `Js.xxx2` and have a fully featured "standard library" instead of adding more `Js.xxx2` modules. Good news is that we have a solution in the pipeline to fix this. `Js.Promise2` was introduced to ease the process later on and is not supposed to be the panacea of promise handling.)
+(_Sidenote_: We are also well aware that our users want a solution to unify `Belt`, `Js` and `Js.xxx2` and have a fully featured "standard library" instead of adding more `Js.xxx2` modules. Good news is that we have a solution in the pipeline to fix this. `Js.Promise2` was introduced to ease the process later on and is not supposed to be the panacea of promise handling.)
If you are already using a third-party promise library like [ryyppy/rescript-promise](https://github.com/ryyppy/rescript-promise) or similar, there's no need to migrate any existing code. Introduce `async` / `await` gradually in your codebase as you go.
-
## New JSX v4 syntax
ReScript 10.1 now ships with JSX v4. Here's what's new:
@@ -83,7 +82,7 @@ ReScript 10.1 now ships with JSX v4. Here's what's new:
- **Two new transformation modes**. JSX v4 comes with a `classic` mode (= `React.createElement`) and `automatic` mode (= `jsx-runtime` calls). The latter is the new default, moving forward with `rescript/react@0.11` and `React@18`.
- **Allow mixing JSX configurations on the project and module level.** Gradually mix and match JSX transformations and modes without migrating any old code!
- **Pass `prop` types** to `@react.component`. You can now fine tune `@react.component` with your specific prop type needs. Very useful for libraries and frameworks to define component interfaces.
-- **Less boilerplate when using `React.Context`**. Check out our [example](/docs/react/latest/migrate-react#reactcontext) for comparison.
+- **Less boilerplate when using `React.Context`**. Check out our [example](/docs/react/latest/migrate-react#reactcontext) for comparison.
- **Revisited props spread operator.** This will allow users to spread records in JSX without sacrificing their sanity. Note that this implementation has harder constraints than its JS counterpart. (requires `rescript/react@0.11` or higher)
- **Better type inference of props.** Type inference when passing e.g. variants that are defined in the same module as the component is much improved. With the earlier JSX version, you'd often need to write code like this in order for the compiler to understand which variant you're passing: ``. With JSX v4, you won't need to tell the compiler where the variant you're passing is located: ``.
@@ -186,12 +185,12 @@ import * as JsxRuntime from "react/jsx-runtime";
function Playground$AutomaticModeExample(props) {
return JsxRuntime.jsx("div", {
- children: "Hello " + props.name + ""
- });
+ children: "Hello " + props.name + "",
+ });
}
var AutomaticModeExample = {
- make: Playground$AutomaticModeExample
+ make: Playground$AutomaticModeExample,
};
function Playground$ClassicModeExample(props) {
@@ -199,83 +198,85 @@ function Playground$ClassicModeExample(props) {
}
var ClassicModeExample = {
- make: Playground$ClassicModeExample
+ make: Playground$ClassicModeExample,
};
function make(props) {
return JsxRuntime.jsx("div", {
- children: "Hello " + props.name + ""
- });
+ children: "Hello " + props.name + "",
+ });
}
var NoAttributeExample = {
- make: make
+ make: make,
};
function Playground$ReactInterfaceExample(props) {
var age = props.age;
var age$1 = age !== undefined ? age : 0;
return JsxRuntime.jsx("div", {
- children: "Hello " + props.name + ", you are " + String(age$1) + " years old."
- });
+ children:
+ "Hello " + props.name + ", you are " + String(age$1) + " years old.",
+ });
}
var ReactInterfaceExample = {
- make: Playground$ReactInterfaceExample
+ make: Playground$ReactInterfaceExample,
};
function Playground$PropTypeInjectionExample(props) {
var msg = props.isHuman ? "hello human" : "hello fellow computer";
return JsxRuntime.jsx("div", {
- children: msg
- });
+ children: msg,
+ });
}
var PropTypeInjectionExample = {
- make: Playground$PropTypeInjectionExample
+ make: Playground$PropTypeInjectionExample,
};
function Playground$PropSpreadExample(props) {
return JsxRuntime.jsx(make, {
- name: "World"
- });
+ name: "World",
+ });
}
var PropSpreadExample = {
- make: Playground$PropSpreadExample
+ make: Playground$PropSpreadExample,
};
var root = JsxRuntime.jsxs("div", {
- children: [
- JsxRuntime.jsx(Playground$AutomaticModeExample, {
- name: "Automatic"
- }),
- JsxRuntime.jsx(Playground$ClassicModeExample, {
- name: "Classic"
- }),
- JsxRuntime.jsx(make, {
- name: "NoAttribute"
- }),
- JsxRuntime.jsx(Playground$ReactInterfaceExample, {
- name: "Interface"
- }),
- JsxRuntime.jsx(Playground$PropTypeInjectionExample, {
- isHuman: true
- }),
- JsxRuntime.jsx(Playground$PropSpreadExample, {})
- ]
- });
+ children: [
+ JsxRuntime.jsx(Playground$AutomaticModeExample, {
+ name: "Automatic",
+ }),
+ JsxRuntime.jsx(Playground$ClassicModeExample, {
+ name: "Classic",
+ }),
+ JsxRuntime.jsx(make, {
+ name: "NoAttribute",
+ }),
+ JsxRuntime.jsx(Playground$ReactInterfaceExample, {
+ name: "Interface",
+ }),
+ JsxRuntime.jsx(Playground$PropTypeInjectionExample, {
+ isHuman: true,
+ }),
+ JsxRuntime.jsx(Playground$PropSpreadExample, {}),
+ ],
+});
export {
- AutomaticModeExample ,
- ClassicModeExample ,
- NoAttributeExample ,
- ReactInterfaceExample ,
- PropTypeInjectionExample ,
- PropSpreadExample ,
- root ,
-}
+ AutomaticModeExample,
+ ClassicModeExample,
+ NoAttributeExample,
+ ReactInterfaceExample,
+ PropTypeInjectionExample,
+ PropSpreadExample,
+ root,
+};
```
+
### How to migrate to JSX v4?
@@ -289,20 +290,20 @@ Make sure to also check out the [rescript-react changelog](https://github.com/re
Our contributors are already one step ahead and are currently working on improvements for the next major v11 release. Things that are currently being explored:
- Make uncurried functions the default. This will be a huge change in terms of how we do interop and will open completely new ways to interact with existing codebases. It will also allow us to improve tooling in ways that wouldn't have been possible in a curried language.
-- Explorations for a community "standard library" that goes beyond `Belt` and `Js.*`. This will also involve disabling / removing global "Stdlib" modules that shouldn't be used (e.g. `Array`, `List`, etc).
+- Explorations for a community "standard library" that goes beyond `Belt` and `Js.*`. This will also involve disabling / removing global "Stdlib" modules that shouldn't be used (e.g. `Array`, `List`, etc).
- New tooling to generate markdown from docstrings (module, type and value level). This will be super simple, but very effective.
- Explorations for a [localized documentation page](https://forum.rescript-lang.org/t/translation-project-rescript-lang-org/4022) (currently in a slowed-down exploration phase, but we will be getting there)
-Check out the [v11](https://github.com/rescript-lang/rescript-compiler/issues?q=is%3Aopen+is%3Aissue+milestone%3Av11.0) milestone on our `rescript-lang` repo for more details on future improvements.
+Check out the [v11](https://github.com/rescript-lang/rescript/issues?q=is%3Aopen+is%3Aissue+milestone%3Av11.0) milestone on our `rescript-lang` repo for more details on future improvements.
## Acknowledgements
-As always, we want to thank our [contributors](https://github.com/rescript-lang/rescript-compiler/graphs/contributors?from=2019-11-24&to=2023-02-02&type=c) for building an amazing platform. Special thanks go out to [mununki](https://github.com/mununki) for building the new JSX v4 syntax. Amazing work!
+As always, we want to thank our [contributors](https://github.com/rescript-lang/rescript/graphs/contributors?from=2019-11-24&to=2023-02-02&type=c) for building an amazing platform. Special thanks go out to [mununki](https://github.com/mununki) for building the new JSX v4 syntax. Amazing work!
-## That's it
+## That's it
We hope you enjoy the newest improvements as much as we do.
-In case there's any issues / problems, make sure to report bugs to [rescript-lang/rescript-compiler](https://github.com/rescript-lang/rescript-compiler) (language / syntax / jsx), [rescript-lang/rescript-react](https://github.com/rescript-lang/rescript-react) (React 16 / 18 binding) or [rescript-association/rescript-lang.org](https://github.com/rescript-association/rescript-lang.org) (documentation) repositories.
+In case there's any issues / problems, make sure to report bugs to [rescript-lang/rescript](https://github.com/rescript-lang/rescript) (language / syntax / jsx), [rescript-lang/rescript-react](https://github.com/rescript-lang/rescript-react) (React 16 / 18 binding) or [rescript-association/rescript-lang.org](https://github.com/rescript-lang/rescript-lang.org) (documentation) repositories.
Also feel free to visit the [ReScript forum](https://forum.rescript-lang.org/) to ask questions and connect with other ReScripters.
diff --git a/_blogposts/2023-04-17-improving-interop.mdx b/_blogposts/2023-04-17-improving-interop.mdx
index 3095db882..4d883dd96 100644
--- a/_blogposts/2023-04-17-improving-interop.mdx
+++ b/_blogposts/2023-04-17-improving-interop.mdx
@@ -198,7 +198,7 @@ let getBestFriendsAge = user =>
As you can see, you need to convert each level of nullables explicitly, which makes it hard to fully utilize pattern matching. With the new unboxed variant representation, we'll instead be able to do this:
```rescript
-// The type definition below is inlined here to examplify, but this definition will live in [Core](https://github.com/rescript-association/rescript-core) and be easily accessible
+// The type definition below is inlined here to examplify, but this definition will live in [Core](https://github.com/rescript-lang/rescript-core) and be easily accessible
module Null = {
@unboxed type t<'a> = Present('a) | @as(null) Null
}
diff --git a/_blogposts/2023-06-05-first-class-dynamic-import-support.mdx b/_blogposts/2023-06-05-first-class-dynamic-import-support.mdx
index 9f5b9569a..3d2f8111b 100644
--- a/_blogposts/2023-06-05-first-class-dynamic-import-support.mdx
+++ b/_blogposts/2023-06-05-first-class-dynamic-import-support.mdx
@@ -54,7 +54,7 @@ This compiles to:
```javascript
async function main() {
- var add = await import("./MathUtils.mjs").then(function(m) {
+ var add = await import("./MathUtils.mjs").then(function (m) {
return m.add;
});
@@ -91,7 +91,7 @@ module LazyTitle = {
let titleJsx =
```
-That's all the code we need! The new `` component behaves exactly the same as the wrapped `
` component, but will be lazy loaded via React's built in lazy mechanism.
+That's all the code we need! The new `` component behaves exactly the same as the wrapped `` component, but will be lazy loaded via React's built-in lazy mechanism.
Needless to say, all the code examples you've seen so far are fully type-safe.
@@ -132,13 +132,12 @@ Feel free to try out our new dynamic import feature with the latest beta release
Please note that this release is only intended for experiments and feedback purposes.
-
## Conclusion
The most important take away of the new dynamic imports functionality in ReScript is that you'll never need to care about _where_ what you're importing is located on the file system - the compiler already does it for you.
We hope that it will help shipping software with better end-user experience with faster load times and quicker app interaction, especially on slower network connections.
-As always, we're eager to hear about your experiences with our new features. Feel free to share your thoughts and feedback with us on our [issue tracker](https://github.com/rescript-lang/rescript-compiler/issues) or on the [forum](https://forum.rescript-lang.org).
+As always, we're eager to hear about your experiences with our new features. Feel free to share your thoughts and feedback with us on our [issue tracker](https://github.com/rescript-lang/rescript/issues) or on the [forum](https://forum.rescript-lang.org).
Happy hacking!
diff --git a/_blogposts/2023-09-18-uncurried-mode.mdx b/_blogposts/2023-09-18-uncurried-mode.mdx
new file mode 100644
index 000000000..1ed851d1d
--- /dev/null
+++ b/_blogposts/2023-09-18-uncurried-mode.mdx
@@ -0,0 +1,162 @@
+---
+author: rescript-team
+date: "2023-09-18"
+title: Uncurried Mode
+badge: roadmap
+description: |
+ A tour of new capabilities coming to ReScript v11
+---
+
+> This is the fourth post covering new capabilities that'll ship in ReScript v11. You can check out the first post on [Better Interop with Customizable Variants](/blog/improving-interop), the second post on [Enhanced Ergonomics for Record Types](/blog/enhanced-ergonomics-for-record-types) and the third post on [First-class Dynamic Import Support](/blog/first-class-dynamic-import-support).
+
+## Introduction
+
+ReScript is a language that strives to keep its users free from experiencing runtime errors. Usually, when a program compiles, it will already do what the user described.
+But there is still a concept in the language that makes it easy to let some errors slip through. Currying!
+
+Because of currying, partial application of functions is possible. That feature is always advertised as something really powerful. For instance,
+
+```rescript
+let add = (a, b) => a + b
+let addFive = add(5)
+```
+
+is shorter than having to write all remaining parameters again
+
+```rescript
+let add = (a, b) => a + b
+let addFive = (b) => add(5, b)
+```
+
+This comes at a price though. Here are some examples to show the drawbacks of currying:
+
+- Errors because of changed function signatures have their impact at the use site. Consider this example, where the signature of the onChange function is extended with
+ a labeled argument
+
+ ```diff
+ @react.component
+ - let make = (~onChange: string => option unit>) => {
+ + let make = (~onChange: (~a: int, string) => option unit>) => {
+ React.useEffect(() => {
+ // As partial application is allowed, there is no error here.
+ let cleanup = onChange("change")
+
+ // Here it errors with "This call is missing an argument of type (~a: int)"
+ cleanup
+ })
+ }
+ ```
+
+- If you wanted explicitly uncurry a function, you needed to annotate it with the uncurried dot.
+ ```rescript
+ (. param) => ()
+ ```
+- As ReScript could not fully statically analyze when to automatically uncurry a function over multiple files, it led to unnecessary `Curry.` calls in the emitted JavaScript code.
+- In the standard library (`Belt`), there are both curried and uncurried versions of the same function so you were required to think for yourself when to use the uncurried version and when only the curried one will work.
+- In combination with `ignore` / `let _ = ...`, curried can lead to unexpected behavior at runtime after adding a parameter to a function, because you are accidentally ignoring the result of a partial evaluation so that the function is not called at all.
+ 1. Have a look at this simple function. It is assigned to `_` because we ignore the resulting `string` value.
+
+ ```res
+ let myCurriedFn = (~first) => first
+ let _ = myCurriedFn(~first="Hello!")
+ // ^ string
+ ```
+
+ 2. Now the function got a second parameter `~second`. Here, the resulting value is a function, which means it is not fully applied and thus never executed.
+
+ ```res
+ let myCurriedFn = (~first, ~second) => first ++ " " ++ second
+ let _ = myCurriedFn(~first="Hello!")
+ // ^ (~second: string) => string
+ ```
+
+ 3. One way to prevent such errors is to annotate the underscore with the function's return type:
+
+ ```res
+ let _: string = myCurriedFn(~first="Hello!")
+ ```
+
+ 4. However, the same issue arises when using the built-in ignore function, which cannot be annotated:
+
+ ```res
+ myCurriedFn(~first="Hello!")->ignore
+ ```
+
+Those are all only some small paper cuts, but all of them are intricacies that make the language harder to learn.
+
+## Uncurried mode
+
+Starting with ReScript 11, your code will be compiled in uncurried mode. Yes, there is still a way to turn it off ([see below](#how-to-switch-back-to-curried-mode)), but we have decided to already default to this behavior to make it easier for newcomers.
+In uncurried mode, the introductory example yields an error:
+
+```rescript
+let add = (a, b) => a + b
+let addFive = add(5) // <-- Error:
+// This uncurried function has type (. int, int) => int
+// It is applied with 1 arguments but it requires 2.
+```
+
+to fix it, you have two options:
+
+1. state the remaining parameters explicitly
+
+```rescript
+let add = (a, b) => a + b
+let addFive = (b) => add(5, b)
+```
+
+2. or use the new explicit syntax for partial application
+
+```rescript
+let add = (a, b) => a + b
+let addFive = add(5, ...)
+```
+
+The former approach helps library authors support both ReScript 11 and earlier versions.
+
+### No final unit anymore
+
+We are happy to announce that with uncurried mode the "final unit" pattern is not necessary anymore, while you still can use optional or default parameters.
+
+```res
+// old
+let myFun = (~name=?, ())
+
+// new
+let myFun = (~name=?)
+```
+
+### More wins
+
+Furthermore, function calls in uncurried mode are now guaranteed to get compiled as simple JavaScript function calls, which is quite nice for readability of the generated code.
+It may also give you some (negligible) performance gains.
+
+### How to switch back to curried mode
+
+While we strongly encourage all users to switch to the new uncurried mode, it is still possible to opt out. Just add a
+
+```json
+{
+ "uncurried": false
+}
+```
+
+to your `bsconfig.json`, and your project will be compiled in curried mode again.
+
+If you have uncurried mode off and still want to try it on a per-file basis, you can turn it on via
+
+```rescript
+@@uncurried
+```
+
+at the top of a `.res` file.
+
+## Conclusion
+
+Many thoughts have led to this decision, but we think this change is a great fit for a compile-to-JS language overall. If you are interested in the details, have a look at the corresponding [forum post](https://forum.rescript-lang.org/t/uncurried-by-default/) and its comments.
+
+We hope that this new way of writing ReScript will make it both easier for beginners and also more enjoyable for the seasoned developers.
+
+As always, we're eager to hear about your experiences with our new features. Feel free to share your thoughts and feedback with us on our [issue tracker](https://github.com/rescript-lang/rescript/issues) or on the [forum](https://forum.rescript-lang.org).
+
+Happy hacking!
diff --git a/_blogposts/2024-01-11-release-11-0-0.mdx b/_blogposts/2024-01-11-release-11-0-0.mdx
new file mode 100644
index 000000000..eef0dd5de
--- /dev/null
+++ b/_blogposts/2024-01-11-release-11-0-0.mdx
@@ -0,0 +1,152 @@
+---
+author: rescript-team
+date: "2024-01-11"
+previewImg: /static/blog/compiler_release_11_0.jpg
+title: ReScript 11.0
+badge: release
+description: |
+ The ReScript developer experience now goes up to eleven!
+---
+
+Almost a year after the last release, ReScript is available in version 11! It marks the second major community-driven release and we are very thankful that there are so many willing contributors who invested their spare time into improving the compiler and its ecosystem.
+
+Use your favorite package manager to install the new compiler release, e.g.:
+
+```sh
+npm install rescript@11
+```
+
+To upgrade your project or to find out if there are any breaking changes that affect you, please follow the [migration guide](/docs/manual/latest/migrate-to-v11).
+
+The complete list of changes can be found [here](https://github.com/rescript-lang/rescript/blob/v11.0.0/CHANGELOG.md). Let's have a look at the most notable improvements.
+
+## Highlights
+
+**Note**: As this release is packed, please refer to the linked blogposts for a detailed breakdown of each of the main new features.
+
+### Customizable Variants
+
+We are introducing new features that will improve interop with JavaScript/TypeScript, including customizable runtime representation of variants, zero cost bindings to discriminated unions, and unboxed variants that can be used to map to things like heterogenous array items and nullable values.
+
+- Blogpost: [Better interop with customizable variants](/blog/improving-interop)
+
+### Enhanced Ergonomics for Record Types
+
+New enhancements for record types: Record Type Spread and Record Type Coercion. Record Type Spread allows one to share subsets of record fields with other record types, making it easier to work with types with lots of fields. And Record Type Coercion makes it easier to safely to convert between records with the same set of fields (or a subset).
+
+- Blogpost: [Enhanced Ergonomics for Record Types](/blog/enhanced-ergonomics-for-record-types)
+
+### First-class Dynamic Import Support
+
+Another addition is first-class support for dynamic imports, which will allow developers to split up and load parts of the app code on demand as separate JS modules to prevent bundle bloat and reduce initial load times for applications.
+
+- Blogpost: [First-class Dynamic Import Support](/blog/first-class-dynamic-import-support)
+
+### Uncurried Mode
+
+This release is also introducing uncurried mode, which is a new default mode that compiles all dependencies as uncurried, and it aims to make it easier for newcomers to use the language.
+
+- Blogpost: [Uncurried Mode](/blog/uncurried-mode)
+
+### New Standard Library: ReScript Core
+
+[ReScript Core](https://github.com/rescript-lang/rescript-core) is ReScript's new standard library. It replaces the complete `Js` module as well as some of the more frequently used modules from `Belt` and is recommended to use with uncurried mode.
+
+The latest docs on [rescript-lang.org](/) already use it for the examples. Have a look at the new [RescriptCore API docs](/docs/manual/latest/api/core).
+
+## More Features
+
+Furthermore, there are a lot of smaller improvements of which we want to state only a few here.
+
+### More types eligible for type coercion
+
+The `:>` (type coercion) operator now supports a few more datatypes, check out its [Syntax Lookup](/syntax-lookup#type-coercion) page.
+
+### Build System
+
+The watcher can now be called with just `rescript -w`. Also `rescript build` will always build with dependencies by default so the argument `-with-deps` is not needed anymore.
+
+### rescript.json
+
+The compiler config file has been renamed to `rescript.json`. Since the rebrand from `BuckleScript` to `ReScript`, the `bs-` names make no sense anymore. Later on, we will also rename some of the config attributes, like `bs-dependencies`.
+
+### Relaxed Suffix Rules
+
+You can now freely choose the suffix of the generated JS files. We recommend `.res.js`/`.res.mjs` which is also what our official templates in [`create-rescript-app`](#create-rescript-app) are using.
+
+### Opening files from current project globally
+
+It's now possible to have a module opened by default that is just part of the current project. Previously, this only worked with dependencies or namespaced projects. For example, a file with the path `src/Utils.res` can be added to `bsc-flags` like so:
+
+```json
+{
+ "bsc-flags": ["-open Utils"]
+}
+```
+
+## Ecosystem
+
+### Create-ReScript-App
+
+Previously, the ReScript binary was able to initialize new projects itself. But it was required to have a global npm install to use it. This functionality has been removed.
+
+Going forward, `create-rescript-app` is the new recommended way to setup a new project. It can even be used to quickly add ReScript to an existing project. Have a look at the updated [installation instructions](/docs/manual/latest/installation) for how to use it.
+
+### ReScript-React v0.12
+
+In tandem with the new ReScript release, a new version of ReScript-React is released as well. It brings support for dynamically loading React components via `React.lazy`, and more. Check out the [corresponding docs](/docs/react/latest/installation).
+
+### ReScript Tools / Documentation Extraction
+
+There is a new experimental tool available that is a building block for documentation generation from ReScript files. It can be installed and used as follows:
+
+```sh
+npm install --save-dev @rescript/tools
+npx rescript-tools doc src/MyFile.res > doc.json
+```
+
+The tool generates a JSON structure with all the information you need to generate documentation automatically for your ReScript code. It also comes with ReScript bindings for that JSON. Shortly we'll also have automatic markdown generation, and we're planning a static site generator as well, so getting a nice looking and useful documentation site for your ReScript code is just a command away.
+
+### LSP
+
+Our LSP powers our editor tooling. Historically, it has lived within the VSCode extension. This has been a problem for people who do not use VSCode. So, we've made sure that each new LSP version is [published standalone to NPM](https://www.npmjs.com/package/@rescript/language-server).
+
+This makes using an up-to-date version of the LSP in other editors than VSCode much easier. You can install and use it like so:
+
+```sh
+npm install -g @rescript/language-server
+npx rescript-language-server --stdio
+```
+
+## What's next
+
+As we now finish up the work on v11, we're looking forward to working on the next ReScript version. Here are some of the features we're planning to focus on in upcoming versions:
+
+- Make JSX usable beyond React:
+ - [Generic JSX transform](https://github.com/rescript-lang/rescript/issues/6408)
+ - [JSX preserve mode](https://github.com/rescript-lang/rescript/issues/6197)
+- Integrate the Rescript Core standard library into the compiler
+ - remove the OCaml standard library
+ - remove `Belt` but keep it available as external package
+- Make maintaining TS libraries with ReScript a breeze, [thanks to genType](https://github.com/rescript-lang/rescript/issues/6210)
+- Support [tagged template literals](https://github.com/rescript-lang/rescript/pull/6250)
+- [Dedicated syntax for creating Dicts](https://github.com/rescript-lang/rescript/issues/6545)
+- [Array spread syntax](https://github.com/rescript-lang/rescript/issues/6546)
+- A [new custom build system](https://github.com/rolandpeelen/rewatch) with better support for workspaces / monorepos
+- More improvements to the type system
+
+## Acknowledgements
+
+We want to thank everyone from the community who volunteered their precious time to support this project with contributions of any kind, from documentation, to PRs, to discussions in the forum.
+
+## That's it
+
+We hope you enjoy the newest improvements as much as we do.
+
+In case of issues / problems, make sure to report bugs to one of the following repositories:
+
+- [rescript-lang/rescript](https://github.com/rescript-lang/rescript) (language / syntax / jsx)
+- [rescript-lang/rescript-react](https://github.com/rescript-lang/rescript-react) (React bindings)
+- [rescript-lang/rescript-vscode](https://github.com/rescript-lang/rescript-vscode) (VSCode language support, LSP, tools)
+- [rescript-lang/create-rescript-app](https://github.com/rescript-lang/create-rescript-app) (project generator) or
+- [rescript-association/rescript-lang.org](https://github.com/rescript-lang/rescript-lang.org) (documentation)
diff --git a/_blogposts/2024-02-01-release-11-1-0.mdx b/_blogposts/2024-02-01-release-11-1-0.mdx
new file mode 100644
index 000000000..e9823dda4
--- /dev/null
+++ b/_blogposts/2024-02-01-release-11-1-0.mdx
@@ -0,0 +1,267 @@
+---
+author: rescript-team
+date: "2024-04-19"
+previewImg: /static/blog/compiler_release_11_1.jpg
+title: ReScript 11.1
+badge: release
+description: |
+ Unleashing ReScript from React
+---
+
+At the beginning of the year, the ReScript team [released ReScript 11.0](/blog/release-11-0-0), which laid ground work for a lot of possible improvements to make it easier to interact with the JavaScript ecosystem.
+
+This next minor has some wonderful additions to the ReScript toolbelt for you today.
+
+Use your favorite package manager to install the new compiler release, e.g.:
+
+```sh
+npm install rescript@11.1
+```
+
+Find a list of all the new features below:
+
+## JSX for more than React
+
+Historically, ReScript has focused mainly on React for its frontend support. This has led to ReScript having a great JSX transform built into the language itself. However, that JSX transform has been quite difficult to use with anything but React.
+
+With v11.1, that changes! The JSX transform can now be configured to work with any framework. First class React support is of course still the same, and remains a priority. This makes it possible to integrate any other framework's JSX idiomatically in ReScript. And, all the tooling like autocompletion of prop names and types just works.
+
+Many popular frameworks like [Vue](https://vuejs.org/) and [Preact](https://preactjs.com/) use JSX. But, JSX is also becoming more and more ubiquitous, and these days JSX can also be used for everything from building CLI apps to responsive e-mail templating. We're happy that ReScript users will now be able to leverage all of these innovations in a more idiomatic way than before.
+
+Here's an example of what a Preact integration could look like:
+
+```rescript
+// Greet.res
+
+// @jsx.component works the same as @react.component does in React
+@jsx.component
+let make = (~name) => {
+
+ {Preact.string("Hello " ++ name)}
+
+}
+```
+
+Read more in the [new documentation on the generic JSX transform](/docs/manual/latest/jsx#generic-jsx-transform-jsx-beyond-react-experimental).
+
+## Tagged template literals
+
+This release comes with support for [tagged templates](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#tagged_templates).
+
+A tag function in JavaScript is a function that expects an array of strings and variadic parameters as input. Now it's possibe to bind to such functions with the new [`@taggedTemplate`](/syntax-lookup#taggedTemplate-decorator) decorator:
+
+
+
+```rescript
+// see https://bun.sh/docs/runtime/shell
+type result = {exitCode: int}
+@module("bun") @taggedTemplate
+external sh: (array, array) => promise = "$"
+
+let filename = "index.res"
+let result = await sh`ls ${filename}`
+```
+
+```js
+var $$Bun = require("bun");
+
+var filename = "index.res";
+
+var result = await $$Bun.$`ls ${filename}`;
+```
+
+
+
+Of course you can also create your own tag function in ReScript now as well, it is just a function with the following signature.
+
+```rescript
+let myTagFunction : (array, array<'param>) => 'output
+```
+
+Refer to the docs to find a [detailed example](/docs/manual/latest/tagged-templates).
+
+## Import attributes
+
+Import attributes is a JS feature that is [currently in standardization](https://github.com/tc39/proposal-import-attributes), but is already implemented by many JS tools. Now, ReScript supports it too, as long as the compiler is configured to output ES6.
+
+
+
+```res
+@module({from: "./myJson.json", with: {type_: "json", \"some-identifier": "yep"}})
+external myJson: Js.Json.t = "default"
+Console.log(myJson)
+
+@module({from: "./myCss.css", with: {type_: "css", \"some-identifier": "yep"}})
+external buttonCss: string = "button"
+Console.log(buttonCss)
+```
+
+```js
+import * as MyCssCss from "./myCss.css" with { type: "css", "some-identifier": "yep" };
+import MyJsonJson from "./myJson.json" with { type: "json", "some-identifier": "yep" };
+
+var myJson = MyJsonJson;
+console.log(myJson);
+
+var buttonCss = MyCssCss.button;
+console.log(buttonCss);
+```
+
+
+
+## BigInt support
+
+ReScript now natively supports [JavaScript's `bigint` type](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt).
+
+
+
+```res example
+open! Js.BigInt
+
+let a = 9007199254740991n + 9007199254740991n
+let b = 2n ** 2n
+```
+
+```js
+var a = 9007199254740991n + 9007199254740991n;
+
+var p = 2n ** 2n;
+```
+
+
+
+See [big integer docs](https://rescript-lang.org/docs/manual/latest/primitive-types#big-integers-experimental) for more.
+
+## Array spread syntax
+
+The spread syntax, which was already supported for records and lists for a long time, now also supports arrays!
+
+```rescript
+let animals = ["🐶", "🐱", "🐷"]
+let moreAnimals = [...animals, "🐔", "🐴", "🐮"]
+```
+
+## Hyphens in JSX tag names
+
+We lifted restrictions on JSX tag names. This means you no longer need to escape tag names that contain hyphens:
+
+Previously:
+
+```rescript
+let x = <\"custom-tag" />
+```
+
+Now:
+
+```rescript
+let x =
+```
+
+This is particularly useful when dealing with [web components](https://developer.mozilla.org/en-US/docs/Web/API/Web_components), where element names tend to use hyphens.
+
+## Omit trailing undefined in external function calls
+
+ReScript 11's uncurried mode allows for much more ergonomic external function bindings, because trailing units are not needed anymore. But, this comes with a potential problem. All arguments, whether they're actually supplied or not, were printed as `undefined` in the resulting JS. This is handled better now, as trailing `undefined`s are automatically omitted.
+
+
+
+```res
+@val
+external stringify: (
+ 'a,
+ ~replacer: (string, JSON.t) => JSON.t=?,
+ ~space: int=?,
+) => string = "JSON.stringify"
+
+let obj = {"test": 1}
+
+let result = stringify(obj)
+
+let result2 = stringify(obj, ~space=2)
+```
+
+```js
+var obj = {
+ test: 1,
+};
+
+var result = JSON.stringify(obj, undefined, undefined);
+
+var result2 = JSON.stringify(obj, undefined, 2);
+```
+
+```js
+var obj = {
+ test: 1,
+};
+
+var result = JSON.stringify(obj);
+
+var result2 = JSON.stringify(obj, undefined, 2);
+```
+
+
+
+## %todo and warn-error
+
+Inspired by languages like [Elm](https://package.elm-lang.org/packages/elm/core/latest/Debug#todo) or [Gleam](https://tour.gleam.run/advanced-features/todo/), we introduced a new extension point: [`%todo`](/syntax-lookup#todo).
+
+It is used to tell the compiler that some code still needs to be implemented and it will crash when executed.
+
+
+
+```res
+let implementMeLater = (): string => %todo("This should return a string eventually.")
+
+let x = implementMeLater()
+
+Console.log(x->String.includes("x"))
+```
+
+```js
+var Js_exn = require("./stdlib/js_exn.js");
+
+function implementMeLater() {
+ return Js_exn.raiseError(
+ "playground.res:1:37-42 - Todo: This should return a string eventually.",
+ );
+}
+
+var x = Js_exn.raiseError(
+ "playground.res:1:37-42 - Todo: This should return a string eventually.",
+);
+
+console.log(x.includes("x"));
+```
+
+
+
+We also made the compiler's `-warn-error` flag accessible by the build system, so that `%todo`s and other warnings can be turned into errors in production builds.
+
+```sh
+rescript -warn-error +110
+```
+
+See ["Compile with stricter errors in CI"](/docs/manual/latest/build-overview#compile-with-stricter-errors-in-ci).
+
+## Other changes
+
+Of course we also got a bunch of other changes and bug fixes in this release. Check out the [compiler changelog](https://github.com/rescript-lang/rescript/blob/11.0_release/CHANGELOG.md#1110-rc1) if you are interested.
+
+## v12 is next
+
+v11.1 marks the completion of the v11 versions feature wise. We will of course continue to support the v11 release series with bug fixes and other important updates. However, our focus for new feature development will move to v12. You'll hear more about v12 and the plans for that version soon.
+
+## Acknowledgements
+
+Once again we want to thank everyone from the community who volunteered their precious time to support this project with contributions of any kind, from documentation, to PRs, to discussions in the forum. But especially we want to thank the following people, who helped landing this release:
+
+[@aspeddro](https://github.com/aspeddro), [@cknitt](https://github.com/cknitt), [@cometkim](https://github.com/cometkim), [@cristianoc](https://github.com/cristianoc), [@diogomqbm](https://github.com/diogomqbm), [@enzo-pellegrini](https://github.com/enzo-pellegrini), [@fhammerschmidt](https://github.com/fhammerschmidt), [@glennsl](https://github.com/glennsl), [@JonoPrest](https://github.com/JonoPrest), [@mununki](https://github.com/mununki), [@kevinbarabash](https://github.com/kevinbarabash), [@shulhi](https://github.com/shulhi), [@tsnobip](https://github.com/tsnobip), [@zth](https://github.com/zth).
+
+## That's it
+
+We hope you enjoy the newest improvements as much as we do.
+
+If you find any problems with this new release, make sure to report them here:
+
+- [rescript-lang/rescript](https://github.com/rescript-lang/rescript/issues/new/choose)
diff --git a/_blogposts/2025-03-05-what-can-i-do-with-rescript.mdx b/_blogposts/2025-03-05-what-can-i-do-with-rescript.mdx
new file mode 100644
index 000000000..1ccae34ef
--- /dev/null
+++ b/_blogposts/2025-03-05-what-can-i-do-with-rescript.mdx
@@ -0,0 +1,154 @@
+---
+author: josh-derocher-vlk
+date: "2025-03-05"
+title: What can I do with ReScript?
+badge: community
+description: |
+ Can I use Vite, or Next.js? Is it only for React? Can I use Node or Deno?
+---
+
+You've taken a look and ReScript and you want to try it out, but how do you get started? There's the [installation](/docs/manual/latest/installation) page in the docs,
+which is great if you want to set up a new React app using [create-rescript-app](https://github.com/rescript-lang/create-rescript-app). There's instructions on how to add it to an existing project or set it up manually.
+But that doesn't really answer the question "Can I use this with X?".
+
+## You can use ReScript anywhere you can use JavaScript
+
+ReScript is just a language that compiles to JavaScript. Unlike other language like [Elm](https://elm-lang.org/) or [PureScript](https://www.purescript.org/) ReScript doesn't have a recommended framework or independent ecosystem, it's just part of the normal JavaScript world.
+
+Here's a really basic example that you can run in Node after compiling:
+
+```res
+// index.res
+Console.log("Hello")
+```
+
+Just run `node index.res.js` and you'll see "Hello" logged to the console. You can import compiled ReScript into any project that could import JavaScript.
+If you can use `.js` or `.mjs` files, you can use ReScript. This does mean that languages with different file formats like Vue or Svelte require you to import the compiled JavaScript instead of writing it directly in the `.vue` or `.svelte` files.
+
+Real world projects are more than JavaScript files that you write; they use libraries and frameworks. This is where [bindings](/docs/manual/latest/external) come into play.
+A binding is a way to tell ReScript the types and imports from external JavaScript. You can think of bindings in the same way that you need to create a `*.d.ts` file to add types to a JavaScript library that doesn't use TypeScript.
+
+ReScript has great integration with [React](/docs/react/latest/introduction) and those bindings are kept up to date by the core team, but that doesn't mean you don't have other options!
+
+## Using existing bindings
+
+While ReScript isn't as large as TypeScript it has a small but growing list of bindings you can find on NPM. The website has a [package explorer](/packages) you can use to find official and community maintained bindings.
+Many major libraries have existing bindings. Here's a small set of what you can find.
+
+- [Node](https://github.com/TheSpyder/rescript-nodejs)
+- [Material UI](https://github.com/cca-io/rescript-mui)
+- [Bun](https://github.com/zth/rescript-bun)
+- [Deno](https://github.com/tsirysndr/rescript-deno)
+- [Deno's Fresh](https://github.com/jderochervlk/rescript-fresh)
+- [Vitest](https://github.com/cometkim/rescript-vitest)
+- [Rxjs](https://github.com/noble-ai/rescript-rxjs)
+- [React Helmet](https://github.com/MoOx/rescript-react-helmet)
+- [Jotai](https://github.com/Fattafatta/rescript-jotai)
+- [Headless UI](https://github.com/cbowling/rescript-headlessui)
+
+## Using libraries and frameworks created for ReScript
+
+Bindings are great if you want to work with libraries written with JavaScript, but there are great options for libraries and frameworks written with ReScript, which means you don't need bindings.
+
+- [ReScript Schema](https://github.com/DZakh/rescript-schema) - The fastest parser in the entire JavaScript ecosystem with a focus on small bundle size and top-notch DX.
+- [rescript-relay](https://github.com/zth/rescript-relay) - This is an amazing way to connect React to Relay and GraphQL
+- [rescript-rest](https://github.com/DZakh/rescript-rest) - Fully typed RPC-like client, with no need for code generation!
+- [rescript-edgedb](https://github.com/zth/rescript-edgedb) - Use EdgeDB fully type safe in ReScript. Embed EdgeQL right in your ReScript source code.
+- [ResX](https://github.com/zth/res-x) - A ReScript framework for building server-driven web sites and applications.
+
+## Creating your own bindings
+
+At some point you will probably have to use a library that doesn't have bindings available. Asking on the [forum](https://forum.rescript-lang.org/) is a great place to start. Someone else might have bindings already in a project that they just haven't published to NPM.
+You can also get help and guidance on how to write bindings for what you need. Usually you can figure out what you need from looking at a libraries official docs.
+You don't need to write bindings for an entire library, or even for all of a functions arguments. Just write what you need as you go.
+
+Let's take a look at the `format` function from [date-fns](https://date-fns.org/). We can see the [arguments in the docs](https://date-fns.org/v4.1.0/docs/format#arguments), and how it should be imported and used.
+
+```ts
+// type signature
+function format(
+ date: string | number | Date,
+ formatStr: string,
+ options?: FormatOptions,
+): string;
+
+// how it's imported
+import { format } from "date-fns";
+
+// how it's used
+const result = format(new Date(2014, 1, 11), "MM/dd/yyyy");
+```
+
+That's all we need to know to write bindings to use this function in ReScript.
+The first thing we need to figure out is how to handle the type for what `date-fns` considers to be a `date`, which is `Date | string | number`. In ReScript things can't just be of different types like they can in JavaScript or TypeScript. There are a couple options here; you can make a function for each type such as `formatString` and `formatDate`, or you can create a [variant type](/docs/manual/latest/variant) to map to the possible input types.
+Creating a function for each type is simpler, and it's most likely how you will use the library in your project. You probably have a standard type for Dates already. We'll also need a type for `FormatDateOptions` in case we want to pass options. We'll use [labeled argmuments](/docs/manual/latest/function#labeled-arguments) for our binding.
+
+```res
+// DateFns.res - you might want to put this in a folder called "bindings" or "external"
+type formatDateOptions // we're not even going to add anything to this yet until we need something
+
+@module("date-fns") // this is the import path for the module
+external formatString: (
+ ~date: string, // the date string
+ ~formatStr: string, // how we want it formatted
+ ~options: formatDateOptions=?, // =? means the argument is optional
+) => string = "format" // "format" is the name of the function we are importing from the module
+```
+
+Now we can use the function!
+
+
+```res
+let formattedDate = DateFns.formatString(~date="2021-09-01", ~formatStr="MMMM dd, yyyy")
+```
+
+```js
+import * as DateFns from "date-fns";
+
+var formattedDate = DateFns.format("2021-09-01", "MMMM dd, yyyy");
+```
+
+
+
+If we need to use `FormatDateOptions` we can add to our type definition as needed. The first option is `firstWeekContainsDate` which can either be `1` or `4`.
+Here's how we could write bindings for that.
+
+```res
+@unboxed
+type firstWeekContainsDate =
+ | @as(1) One
+ | @as(4) Four
+
+type formatDateOptions = {firstWeekContainsDate: firstWeekContainsDate}
+```
+
+And when we use it it will output either `1` or `4`.
+
+
+```res
+let formattedDate = formatString(
+ ~date="2021-09-01",
+ ~formatStr="MMMM dd, yyyy",
+ ~options={firstWeekContainsDate: Four},
+)
+```
+
+```js
+import * as DateFns from "date-fns";
+
+var formattedDate = DateFns.format("2021-09-01", "MMMM dd, yyyy", {
+ firstWeekContainsDate: 4,
+});
+```
+
+
+
+You can write new bindings and extend existing types as you need.
+
+## How can I get started?
+
+You can [follow this guide](/docs/manual/v11.0.0/converting-from-js) to add ReScript to an existing JavaScript project to get a feel for how the language works and interacts with JavaScript.
+The forum is also a great place to ask questions! Feel free to drop by and ask how to get started with a specific framework or project that you want to work on,
+and you'll probably get great advice and information from users who have already used ReScript for something similar.
+
+Happy coding!
diff --git a/_blogposts/2025-03-17-retreats.mdx b/_blogposts/2025-03-17-retreats.mdx
new file mode 100644
index 000000000..e61a24179
--- /dev/null
+++ b/_blogposts/2025-03-17-retreats.mdx
@@ -0,0 +1,100 @@
+---
+author: rescript-association
+date: "2025-03-17"
+previewImg: /static/blog/rescript_retreat_2024.jpg
+articleImg: /static/blog/rescript_retreat_2024.jpg
+title: ReScript Retreat
+description: |
+ Accelerating ReScript development through meeting in-person.
+---
+
+ReScript is exclusively developed by volunteers. Some help out in their free time, some are lucky to do it in their work time, but overall there is no single developer who exclusively works full-time on the advancement of the ReScript project.
+
+That's not unusual for many open-source projects, but we want to be sustainable long-term. One way to not only accelerate development but also improve collaboration between contributors is to meet together in-person and hack on things. In this article, we explain what usually happens on such a "Retreat".
+
+Last year, from the 23rd to the 26th of May, the ReScript Association invited many contributors to hack on ReScript. In the end almost all of them responded to the invitation and thus, 15 people from all over the world traveled to Vienna, Austria to meet in person, to do talks, discussions and decisions about and contributions to the ReScript toolchain.
+
+## Talks
+
+
+
+Not everybody is on the same level of knowledge about the parser, compiler or other tools. Talks are a great way to get to a better collective understanding before the real work gets started. In 2024 we had the following talks:
+
+- Brief overview of parser development, by Maxim Valcke ([@\_binary_search](https://x.com/_binary_search))
+- Intro to compiler development, by Cristiano Calcagno ([@ccrisccris](https://x.com/ccrisccris))
+ - The full talk is also available here: [Youtube Link](https://youtu.be/sQinTXDynew?si=AihxJBQDEyzMCvFz).
+- Talk about editor tooling, by Gabriel Nordeborn ([@\_\_\_zth\_\_\_](https://x.com/___zth___))
+
+## Group work
+
+
+
+Our contributors split up in multiple small groups of 2-4 people. Every group had a specific topic assigned:
+
+- New Build System (Codename rewatch)
+- rescript-lang.org Playground Output
+- ReScript Core and how to include it in the compiler
+- loops, foreach, iterators
+- Syntax, JSX
+
+## Discussions
+
+We also did group discussions about how to elevator pitch ReScript and about ReScript's roadmap.
+
+The full results of this discussions and the group work can be read at the ReScript forum: https://forum.rescript-lang.org/t/ann-rescript-retreat-roadmap-summary-2024/5275. But that is the past, have a look at the following section to see how far we have come:
+
+### Results
+
+Almost a year later, most of the initiatives started at the retreat have either been completed or significantly advanced in development.
+
+- We moved the new "Core" standard library into the compiler. Only needs some minor tweaks and documentation.
+- We are getting closer to making "rewatch" our new main build system, with many improvements and fixes already in place.
+- We merged first-class `RegExp` syntax.
+- We merged support for pattern-matching on `dict`s.
+- We removed curried mode.
+- We removed `.ml` compilation support.
+- Based on the above and other cleanups we were able to introduce a new abstract syntax tree which will allow for cleaner language design. Of course a compatibility layer is available.
+
+And more. But that's material for another release blog post.
+
+## Food, Drinks and Leisure
+
+After every hard working day, we finished the day with a nice dinner.
+For instance, one day we gathered together at a viennese winery in the evening.
+
+
+
+At the last day we of course also did some city sightseeing and enjoyed a final Viennese lunch.
+
+## Conclusion
+
+After the retreat, most participants stated that they want to do it again and overall it was a very productive but also fun event for all of us. And we are happy to announce that there will be a ReScript Retreat in 2025, from the 3rd - 6th of May, once again in Vienna, Austria. And a similar number of participants will attend.
+
+## Our Sponsors
+
+
+
+The [ReScript Association](https://rescript-association.org/) paid for all the participants hotel rooms and some of the lunches and dinners. We worked at a coworking space which was paid for by the Vienna-based company [cca.io](https://www.cca.io/), which also happens to employ two of our contributors.
+
+## Acknowledgements
+
+We want to thank all contributors who are so invested into this language that they don't hesitate to travel the globe, some even with their families. Thank you so much!
+
+[@bloodyowl](https://github.com/bloodyowl), [@cknitt](https://github.com/cknitt), [@cometkim](https://github.com/cometkim), [@cristianoc](https://github.com/cristianoc), [@fhammerschmidt](https://github.com/fhammerschmidt), [@glennsl](https://github.com/glennsl), [@IwanKaramazow](https://github.com/IwanKaramazow), [@jfrolich](https://github.com/jfrolich), [@JonoPrest](https://github.com/JonoPrest), [@mununki](https://github.com/mununki), [@rolandpeelen](https://github.com/rolandpeelen), [@ryyppy](https://github.com/ryyppy), [@shulhi](https://github.com/shulhi), [@tsnobip](https://github.com/tsnobip), [@zth](https://github.com/zth).
diff --git a/_blogposts/2025-04-11-introducing-unified-operators.mdx b/_blogposts/2025-04-11-introducing-unified-operators.mdx
new file mode 100644
index 000000000..5e7a85646
--- /dev/null
+++ b/_blogposts/2025-04-11-introducing-unified-operators.mdx
@@ -0,0 +1,268 @@
+---
+author: rescript-team
+date: "2025-04-11"
+title: "Rethinking Operators"
+badge: roadmap
+description: |
+ Discover how unified operators in ReScript v12 simplify arithmetic, reduce syntax noise — plus, a glimpse into the future roadmap.
+---
+
+## Introduction
+
+In the upcoming ReScript v12, we're upgrading common arithmetic operators to "Unified Operators".
+
+This means that we can now use a single infix operator syntax for multiple numeric types, and even for string concatenation.
+
+```res
+let addInt = 1 + 2
+let addFloat = 1.0 + 2.0
+let concatString = "Hello" + ", World!"
+```
+
+[Try in the playground](https://rescript-lang.org/try?version=v12.0.0-alpha.5&module=esmodule&code=DYUwLgBAhgJjCSA7SBeCBGCBqCAmAUKJLDAGLAD2UqGAdAAzZ4OHgQDGFi71AymACcAlogDmENACIAEiGCVJTSQBoIAdQoDgMAIST8QA)— it just works since `v12.0.0-alpha.5`. We don't need `+.` and `++` anymore. 🥳
+
+This post covers both the reasoning behind the change and what’s next on the roadmap. If you're interested in the implementation details, you’ll find them in [the pull request](https://github.com/rescript-lang/rescript/pull/7057).
+
+## Problems in operators
+
+Until v12, the operator syntax had a few notable problems.
+
+### Unwanted syntax gap
+
+Using different operators for each type is unfamiliar to JavaScript users, and the lack of operator overloading can feel strange to most programmers.
+
+This is tricky in the real world. Because JavaScript's default number type is `float`, not `int`, ReScript users have to routinely deal with awkward syntax like `+.`, `-.`, `*.`, `%.`.
+
+Some operators are available only as functions. Instead of `<<` and `>>`, we use unfamiliar names like `lsl` and `asr`.
+
+### Infix explosion 💥
+
+ReScript has multiple "add operator" syntaxes for every primitive type.
+
+```res
+let addInt = 1 + 2
+let addFloat = 1.0 +. 2.0
+let concatString = "Hello" ++ ", World!"
+```
+
+We ran into the same issue again when we added `bigint` support.
+
+What other operator syntax could we introduce to add two bigint values? There were suggestions like `+,`, `+!`, `+n`, but the team never felt confident in any of them, so we just hid them inside the `BigInt` module definition instead of introducing new syntax.
+
+It was inconvenient because we had to shadow the definition every time.
+
+```res
+let addBigInt = {
+ open BigInt!
+ 1n + 2n
+}
+```
+
+Every time we introduce a new primitive type (who knows?), we run into the same issue with all arithmetic operators.
+
+### Hidden risk of polymorphism
+
+So why don’t we just use the same pretty operators everywhere, like in JavaScript?
+
+```res
+let compareInt = (a: int, b) => a < b
+
+let compareFloat = (a: float, b) => a < b
+```
+
+```js
+function compareInt(a, b) {
+ return a < b;
+}
+
+function compareFloat(a, b) {
+ return a < b;
+}
+```
+
+And this won't be compiled
+
+```res
+let compareNumber = (a: int, b: float) => a < b
+// ~
+// [E] Line 1, column 46:
+// This has type: float
+// But it's being compared to something of type: int
+//
+// You can only compare things of the same type.
+//
+// You can convert float to int with Belt.Float.toInt.
+// If this is a literal, try a number without a trailing dot (e.g. 20).
+```
+
+Because ReScript only intentionally supports monomorphic operations, `(int, int) => int` in this case. Users have to perform type conversions explicitly where necessary.
+
+While it's tempting to allow full operator overloading or polymorphism like JavaScript or TypeScript, we intentionally avoid it to preserve predictable type inference and runtime performance guarantees.
+
+However, comparisons are actually the exception. Time to summon polymorphism!
+
+```res
+let comparePoly = (a, b) => a < b
+```
+
+```js
+import * as Primitive_object from "./stdlib/Primitive_object.js";
+
+let comparePoly = Primitive_object.lessthan;
+```
+
+As both operands `a` and `b` are inferred as "open type", it turned it into a "runtime primitive" that takes any type and performs a struct comparison at runtime.
+
+This is a design decision to support comparisons for arbitrary record or tuple types, but it is not ideal. The runtime primitive is not well optimized and too expensive for common arithmetic operations.
+
+## Unified operators
+
+Unlike polymorphic operators, unified operators don't use runtime primitives at all. Instead, they modify the compiler to translate specific operators to existing compile-time primitives.
+
+More specifically, the following rules are added to the primitive translation process.
+
+> Before handling a primitive, if the primitive operation matches the form of `lhs -> rhs -> result` or `lhs -> result`
+>
+> 1. If the `lhs` type is a primitive type, unify the `rhs` and the `result` type to the `lhs` type.
+> 2. If the `lhs` type is not a primitive type but the `rhs` type is, unify `lhs` and the `result` type to the `rhs` type.
+> 3. If both `lhs` type and `rhs` type is not a primitive type, unify the whole types to the `int`.
+
+It changes the type inference like
+
+```res
+let t1 = 1 + 2 // => (int, int) => int
+let t2 = 1. + 2. // => (float, float) => float
+let t3 = "1" + "2" // => (string, string) => string
+let t4 = 1n + 2n // => (bigint, bigint) => bigint
+
+let fn1 = (a, b) => a + b // (int, int) => int
+let fn2 = (a: float, b) => a + b // (float, float) => float
+let fn3 = (a, b: float) => a + b // (float, float) => float
+
+let inv1 = (a: int, b: float) => a + b // => (int, int) => int
+// ^ error: cannot apply float here, expected int
+```
+
+Then, in IR, it is translated to the corresponding compile-time primitive based on the unified type.
+
+This approach is inspired by the awesome language [F#](https://learn.microsoft.com/en-us/dotnet/fsharp/language-reference/symbol-and-operator-reference/arithmetic-operators#operators-and-type-inference), which also originates from OCaml.
+
+> The use of an operator in an expression constrains type inference on that operator. Also, the use of operators prevents automatic generalization, because the use of operators implies an arithmetic type. In the absence of any other information, the F# compiler infers `int` as the type of arithmetic expressions.
+
+The rules are limited to only specific primitive types and operators. Perhaps this seems inflexible since it is an ad hoc rule and not part of the formal type system.
+
+But this is enough for us as it practically improves our DX while being **100% backward compatible**.
+
+## Further improvements
+
+The unified operators are already a huge DX improvement for ReScript users — but there’s even more to come!
+
+### Reduced internal complexity
+
+By normalizing how primitive operators are added and managed, it also lowers maintenance overhead. A couple of new operators are actually being added by new community contributors [@MiryangJung](https://github.com/MiryangJung) and [@gwansikk](https://github.com/gwansikk)
+
+### Support most JavaScript operators
+
+We are working to support more unified operators to close the syntax gap with JavaScript.
+
+In ReScript v12, most familiar JavaScript operators should work as-is — not just arithmetic operators, but also bitwise and shift operators.
+
+- Remainder operator (`%`) - [#7152](https://github.com/rescript-lang/rescript/pull/7152)
+- Exponentiation operator (`**`) - [#7153](https://github.com/rescript-lang/rescript/pull/7153)
+- Bitwise operators (`~`, `^`, `|`, `&`) - [#7172](https://github.com/rescript-lang/rescript/issues/7172)
+- Shift operators (`<<`, `>>`, `>>>`) - [#7171](https://github.com/rescript-lang/rescript/issues/7171)
+
+### The future of comparison operators
+
+The comparison behavior described above has not changed. The comparability of records and tuples is useful when dealing with data structures. However, relying on the runtime type information is not an ideal solution.
+
+Since record types are much broader than primitive types, we need a new approach beyond the unified operators.
+
+This won't be included in the v12 release, but we'd like to share an idea we're exploring. Imagine Rust's `#[derive(Eq)]` but for ReScript. As the compiler fully understands the structure of each record type, it can generate optimized code for each type.
+
+```res
+@deriving([compare, equals])
+type person = {
+ name: string,
+}
+
+// Implicitly derived unified comparison operators for the `person` type.
+external \"person$compare": (person, person) => int = "%compare"
+external \"person$equals": (person, person) => bool = "%equals"
+```
+
+```javascript
+function person$compare(a, b) {
+ return a.name.localeCompare(b.name);
+}
+
+function person$equals(a, b) {
+ return a.name === b.name;
+}
+```
+
+Then, the compiler performs the same specialization used in unified operators and generates code where the comparison operation is used. So `(a :> person) < b` is expected to be `person$compare(a, b) < 0` or fully inlined as it is less complex than a certain threshold.
+
+The example is over-simplified, but it should work equally well with more complex, nested structures or sum types.
+
+One possible use case for generated comparison operators is React apps. Using complex types in production apps can result in significant performance degradation, as ReScript ADTs are not compatible with React's memoization behavior.
+
+```res
+module MyComponent = {
+ type payload = {
+ // ...
+ }
+
+ type state =
+ | Idle(payload)
+ | InProgress(payload)
+ | Done(payload)
+
+ @react.component
+ let make = (~state: state) => <>>
+}
+
+let myElement =
+```
+
+Because `Idle(...)` creates a new object each time, React's built-in shallow equality check always fails.
+
+If ReScript generates an optimized shallow equality implementation, it could be used with `React.memo` like this:
+
+```res
+module MyComponent = {
+ type payload = {
+ // ...
+ }
+
+ type state =
+ | Idle(payload)
+ | InProgress(payload)
+ | Done(payload)
+
+ @deriving([shallowEquals])
+ type props = {
+ state: state,
+ }
+
+ let make = React.memoCustomCompareProps(
+ ({ state }) => <>>,
+
+ // It checks tag equality first.
+ // If the tags are the same, it checks shallow equality of their payload.
+ \"props$shallowEquals",
+ )
+}
+```
+
+The React component is now effectively memoized and more efficient than a hand-written component in TypeScript.
+
+## Conclusion
+
+Simplicity and conciseness remain ReScript's core values, but that doesn't necessarily mean we cannot improve our syntax.
+
+The unified operator fixes the most awkward parts of the existing syntax and lowers the barrier for JavaScript developers to adopt ReScript, bridging the gap between intuitive JavaScript syntax and ReScript’s strong type guarantees.
+
+We continue to explore the path to becoming the best-in-class language for writing high-quality JavaScript applications. We’d love to hear your thoughts — join the discussion on the forum or reach out on social media.
+
+Thanks for reading — and as always, happy hacking!
diff --git a/_blogposts/archive/2017-10-06-bucklescript-release-1-5-2.mdx b/_blogposts/archive/2017-10-06-bucklescript-release-1-5-2.mdx
index d35aceed1..d2d31bd1f 100644
--- a/_blogposts/archive/2017-10-06-bucklescript-release-1-5-2.mdx
+++ b/_blogposts/archive/2017-10-06-bucklescript-release-1-5-2.mdx
@@ -9,8 +9,7 @@ description: |
## Features
-1. [FFI: Unicode literal support](
- http://bucklescript.github.io/bucklescript/Manual.html#_unicode_support_since_1_5_1)
+1. [FFI: Unicode literal support](http://bucklescript.github.io/bucklescript/Manual.html#_unicode_support_since_1_5_1)
2. [FFI: Return value
checking](http://bucklescript.github.io/bucklescript/Manual.html#_return_value_checking_since_1_5_1)
3. [FFI: Detect global variable
diff --git a/_blogposts/archive/2017-10-07-bucklescript-release-1-7-0.mdx b/_blogposts/archive/2017-10-07-bucklescript-release-1-7-0.mdx
index b5eced4cb..baac0ca15 100644
--- a/_blogposts/archive/2017-10-07-bucklescript-release-1-7-0.mdx
+++ b/_blogposts/archive/2017-10-07-bucklescript-release-1-7-0.mdx
@@ -17,7 +17,7 @@ As a functional language, the vanilla OCaml only provides curried calling
convention, BuckleScript employs fairly [advanced
optimizations](http://bucklescript.github.io/bucklescript-playground/#Curry_Optimization)
for curried calling convention, however, the most efficient code is efficient
- code not relying on optimizations.
+code not relying on optimizations.
Since this release, we provide first class uncurried calling convention, _all
toolchains provided by BuckleScript_ can understand uncurried calling
@@ -64,8 +64,8 @@ function (`(. 'a) => 'b`) while `f` is still a curried function.
The compiler will also yield following JS output:
```js
-function f (g,x){
- return g (x)
+function f(g, x) {
+ return g(x);
}
```
@@ -76,7 +76,7 @@ Again, the code shows that...
### API documentation
-Now `ocamldoc` can understand `[@bs]` natively(instead of printing a desugared
+Now `ocamldoc` can understand `[@bs]` natively(instead of printing a desugared
output), we provide an [API
documentation](http://bucklescript.github.io/bucklescript/api/) for the library
shipped with BuckleScript, we plan to ship the documentation generator in next
@@ -98,13 +98,12 @@ See [Catch exception](/docs/manual/latest/exception)
See
[`bs.open`](http://bucklescript.github.io/bucklescript/Manual.html#__code_bs_open_code_type_safe_external_data_source_handling_since_1_7_0)
-
### ES6 support in Safari
See [fix es6 support in
browser](https://github.com/bucklescript/bucklescript/issues/1465)
-### `bs-dev-dependencies` support in the build system
+### `bs-dev-dependencies` support in the build system
See [build
schema](http://bucklescript.github.io/bucklescript/docson/#build-schema.json)
diff --git a/_blogposts/archive/2017-10-08-bucklescript-release-1-7-4.mdx b/_blogposts/archive/2017-10-08-bucklescript-release-1-7-4.mdx
index 08d07bdcd..3dfbdf449 100644
--- a/_blogposts/archive/2017-10-08-bucklescript-release-1-7-4.mdx
+++ b/_blogposts/archive/2017-10-08-bucklescript-release-1-7-4.mdx
@@ -23,14 +23,12 @@ npm install -g bs-platform && bsb -init hello && cd hello && npm run build
You can find more details in the
[manual](http://bucklescript.github.io/bucklescript/Manual.html#_using_existing_templates_since_1_7_4).
-
### Adding several modules to Js namespace, including Option, Result, List and Vector.
Note it is still work in progress, but these libraries are optimized for both
performance and size, they can provide an even smaller code size than current
case
-
You can also find a full list of changes in our
[Changelog](https://github.com/bucklescript/bucklescript/blob/master/Changes.md#bucklescript-174may-24-2017)
file.
diff --git a/_blogposts/archive/2017-10-09-bucklescript-release-1-7-5.mdx b/_blogposts/archive/2017-10-09-bucklescript-release-1-7-5.mdx
index b6a9307e6..424085001 100644
--- a/_blogposts/archive/2017-10-09-bucklescript-release-1-7-5.mdx
+++ b/_blogposts/archive/2017-10-09-bucklescript-release-1-7-5.mdx
@@ -18,7 +18,6 @@ allowed this amazing project to happen!
A detailed list of changes are listed as below:
-
### Fixes:
- #1676, `bsb -w` will always build regardless of filetype when fs.watch doesn't send a filename
@@ -26,9 +25,9 @@ A detailed list of changes are listed as below:
- #1658, fix typeof = "null" issue
- #1656, bs.get/set/get_index/set_index respects bs.ignore
- #1654, `bsb -init` fails if package or current dir has space (parent dir can have spaces)
-- #1678, bs.get{null;undefined} in object type
+- #1678, `bs.get{null;undefined}` in object type
- #1692, fix invalid js syntax output
-- #1701, fix tailcall handling interaction with exception handler
+- #1701, fix tailcall handling interaction with exception handler
- #1666, fix misue of GADT api
### Features:
diff --git a/_blogposts/archive/2018-03-13-a-small-step-for-bucklescript.mdx b/_blogposts/archive/2018-03-13-a-small-step-for-bucklescript.mdx
index a46579f06..993259e5e 100644
--- a/_blogposts/archive/2018-03-13-a-small-step-for-bucklescript.mdx
+++ b/_blogposts/archive/2018-03-13-a-small-step-for-bucklescript.mdx
@@ -6,7 +6,6 @@ title: A Small Step for BuckleScript...
description: ...and a big one for the community!
---
-
## Reason, Belt and the Community
BuckleScript is a compiler, a set of type system enhancements, a build system
@@ -33,8 +32,8 @@ appreciated, and we **will** do our best to stay open to feedback, more so that
we have ever done for the core compiler and build system. Belt's development
will have more of an open process; we'll be monitoring the issue list closely
for changes/features requests and tagging the them with Good First Task
- (contribution welcome). At the same time, we hope to clean up the
- repository's workflow a bit too, to ease future contributions.
+(contribution welcome). At the same time, we hope to clean up the
+repository's workflow a bit too, to ease future contributions.
Thank you for your continued support, and here's to a brighter future for
BuckleScript and Reason! Stay tuned for the first of several posts on Belt. See
diff --git a/_blogposts/archive/2018-04-16-bucklescript-release-3-0-0.mdx b/_blogposts/archive/2018-04-16-bucklescript-release-3-0-0.mdx
index 61fc05ca0..828cd09f1 100644
--- a/_blogposts/archive/2018-04-16-bucklescript-release-3-0-0.mdx
+++ b/_blogposts/archive/2018-04-16-bucklescript-release-3-0-0.mdx
@@ -23,10 +23,10 @@ description: |
potentially obsoletes the need for a few other APIs. Please see the linked
docs and help us test it!
- `raw` now accepts a function declaration with an unsafe string body: `let f =
- [%raw (a, b) => "return a + b"]` (OCaml syntax: `let f = [%raw fun a b ->
- "return a + b"]`). This makes embedding escape-hatch raw JS code even easier
+[%raw (a, b) => "return a + b"]` (OCaml syntax: `let f = [%raw fun a b ->
+"return a + b"]`). This makes embedding escape-hatch raw JS code even easier
for the compiler to optimize for speed and readability, as you've indicated
- that the raw code block is a function, with specific numbers of arguments.
+ that the raw code block is a function, with specific numbers of arguments.
The usual changelog is
[here](https://github.com/BuckleScript/bucklescript/blob/master/Changes.md#300).
diff --git a/_blogposts/archive/2018-05-21-bucklescript-release-3-1-0.mdx b/_blogposts/archive/2018-05-21-bucklescript-release-3-1-0.mdx
index 440be9b14..54222d8b8 100644
--- a/_blogposts/archive/2018-05-21-bucklescript-release-3-1-0.mdx
+++ b/_blogposts/archive/2018-05-21-bucklescript-release-3-1-0.mdx
@@ -19,11 +19,17 @@ A picture's worth a thousand words:
**Before:**
-
+
**After:**
-
+
Please see [Better Data Structures Printing (Debug
Mode)](/docs/reason-compiler/latest/better-data-structures-printing-debug-mode) for usage.
diff --git a/_blogposts/archive/2018-07-17-bucklescript-release-4-0-0-pt1.mdx b/_blogposts/archive/2018-07-17-bucklescript-release-4-0-0-pt1.mdx
index 3c3e637df..091278229 100644
--- a/_blogposts/archive/2018-07-17-bucklescript-release-4-0-0-pt1.mdx
+++ b/_blogposts/archive/2018-07-17-bucklescript-release-4-0-0-pt1.mdx
@@ -9,7 +9,7 @@ description: |
## Newest Changes
-`bs-platform` 4.0.0 is released! It has some nice features that we want to
+`bs-platform` 4.0.0 is released! It has some nice features that we want to
share with you, a more detailed list of changes is available
[here](https://github.com/BuckleScript/bucklescript/blob/master/Changes.md#400)
@@ -67,6 +67,7 @@ import {createElement} form "react" ; // not es6 compliant
import {createElement} from "node_modules/react/index" // not es6 compilant
import {createElement} from "./node_modules/react/index.js" // correct es6 module
```
+
- ES6 modules does not allow an indirection, by introducing our own NodeJS module loader, we have an indirection and more meta-data about each module, so that we can do more reflection work in the future.
Loading in clean state without packing seems to introduce some redundant work,
diff --git a/_blogposts/archive/2018-07-17-bucklescript-release-4-0-0-pt2.mdx b/_blogposts/archive/2018-07-17-bucklescript-release-4-0-0-pt2.mdx
index 943db6237..ccbcff5cc 100644
--- a/_blogposts/archive/2018-07-17-bucklescript-release-4-0-0-pt2.mdx
+++ b/_blogposts/archive/2018-07-17-bucklescript-release-4-0-0-pt2.mdx
@@ -24,13 +24,13 @@ a special boxed representation is used.
The construction of new values `Some(-)`, and pattern matching `| Some(-) =>
...`, perform some case analysis to decide when to box or unbox values. In the
-absence of nested optionals, the result of both operations will *always* be the
+absence of nested optionals, the result of both operations will _always_ be the
indentity.
Because of that, it's possible to use type-based optimization to avoid
-performing case analysis in the first place. So while the generic function
-```(x) => Some(x)``` will generate code to check wheter `x` should be boxed,
-the more type-specific function ```(x:int) => Some(x)``` is just compiled as
+performing case analysis in the first place. So while the generic function
+`(x) => Some(x)` will generate code to check wheter `x` should be boxed,
+the more type-specific function `(x:int) => Some(x)` is just compiled as
the identity function, as it's clear from the type that no boxing is required.
For a high-level formalization of the boxing and unboxing operations, as well
diff --git a/_blogposts/archive/2018-11-13-arity-zero.mdx b/_blogposts/archive/2018-11-13-arity-zero.mdx
index 20f10a62f..2e9fdca3a 100644
--- a/_blogposts/archive/2018-11-13-arity-zero.mdx
+++ b/_blogposts/archive/2018-11-13-arity-zero.mdx
@@ -30,11 +30,11 @@ let f_used: unit => unit = x => Js.log(x);
Output JS prior to v4.0.7:
```js
-function f (){
- return 3
+function f() {
+ return 3;
}
-function f_used (x){
- console.log(x)
+function f_used(x) {
+ console.log(x);
}
```
@@ -54,8 +54,8 @@ let f: unit => int = () => 3;
```
```js
-function f (param){
- return 3
+function f(param) {
+ return 3;
}
```
diff --git a/_blogposts/archive/2018-11-19-bucklescript-roadmap-q3-4-2018.mdx b/_blogposts/archive/2018-11-19-bucklescript-roadmap-q3-4-2018.mdx
index fe24b349d..5cb04336c 100644
--- a/_blogposts/archive/2018-11-19-bucklescript-roadmap-q3-4-2018.mdx
+++ b/_blogposts/archive/2018-11-19-bucklescript-roadmap-q3-4-2018.mdx
@@ -80,5 +80,3 @@ stdlib/belt library.
Currently the bsb is restricted by the npm directory layout, the generated JS
artifacts is also restricted by it, we will see if we can relocate the JS
artifacts or provide more flexibility for users.
-
-
diff --git a/_blogposts/archive/2019-01-07-bucklescript-release-4-0-17.mdx b/_blogposts/archive/2019-01-07-bucklescript-release-4-0-17.mdx
index 694af4b66..001bcc61a 100644
--- a/_blogposts/archive/2019-01-07-bucklescript-release-4-0-17.mdx
+++ b/_blogposts/archive/2019-01-07-bucklescript-release-4-0-17.mdx
@@ -17,7 +17,7 @@ A picture is worth a thousand words, below is a large monorepo which contains
4096 modules, changing the root node which has more than 3000 dependents, it
finished building within 400ms.
-
+
We will write a dedicated article explaining how we achieve this incredible
build performance.
@@ -26,5 +26,5 @@ A detailed list of changes is available
[here](https://github.com/BuckleScript/bucklescript/blob/master/Changes.md#4017)
Another quite important but not client facing change is that we renovated the
-internal build system, it will be much easier for contribution later on. We
+internal build system, it will be much easier for contribution later on. We
will update the contribution guide once it gets stable.
diff --git a/_blogposts/archive/2019-01-11-scalable.mdx b/_blogposts/archive/2019-01-11-scalable.mdx
index 5950c2128..1e6b55365 100644
--- a/_blogposts/archive/2019-01-11-scalable.mdx
+++ b/_blogposts/archive/2019-01-11-scalable.mdx
@@ -104,7 +104,7 @@ file, BuckleScript designs the data structure of `.cmj` in a way that the
content of `.cmj` is seldom changed. (Let's say its probability is 0.05 which
is rare in cases when the arity of a function changed)
-If neither `.cmj` nor `.cmi` gets changed, the scheduler would stop
+If neither `.cmj` nor `.cmi` gets changed, the scheduler would stop
propagation.
Suppose the `.cmj` file is still changed (P = 0.05), A's dependency B would get
@@ -135,7 +135,6 @@ implementation's dependency, actually it used to be a subset of
implementation's dependency chain, so only a subset of its dependencies will
get compiled. We will see a concrete an example later.
-
## A fast scheduler
As we said, the time spent in an edit-build cycle is mostly composed of two
@@ -166,9 +165,9 @@ build.ninja instructions, check stats of artifacts and do the scheduling.
Instead of making a long-lived compiler, we propose to have a long-lived
scheduler. The complexity of a scheduler is significantly lower than a
-compiler. Having an in-memory scheduler will help reducing redundant work such
+compiler. Having an in-memory scheduler will help reducing redundant work such
as parsing build.ninja instructions which is around of size 2M for 10k files.
-With the integration of watch mode, it does not need stat all artifacts each
+With the integration of watch mode, it does not need stat all artifacts each
time, this should help increase the scalability of scheduler to 100K files or
even more.
@@ -178,11 +177,11 @@ Our synthetic bench is borrowed from
[OMake](http://blog.camlcity.org/blog/omake1.html) and public available
[here](https://github.com/bucklescript/bsb-bench).
->The benchmark has these characteristics: The task is to build n^2 libraries
->with n^2 modules each (for a given small number n), and the dependencies
->between the modules are created in a way so that we can stress both the
->dependency analyzer of the build utility and the ability to run commands in
->parallel.
+> The benchmark has these characteristics: The task is to build n^2 libraries
+> with n^2 modules each (for a given small number n), and the dependencies
+> between the modules are created in a way so that we can stress both the
+> dependency analyzer of the build utility and the ability to run commands in
+> parallel.
We modified the benchmark to add interface file for each implementation file.
@@ -195,28 +194,27 @@ The test is running against `n = 3,5,7,9`, where the source code size would be
Below is what we get for a cold build from scratch:
| Source size | Clean build (ms) |
-|-------------|------------------|
-| 0162 | 684 |
-| 1250 | 5,100 |
-| 4802 | 24,112 |
-| 13122 | 125,248 |
-
-| Source size | Nop build (ms) | Touching root module (m_1_1_1_1.ml) | Touching (m_1_1_1.mli)|
-|-------------|------------------|-------------------------------------|-----------------------|
-| 0162 | 16 | 59 | 54 |
-| 1250 | 79 | 120 | 133 |
-| 4802 | 266 | 369 | 367 |
-| 13122 | 728 | 963 | 962 |
+| ----------- | ---------------- |
+| 0162 | 684 |
+| 1250 | 5,100 |
+| 4802 | 24,112 |
+| 13122 | 125,248 |
+
+| Source size | Nop build (ms) | Touching root module (m_1_1_1_1.ml) | Touching (m_1_1_1.mli) |
+| ----------- | -------------- | ----------------------------------- | ---------------------- |
+| 0162 | 16 | 59 | 54 |
+| 1250 | 79 | 120 | 133 |
+| 4802 | 266 | 369 | 367 |
+| 13122 | 728 | 963 | 962 |
We can see from the table as size grows, the time spent in edit-build cycle shifts from compilation to the scheduler, this is due to the fact that Ninja scheduler does not save the work for each test.
-
-| Source size | Adding value to root module (m_1_1_1_1.ml) | Changing root interface|
-|-------------|--------------------------------------------|------------------------|
-| 0162 | 56 | 70 |
-| 1250 | 131 | 155 |
-| 4802 | 370 | 428 |
-| 13122 | 969 | 991 |
+| Source size | Adding value to root module (m_1_1_1_1.ml) | Changing root interface |
+| ----------- | ------------------------------------------ | ----------------------- |
+| 0162 | 56 | 70 |
+| 1250 | 131 | 155 |
+| 4802 | 370 | 428 |
+| 13122 | 969 | 991 |
The verbose build log for adding values on source of size `13122` is as below:
diff --git a/_blogposts/archive/2019-03-21-bucklescript-release-5-0.mdx b/_blogposts/archive/2019-03-21-bucklescript-release-5-0.mdx
index 29b7e4e77..377167a3c 100644
--- a/_blogposts/archive/2019-03-21-bucklescript-release-5-0.mdx
+++ b/_blogposts/archive/2019-03-21-bucklescript-release-5-0.mdx
@@ -10,10 +10,9 @@ description: |
## New Changes
`bs-platform@5.0.0` is released! There are quite a few bug fixes in this
-release and refmt is synced up, a detailed list of changes is available
+release and refmt is synced up, a detailed list of changes is available
[here](https://github.com/BuckleScript/bucklescript/blob/master/Changes.md#500).
-
Several new features are introduced in this release:
- first class `bs.variadic` support, documented
diff --git a/_blogposts/archive/2019-03-31-bucklescript-release-6-0.mdx b/_blogposts/archive/2019-03-31-bucklescript-release-6-0.mdx
index 1f1aa7785..7fa1c00b2 100644
--- a/_blogposts/archive/2019-03-31-bucklescript-release-6-0.mdx
+++ b/_blogposts/archive/2019-03-31-bucklescript-release-6-0.mdx
@@ -10,7 +10,7 @@ description: |
## New Test Release
`bs-platform@6.0.0-dev.1` is released, you can try it with `npm i -g
-bs-platform@next`! (if you have permission issues, try `sudo npm i
+bs-platform@next`! (if you have permission issues, try `sudo npm i
--unsafe-perm -g bs-platform@next`)
This is the first release that bucklescript compiler using OCaml 4.06.1
diff --git a/_blogposts/archive/2019-04-09-bucklescript-release-5-0-1.mdx b/_blogposts/archive/2019-04-09-bucklescript-release-5-0-1.mdx
index 15ede0d1f..709e53261 100644
--- a/_blogposts/archive/2019-04-09-bucklescript-release-5-0-1.mdx
+++ b/_blogposts/archive/2019-04-09-bucklescript-release-5-0-1.mdx
@@ -50,11 +50,9 @@ module Platform: {
It is a bit verbose for library authors, but this should be transparent to
library users.
-
-
We are also actively working on a new offical release targeted to OCaml 4.06
for the forthcoming [reason-conf](https://www.reason-conf.com/), below is
- proposed release schedule:
+proposed release schedule:
We are going to support OCaml 4.06 and 4.02 at the same time for a while.
diff --git a/_blogposts/archive/2019-04-22-bucklescript-release-5-0-4.mdx b/_blogposts/archive/2019-04-22-bucklescript-release-5-0-4.mdx
index 610e2e038..089f852ea 100644
--- a/_blogposts/archive/2019-04-22-bucklescript-release-5-0-4.mdx
+++ b/_blogposts/archive/2019-04-22-bucklescript-release-5-0-4.mdx
@@ -30,7 +30,6 @@ bsc.exe -bs-jsx 3 # turn on reactjs_jsx_ppx_v3
Like before, we also ship a stand alone bsppx.exe, it now absorbs
reactjs_jsx_ppx as well.
-
```
bsppx.exe -bs-jsx 2 # turn on reactjs_jsx_ppx_v2
bsppx.exe -bs-jsx 3 # turn on reactjs_jsx_ppx_v3
diff --git a/_blogposts/archive/2019-05-21-ffi-overview.mdx b/_blogposts/archive/2019-05-21-ffi-overview.mdx
index 6f6e6e377..3ed0d7b8d 100644
--- a/_blogposts/archive/2019-05-21-ffi-overview.mdx
+++ b/_blogposts/archive/2019-05-21-ffi-overview.mdx
@@ -52,7 +52,7 @@ BuckleScript allows users to insert raw JS using extension nodes directly.
Please refer to the
[documentation](https://bucklescript.github.io/docs/en/embed-raw-javascript)
for details. Here we only talk about one of the most used styles: inserting raw
- JS code as a function.
+JS code as a function.
```reason
let getSafe: (array(int), int) => int = [%raw
@@ -71,18 +71,14 @@ Here the raw extension node asks the user to list the parameters and function
statement in raw JS syntax. The generated JS code is as follows:
```js
-function getSafe (a,b){
- if (b>=0 && b < a.length) {
- return a [b]
- }
- throw new Error("out of range")
- };
-
-var v = getSafe(/* array */[
- 1,
- 2,
- 3
- ], -1);
+function getSafe(a, b) {
+ if (b >= 0 && b < a.length) {
+ return a[b];
+ }
+ throw new Error("out of range");
+}
+
+var v = getSafe(/* array */ [1, 2, 3], -1);
```
Inserting raw JS code as a function has several advantages:
@@ -92,6 +88,7 @@ Inserting raw JS code as a function has several advantages:
- The compiler still has some knowledge about the function, for example, its arity.
Some advice about using this style:
+
- Always annotate the raw function with explicit type annotation.
- When annotating raw JS, you can use polymorphic types, but don’t create them when you don’t really need them. In general, non polymoprhic type is safer and more efficient.
- Write a unit test for the function.
@@ -148,6 +145,7 @@ Thanks to native support of abstract data types in OCaml, the interop is easy
to reason about.
Some advice when using this style:
+
- Again, you can use polymorphic types in your annotations, but don't create
polymorphic types when you don't need them.
- Write a unit test for each external.
@@ -173,14 +171,18 @@ let d = date->getDate;
The generated JS is as follows, and you can see the cost:
```js
-function fromFloat (d){return new Date(d)};
-
-function getDate (d){return d.getDate()};
-
-function setDate (d,v){
- d.setDate(v);
- return 0; // ocaml representation of unit
-};
+function fromFloat(d) {
+ return new Date(d);
+}
+
+function getDate(d) {
+ return d.getDate();
+}
+
+function setDate(d, v) {
+ d.setDate(v);
+ return 0; // ocaml representation of unit
+}
var date = fromFloat(10000);
diff --git a/_blogposts/archive/2019-06-26-bucklescript-release-5-0-5.mdx b/_blogposts/archive/2019-06-26-bucklescript-release-5-0-5.mdx
index 8bb0d8b0c..3960163bb 100644
--- a/_blogposts/archive/2019-06-26-bucklescript-release-5-0-5.mdx
+++ b/_blogposts/archive/2019-06-26-bucklescript-release-5-0-5.mdx
@@ -40,9 +40,12 @@ global variable like this
* @returns {int}
*
*/
-require('bs-platform/lib/js/caml_external_polyfill.js').register('caml_fancy_add',function(x,y){
- return + ((""+x ) + (""+y))
-})
+require("bs-platform/lib/js/caml_external_polyfill.js").register(
+ "caml_fancy_add",
+ function (x, y) {
+ return +("" + x + ("" + y));
+ },
+);
```
Note this is an experimental feature that we don't suggest users to use it
@@ -56,12 +59,15 @@ Previously, there are some scenarios that the Js function name is inferred
during the interop.
For example
+
```ocaml
external f : int -> int = "" [@@bs.val]
```
+
```reason
[@bs.val] external f : int => int = ""
```
+
Here the JS function name is inferred as `f` which is the same as OCaml
function name.
diff --git a/_blogposts/archive/2019-08-12-bucklescript-release-5-1-0.mdx b/_blogposts/archive/2019-08-12-bucklescript-release-5-1-0.mdx
index 432d093b5..250206a28 100644
--- a/_blogposts/archive/2019-08-12-bucklescript-release-5-1-0.mdx
+++ b/_blogposts/archive/2019-08-12-bucklescript-release-5-1-0.mdx
@@ -18,7 +18,6 @@ bs-platform@6.1.0-dev.6`).
A detailed list of changes is available
[here](https://github.com/BuckleScript/bucklescript/blob/master/Changes.md#510)
-
Some feature enhancements are described as follows:
## Introducing `bsc` to public
@@ -81,12 +80,11 @@ can be loaded into chrome via `chrome://tracing`.
Below is a profile image that shows the tracing graph for a large project:
-
+
And you can zoom-in to see more details:
-
-
+
## Support of ppx with arguments
@@ -95,20 +93,20 @@ We extended the schema to support ppx with arguments:
```json
{
"ppx-specs": {
- "type": "array",
- "items": {
- "oneOf" : [
- {
- "type": "string" // single command
- },
- {
- "type" : "array", // command with args
- "items": {
- "type" : "string"
- }
- }
- ]
- }
+ "type": "array",
+ "items": {
+ "oneOf": [
+ {
+ "type": "string" // single command
+ },
+ {
+ "type": "array", // command with args
+ "items": {
+ "type": "string"
+ }
+ }
+ ]
+ }
}
}
```
@@ -126,14 +124,14 @@ Yes, performance is increased with each release!
Quite a lot of work was spent in house-keeping this release. We changed the
internal data representation to a more compact format. Here is the result of
using `bstracing` to show a comparison of clean building a large project around
-(2 * 5 * 5 * 5 * 5 = 1250 files):
+(2 _ 5 _ 5 _ 5 _ 5 = 1250 files):
Version 5.0.6 (around 4.8s)
-
+
Version 5.1.0 (around 4.2s)
-
+
Happy hacking!
diff --git a/_blogposts/archive/2019-09-23-bucklescript-release-5-2-0.mdx b/_blogposts/archive/2019-09-23-bucklescript-release-5-2-0.mdx
index 8c2355fd6..34b57722a 100644
--- a/_blogposts/archive/2019-09-23-bucklescript-release-5-2-0.mdx
+++ b/_blogposts/archive/2019-09-23-bucklescript-release-5-2-0.mdx
@@ -38,7 +38,7 @@ system more valuable to JS target.
Below is an image showing the diff in this release
-
+
As you can see, the `id` module changed from an array into an JS object.
@@ -57,7 +57,7 @@ annotate the generated JS code with its names.
Below is an image showing the diff in this release
-
+
In the future, we will explore if we can produce such annotation in the runtime without losing efficiency.
diff --git a/_blogposts/archive/2019-10-16-another-encoding.mdx b/_blogposts/archive/2019-10-16-another-encoding.mdx
index 900069c13..b99477677 100644
--- a/_blogposts/archive/2019-10-16-another-encoding.mdx
+++ b/_blogposts/archive/2019-10-16-another-encoding.mdx
@@ -10,7 +10,7 @@ Note this article is for library authors, it has something in depth which is
not necessary for people who use BuckleScript at daily work.
When we build some generic data structure, abstract over function is not
-enough. For example, a type safe generic balanced AVL tree not only relies on
+enough. For example, a type safe generic balanced AVL tree not only relies on
the types of a comparison function, but also the identity of such function. Two
balanced AVL trees which are initialized over same type of comparison function
still can not be mixed.
@@ -83,7 +83,7 @@ Error: This expression has type Ins2.coll
There are some issues with such encoding:
- From runtime point of view, `Ins1` is initialized during runtime, its
- implementation is a *big closure*, which means even if you only use on
+ implementation is a _big closure_, which means even if you only use on
function in `Ins1` module, all functions will be linked in.
- From user point of view, people has to call `Ins1.add` and `Ins2.add` instead
@@ -188,7 +188,5 @@ As you read here, by using such encoding, the data structure is more
generalized from user point of view. The generated JS code is not in a big
closure so that it can be dead code eliminated better.
-This style is extensively used in Belt encoding, we encourage you to have a
+This style is extensively used in Belt encoding, we encourage you to have a
look at its implementation for better ideas.
-
-
diff --git a/_blogposts/archive/2019-11-18-whats-new-in-7-pt1.mdx b/_blogposts/archive/2019-11-18-whats-new-in-7-pt1.mdx
index b13ad7b60..d62d62f3a 100644
--- a/_blogposts/archive/2019-11-18-whats-new-in-7-pt1.mdx
+++ b/_blogposts/archive/2019-11-18-whats-new-in-7-pt1.mdx
@@ -9,12 +9,11 @@ description: |
## New major dev release available
-The new major version of BuckleScript is coming
--[7.0.0-dev.1](https://github.com/BuckleScript/bucklescript/pull/3968) is now
+The new major version of BuckleScript is coming -[7.0.0-dev.1](https://github.com/BuckleScript/bucklescript/pull/3968) is now
released for testing!
We are maintaining `5.*` and `6.*` for OCaml `4.02` and `4.06` for a while,
-since this release we are moving forward and focusing on release 7.* (for OCaml
+since this release we are moving forward and focusing on release 7.\* (for OCaml
4.06).
This is a major release comes with lots of nice features listed
@@ -46,13 +45,13 @@ let obj2 = {...obj, y: 4};
var obj2 = {
x: 3,
y: 4,
- z: 2
+ z: 2,
};
var obj = {
x: 3,
y: 2,
- z: 2
+ z: 2,
};
```
diff --git a/_blogposts/archive/2019-11-28-whats-new-in-7-pt2.mdx b/_blogposts/archive/2019-11-28-whats-new-in-7-pt2.mdx
index b4e8dae10..bb6222fae 100644
--- a/_blogposts/archive/2019-11-28-whats-new-in-7-pt2.mdx
+++ b/_blogposts/archive/2019-11-28-whats-new-in-7-pt2.mdx
@@ -39,7 +39,11 @@ let f4 = ({x, y, z: {hi}}) => (x + y + hi) * 2;
```js
function f4(param) {
- return (((param.EXACT_MAPPING_TO_JS_LABEL + param.EXACT_2 | 0) + param.z.hello | 0) << 1);
+ return (
+ ((((param.EXACT_MAPPING_TO_JS_LABEL + param.EXACT_2) | 0) + param.z.hello) |
+ 0) <<
+ 1
+ );
}
```
diff --git a/_blogposts/archive/2019-12-20-bucklescript-release-7-0-2.mdx b/_blogposts/archive/2019-12-20-bucklescript-release-7-0-2.mdx
index a5e280e15..3b375c811 100644
--- a/_blogposts/archive/2019-12-20-bucklescript-release-7-0-2.mdx
+++ b/_blogposts/archive/2019-12-20-bucklescript-release-7-0-2.mdx
@@ -30,7 +30,6 @@ A highlighting feature is that we added Generalized Unboxed Support (so called
[@unboxed] annotations). Here's a short definition from the official OCaml
Manual:
-
> unboxed can be used on a type definition if the type is a single-field record
> or a concrete type with a single constructor that has a single argument. It
> tells the compiler to optimize the representation of the type by removing the
@@ -40,7 +39,6 @@ Manual:
> represented by an existential type variable, or an abstract type constructor
> applied to an existential type variable.
-
**Note**: The beforementioned restriction about GADTs only applies to OCaml's
native compiler, not to BuckleScript's JavaScript compilation. So we will get
the maximum value with less confusing error messages!
@@ -102,7 +100,7 @@ can be called with many different types (e.g. `f(1)` and `f("hi")`). The
compiler will not try to lock `'a` for the first type it sees (e.g. the `int`)
on the first call site. The parameter `'a` is therefore polymorphic!
-By `unboxing` those records with one polymorphic function, we will get rid of
+By `unboxing` those records with one polymorphic function, we will get rid of
[value restriction for our existing encoding of uncurried
function](https://github.com/BuckleScript/bucklescript/issues/4058), this will
be a major feature!
@@ -119,6 +117,7 @@ type t =
let array = [|Any(3), Any("a")|];
```
+
```ocaml
(* OCaml *)
type t =
@@ -131,12 +130,12 @@ let array = [|Any 3; Any "a"|]
The examples above will translate to following JS:
```js
-var array = [ 3, "a"];
+var array = [3, "a"];
```
As you can already tell, this feature will give us way better possibilities to
do interop with polymorphic array representations in JavaScript (without losing
- any type safetiness!).
+any type safetiness!).
As a more concrete use-case, this will give users the possibility to define
types such as `int_or_string`.
diff --git a/_blogposts/archive/2020-02-04-bucklescript-release-7-1-0.mdx b/_blogposts/archive/2020-02-04-bucklescript-release-7-1-0.mdx
index eb34a129c..cf5fc5c72 100644
--- a/_blogposts/archive/2020-02-04-bucklescript-release-7-1-0.mdx
+++ b/_blogposts/archive/2020-02-04-bucklescript-release-7-1-0.mdx
@@ -1,116 +1,117 @@
----
-author: hongbo
-date: "2020-02-04"
-previewImg:
-tags:
- - Release
-title: Announcing BuckleScript 7.1.0
-description: |
----
-
-## About this Release
-
-`bs-platform@7.1.0` is a major release. You can try it with `npm i -g
-bs-platform`! (If you have permission issues, try `sudo npm i --unsafe-perm -g
-bs-platform`)
-
-It was called 7.0.2 but bumped into 7.1.0 due to a soundness fix (a breaking
-change) as follows:
-
-Previously, the empty array `[||]` was polymorphic. This happens to be true,
-since in native an array is not resizable, so users cannot do anything with it.
-But in JS, we introduced a binding for `push` which can change the size of an
-array dynamically. In this case, an empty array cannot be polymorphic any more.
-
-Removing `push` is possible, but it makes arrays in JS context less useful. To
-fix this issue while keeping `push`, we make `[||]` weakly typed so that its
-type inference is deferred until the first time it is used. If it is never used
-across the module, it has to be annotated with a concrete type; otherwise, the
-type checker will complain.
-
-Several highlighted features are listed as follows:
-
-## Raw JavaScript Parsing/Checking
-
-BuckleScript allows users to embed raw JavaScript code as an escape hatch; it
-used to treat such piece of code as a black box.
-
-In this release we vendor a JavaScript parser (thanks to
-[flowtype](https://github.com/facebook/flow)) for syntax checking and simple
-semantics analysis over `raw`. This is on-going work, but it is already useful
-now.
-
-First, we now report syntax errors properly for `raw`.
-
-Second, for simple semantics analysis, we can tell whether the code inside raw
-is a function or not and the arity of raw function:
-
-```ocaml
-let f = [%raw "function(x){return x}"]
-```
-```reason
-let f = [%raw "function(x){return x}"];
-```
-
-Now we know `f` is a function declaration with no side effect; it can be
-removed by the dead code analyzer if not used. We also know its arity so that
-when it's called we know whether it's fully applied or not.
-
-Because this sort of information can be derived from `raw` directly, the
-special `raw` form we introduced as follows is no longer needed:
-
-```ocaml
-let f = fun%raw x -> {|x|}
-```
-
-```reason
-let f = [%raw x => {|x|}];
-```
-
-To reduce interop API surface, this feature will now be discouraged.
-
-We're also exploring using such knowledge on JS literals and regexes checking.
-
-## Unboxed Types
-
-One major feature introduced in this release is **unboxed types** which is
-blogged [here](https://bucklescript.github.io/blog/2019/12/20/release-7-02).
-
-## Uniform Warning System
-
-Previously warnings are reported in two ways:
-- The OCaml compiler style: `-w +10`
-- Ad-hoc warnings introduced by flags `-bs-warn-unimplemented-external`
-
-
-In this release, we make such integration so that BuckleScript warnings are
-handled in the same way as OCaml's own warnings, for example, the warning
-attribute below can also turn off BuckleScript warnings now.
-
-```reason
-[@warning "-101"]; // file-level config
-```
-
-Based on this effort, we have changed all BuckleScript warnings into OCaml
-style warnings to reduce user-level complexity.
-
-The newly introduced warnings are listed via `bsc -warn-help`:
-
-```
-101 BuckleScript warning: Unused bs attributes
-102 BuckleScript warning: polymorphic comparison introduced (maybe unsafe)
-103 BuckleScript warning: about fragile FFI definitions
-104 BuckleScript warning: bs.deriving warning with customized message
-105 BuckleScript warning: the external name is inferred from val name is unsafe from refactoring when changing value name
-106 BuckleScript warning: Unimplemented primitive used:
-107 BuckleScript warning: Integer literal exceeds the range of representable integers of type int
-108 BuckleScript warning: Uninterpreted delimiters (for unicode)
-```
-
-We also recommend users to turn on `warnerror` and only disable warnings for
-some specific files.
-
-We've also upgraded the Reason parser `refmt` to 3.6.0.
-
-A full list of changes is available here:
-https://github.com/BuckleScript/bucklescript/blob/master/Changes.md#702
+---
+author: hongbo
+date: "2020-02-04"
+previewImg:
+tags:
+ - Release
+title: Announcing BuckleScript 7.1.0
+description: |
+---
+
+## About this Release
+
+`bs-platform@7.1.0` is a major release. You can try it with `npm i -g
+bs-platform`! (If you have permission issues, try `sudo npm i --unsafe-perm -g
+bs-platform`)
+
+It was called 7.0.2 but bumped into 7.1.0 due to a soundness fix (a breaking
+change) as follows:
+
+Previously, the empty array `[||]` was polymorphic. This happens to be true,
+since in native an array is not resizable, so users cannot do anything with it.
+But in JS, we introduced a binding for `push` which can change the size of an
+array dynamically. In this case, an empty array cannot be polymorphic any more.
+
+Removing `push` is possible, but it makes arrays in JS context less useful. To
+fix this issue while keeping `push`, we make `[||]` weakly typed so that its
+type inference is deferred until the first time it is used. If it is never used
+across the module, it has to be annotated with a concrete type; otherwise, the
+type checker will complain.
+
+Several highlighted features are listed as follows:
+
+## Raw JavaScript Parsing/Checking
+
+BuckleScript allows users to embed raw JavaScript code as an escape hatch; it
+used to treat such piece of code as a black box.
+
+In this release we vendor a JavaScript parser (thanks to
+[flowtype](https://github.com/facebook/flow)) for syntax checking and simple
+semantics analysis over `raw`. This is on-going work, but it is already useful
+now.
+
+First, we now report syntax errors properly for `raw`.
+
+Second, for simple semantics analysis, we can tell whether the code inside raw
+is a function or not and the arity of raw function:
+
+```ocaml
+let f = [%raw "function(x){return x}"]
+```
+
+```reason
+let f = [%raw "function(x){return x}"];
+```
+
+Now we know `f` is a function declaration with no side effect; it can be
+removed by the dead code analyzer if not used. We also know its arity so that
+when it's called we know whether it's fully applied or not.
+
+Because this sort of information can be derived from `raw` directly, the
+special `raw` form we introduced as follows is no longer needed:
+
+```ocaml
+let f = fun%raw x -> {|x|}
+```
+
+```reason
+let f = [%raw x => {|x|}];
+```
+
+To reduce interop API surface, this feature will now be discouraged.
+
+We're also exploring using such knowledge on JS literals and regexes checking.
+
+## Unboxed Types
+
+One major feature introduced in this release is **unboxed types** which is
+blogged [here](https://bucklescript.github.io/blog/2019/12/20/release-7-02).
+
+## Uniform Warning System
+
+Previously warnings are reported in two ways:
+
+- The OCaml compiler style: `-w +10`
+- Ad-hoc warnings introduced by flags `-bs-warn-unimplemented-external`
+
+In this release, we make such integration so that BuckleScript warnings are
+handled in the same way as OCaml's own warnings, for example, the warning
+attribute below can also turn off BuckleScript warnings now.
+
+```reason
+[@warning "-101"]; // file-level config
+```
+
+Based on this effort, we have changed all BuckleScript warnings into OCaml
+style warnings to reduce user-level complexity.
+
+The newly introduced warnings are listed via `bsc -warn-help`:
+
+```
+101 BuckleScript warning: Unused bs attributes
+102 BuckleScript warning: polymorphic comparison introduced (maybe unsafe)
+103 BuckleScript warning: about fragile FFI definitions
+104 BuckleScript warning: bs.deriving warning with customized message
+105 BuckleScript warning: the external name is inferred from val name is unsafe from refactoring when changing value name
+106 BuckleScript warning: Unimplemented primitive used:
+107 BuckleScript warning: Integer literal exceeds the range of representable integers of type int
+108 BuckleScript warning: Uninterpreted delimiters (for unicode)
+```
+
+We also recommend users to turn on `warnerror` and only disable warnings for
+some specific files.
+
+We've also upgraded the Reason parser `refmt` to 3.6.0.
+
+A full list of changes is available here:
+https://github.com/BuckleScript/bucklescript/blob/master/Changes.md#702
diff --git a/_blogposts/archive/2020-02-07-union-types-in-bucklescript.mdx b/_blogposts/archive/2020-02-07-union-types-in-bucklescript.mdx
index defdf25df..46cc7f6e6 100644
--- a/_blogposts/archive/2020-02-07-union-types-in-bucklescript.mdx
+++ b/_blogposts/archive/2020-02-07-union-types-in-bucklescript.mdx
@@ -14,10 +14,9 @@ description: |
[Union
types](https://www.typescriptlang.org/docs/handbook/advanced-types.html#union-types)
describe a value that can be one of several types. In JS, it is common to use
-the vertical bar (|) to separate each type, so `number | string | boolean` is
+the vertical bar (|) to separate each type, so `number | string | boolean` is
the type of a value that can be a number, a string, or a boolean.
-
Following [the last
post](https://bucklescript.github.io/blog/2019/12/20/release-7-02) since the
introduction of unboxed attributes in `7.1.0`, we can create such types as
@@ -31,6 +30,7 @@ let a (v : a) = Any v
let b (v : b) = Any v
let c (v : c) = Any v
```
+
```reason
[@unboxed]
type t =
@@ -39,6 +39,7 @@ let a = (v: a) => Any(v);
let b = (v: b) => Any(v);
let c = (v: c) => Any(v);
```
+
> **Note:** due to the `unboxed` attribute, `Any a` shares the same runtime
> representation as `a`; however, we need to make sure that user can only
> construct values of type `a`, `b` , or `c` into type `t`. By making use of the
@@ -75,7 +76,9 @@ module A_b_c: {
let c = (v: c) => Any(v);
};
```
+
+
What happens when we need to know specifically whether we have a value of type `a`? This is a case by case issue; it depends on whether there are some intersections in the runtime encoding of `a`, `b` or `c`. For some primitive types, it is easy enough to use `Js.typeof` to tell the difference between, e.g, `number` and `string`.
Like [type guards in typescript](https://www.typescriptlang.org/docs/handbook/advanced-types.html#type-guards-and-differentiating-types), we have to trust the user knowledge to differentiate between union types. However, such user level knowledge is isolated in a single module so that we can reason about its correctness locally.
@@ -105,6 +108,7 @@ end = struct
else String (Obj.magic v : string)
end
```
+
```reason
module Number_or_string: {
type t;
@@ -131,6 +135,7 @@ module Number_or_string: {
};
};
```
+
Note that here we use `Obj.magic` to do an unsafe type cast which relies on `Js.typeof`. In practice, people may use `instanceof`; the following is an imaginary example:
```ocaml
@@ -156,6 +161,7 @@ end = struct
else B (Obj.magic b)
end
```
+
```reason
module A_or_b: {
type t;
@@ -182,7 +188,7 @@ module A_or_b: {
};
};
```
-Here we suppose `a` is of JS class type `A`, and we use `instanceof` to test it. Note we use some `unsafe` code locally, but as long as such code is carefully reviewed, it has a safe boundary at the module level.
+Here we suppose `a` is of JS class type `A`, and we use `instanceof` to test it. Note we use some `unsafe` code locally, but as long as such code is carefully reviewed, it has a safe boundary at the module level.
To conclude: thanks to `unboxed` attributes and the module language, we introduce a systematic way to convert values from `union types` (untagged union types) to `algebraic data types` (tagged union types). This sort of conversion relies on user level knowledge and has to be reviewed carefully. For some cases where `classify` is not needed, it can be done in a completely type safe way.
diff --git a/_blogposts/archive/2020-02-20-loading-stdlib-in-memory.mdx b/_blogposts/archive/2020-02-20-loading-stdlib-in-memory.mdx
index 458380c02..640f5c135 100644
--- a/_blogposts/archive/2020-02-20-loading-stdlib-in-memory.mdx
+++ b/_blogposts/archive/2020-02-20-loading-stdlib-in-memory.mdx
@@ -31,24 +31,22 @@ artifact describing the interface of the Pervasives module and
the Pervasives module. `Pervasives.cm[ij]` and other modules in stdlib are
shipped together with the compiler.
-
**This traditional mode has some consequences:**
- The compiler is not stand-alone and relocatable. Even if we have the compiler
-prebuilt for different platforms, we still have to compile stdlib
-post-installation. `postinstall` is supported by npm, but it has
-[various](https://github.com/BuckleScript/bucklescript/issues/3213)
-[issues](https://github.com/BuckleScript/bucklescript/issues/2799)
-[against](https://github.com/BuckleScript/bucklescript/issues/3254) yarn.
+ prebuilt for different platforms, we still have to compile stdlib
+ post-installation. `postinstall` is supported by npm, but it has
+ [various](https://github.com/BuckleScript/bucklescript/issues/3213)
+ [issues](https://github.com/BuckleScript/bucklescript/issues/2799)
+ [against](https://github.com/BuckleScript/bucklescript/issues/3254) yarn.
- It's hard to split the compiler from the generated stdlib JS artifacts. When
-a BuckleScript user deploys apps depending on BuckleScript, in theory, the app
-only needs to deploy those generated JS artifacts; the native binary is not
-needed in production. However, the artifacts are still loaded since they are
-bundled together. Allowing easy delivery of compiled code is one of the
-community’s most desired [feature
-requests](https://github.com/BuckleScript/bucklescript/issues/2772).
-
+ a BuckleScript user deploys apps depending on BuckleScript, in theory, the app
+ only needs to deploy those generated JS artifacts; the native binary is not
+ needed in production. However, the artifacts are still loaded since they are
+ bundled together. Allowing easy delivery of compiled code is one of the
+ community’s most desired [feature
+ requests](https://github.com/BuckleScript/bucklescript/issues/2772).
In this release, we solve the problem by embedding the binary artifacts into
the compiler directly and loading it on demand.
@@ -98,7 +96,7 @@ seconds to 3 seconds. Reinstallation is almost a no-op now.
### JS playground is easier to build
We translate the compiler into JS so that
-developers can play with it in the browser. To make this happen, we used to
+developers can play with it in the browser. To make this happen, we used to
fake the IO system; this not needed any more since no IO happens when compiling
a single file to a string.
@@ -126,5 +124,3 @@ Here is the new layout:
| |-- bsc.exe
```
-
-
diff --git a/_blogposts/archive/2020-03-12-bucklescript-release-7-2.mdx b/_blogposts/archive/2020-03-12-bucklescript-release-7-2.mdx
index c5a3c4f4f..ca1f30bd9 100644
--- a/_blogposts/archive/2020-03-12-bucklescript-release-7-2.mdx
+++ b/_blogposts/archive/2020-03-12-bucklescript-release-7-2.mdx
@@ -32,7 +32,7 @@ compilation and installation.
Previously we recommended installing `bs-platform` globally to save on
installation time.
-However, with this release the installation is so fast that we recommend
+However, with this release the installation is so fast that we recommend
installing it locally instead - per project - instead, as there's no additional
cost, and it provides better isolation.
@@ -58,6 +58,7 @@ module A : { let b : int} = {
}
```
+
`let` `%private` gives you an option to mark private fields directly
```reason
@@ -75,7 +76,6 @@ Note interface files are still recommended as a general best practice since they
- Quick prototyping. During prototyping, we still want to hide some values, but the interface file is not stable yet, `let%private` provide you such convenience.
-
### Int64 performance optimization
We received feedback from some users that various Int64 operations became bottlenecks in their code performance, in particular `Int64.to_string`.
@@ -83,6 +83,7 @@ We received feedback from some users that various Int64 operations became bottle
We responded to this, and after some hard work - but _without_ changing the underlying representation - our `Int64.to_string` is even faster than `bigint` for common inputs.
A micro-benchmark for comparison:
+
```
running on 7.1
Int64.to_string: 367.788ms # super positive number
@@ -102,7 +103,7 @@ Int64.to_string: 43.270ms
We also apply such optimizations to other Int64 operations.
-Note that Int64 is implemented in OCaml itself without any raw JavaScript. This is case compelling hints that our optimizing compiler not only provides expressivity and type-safe guarantees, but also empowers users to write maintainable, *efficient* code.
+Note that Int64 is implemented in OCaml itself without any raw JavaScript. This is case compelling hints that our optimizing compiler not only provides expressivity and type-safe guarantees, but also empowers users to write maintainable, _efficient_ code.
## File level compilation flags
diff --git a/_blogposts/archive/2020-03-26-generalize-uncurry.mdx b/_blogposts/archive/2020-03-26-generalize-uncurry.mdx
index ba1b49ed5..c3108081e 100644
--- a/_blogposts/archive/2020-03-26-generalize-uncurry.mdx
+++ b/_blogposts/archive/2020-03-26-generalize-uncurry.mdx
@@ -24,7 +24,7 @@ convention to ReasonML.
A native implementation of curried call like [purescript](https://www.purescript.org/) does will generate very slow code:
```js
-let curriedFunction = x => y => z => x + y +z ;
+let curriedFunction = (x) => (y) => (z) => x + y + z;
let curriedApply = curriedFunction(1)(2)(3); // memory allocation triggered
```
@@ -45,7 +45,6 @@ In cases where arity inference does not help, the arity guessing has to be delay
When we create bindings for high order functions in the JS world, we would like to have native uncurried functions which behave the same as JS world -- no semantics mismatch.
-
## Generalized uncurried calling convention in this release
Before release 7.3, we had introduced uncurried calling convention, however, it has serious limitations -- uncurried functions can not be polymorphic, it does not support labels, the error
@@ -53,21 +52,36 @@ message leaks the underlying encoding -- now all those limitations are gone!
**Previously:**
-
+
-
+
-
+
The error messages above are cryptic and hard to understand. And the limitation of not supporting recursive functions make uncurried support pretty weak.
Now those limitations are all gone, you can have polymorphic uncurried recursive functions and it support labels.
-
+
-
+
-The error message is also enhanced significantly
+The error message is also enhanced significantly
### When the uncurried function is used in curried
@@ -128,6 +142,7 @@ Error: This expression has type (. int, int) => int
```
The new message:
+
```
Error: This function has arity2 but was expected arity3
```
diff --git a/_blogposts/archive/2020-04-13-bucklescript-release-7-3.mdx b/_blogposts/archive/2020-04-13-bucklescript-release-7-3.mdx
index 7be10a2aa..d94592ffe 100644
--- a/_blogposts/archive/2020-04-13-bucklescript-release-7-3.mdx
+++ b/_blogposts/archive/2020-04-13-bucklescript-release-7-3.mdx
@@ -17,7 +17,6 @@ For those unfamiliar with bs-platform, it is the platform for compiling
[ReasonML](https://reasonml.github.io/) and [OCaml](https://ocaml.org/) to fast
and readable JavaScript.
-
This is a major release with some highlighted features as below:
## Generalized uncurry calling convention support
@@ -27,7 +26,6 @@ an exciting change that we wrote a [separate
post](https://bucklescript.github.io/blog/2020/03/26/generalize-uncurry) for
details.
-
For uncurried support, we also fixed a long standing
[issue](https://github.com/BuckleScript/bucklescript/issues/4274) so that type
inference follows naturally using the new encoding.
@@ -48,7 +46,6 @@ consistent with JS: compiling `()` into `undefined`. Since in JS, `return
undefined` can be ignored in tail position, this leads to some other nice
enhancement.
-
```reason
let log = x => Js.log(x)
```
@@ -56,24 +53,24 @@ let log = x => Js.log(x)
The generated code used to be
```js
-function log(x){
- console.log(x);
- return /* () */ 0;
+function log(x) {
+ console.log(x);
+ return /* () */ 0;
}
```
It's now
```js
-function log(x){
- console.log(x)
+function log(x) {
+ console.log(x);
}
```
## Various improvements in code generation
We have increased the readability of the generated code in several common
-places, we believe that we reached *an important milestone* that if you write
+places, we believe that we reached _an important milestone_ that if you write
code using features that have counterparts in JS, the generated code is
readable. This is not a small achievement given that quite a lot of the
compiler code base is shared between native backend and JS backend.
@@ -82,7 +79,7 @@ There are some features that are not available in JS, for example, complex
pattern matches, the readability of those pieces of generated code will
continue being improved.
-Take several enhancement below as examples:
+Take several enhancement below as examples:
### Meaningful pattern match variable names
@@ -223,4 +220,3 @@ tweaking above to make the generated code more readable.
A full list of changes is available in our [Changelog
file](https://github.com/BuckleScript/bucklescript/blob/master/Changes.md#73).
-
diff --git a/_blogposts/archive/2020-05-06-a-story-of-exception-encoding.mdx b/_blogposts/archive/2020-05-06-a-story-of-exception-encoding.mdx
index 065681d34..8cfa83132 100644
--- a/_blogposts/archive/2020-05-06-a-story-of-exception-encoding.mdx
+++ b/_blogposts/archive/2020-05-06-a-story-of-exception-encoding.mdx
@@ -77,7 +77,7 @@ exception A of { x : int , y : string}
exception B
```
-`exception A` is encoded as an array of 3 slots. The first slot is a block by itself (called an *identity block*), while the second slot is for field x and the third slot for field y.
+`exception A` is encoded as an array of 3 slots. The first slot is a block by itself (called an _identity block_), while the second slot is for field x and the third slot for field y.
`exception B` is just the identity block.
@@ -99,23 +99,24 @@ The two values will be compiled into
{RE_EXN_ID : "A/uuid", x : 1, y : "x" }
{RE_EXN_ID : "B/uuid"}
```
+
As you can see, all exceptions (no matter with or without payload) share the same encoding.
What will happen when you raise an exception?
```reason
raise (A {x : 1 , y : "x"})
-````
+```
It generates following JS:
```js
-throw {RE_EXN_ID: "A/uuid", x : 1 , y : "x", Error : new Error ()}
+throw { RE_EXN_ID: "A/uuid", x: 1, y: "x", Error: new Error() };
```
The output above shows that we are now able to attach the stacktrace as an `Error` attribute very easily, since every exception is now an object instead of an array. Really cool!
-It's important to note that a stacktrace will only be attached *when you raise an exception*. In other words, the stacktrace will not be attached just by creating an exception (which is different to JS'es `new Error()` behavior).
+It's important to note that a stacktrace will only be attached _when you raise an exception_. In other words, the stacktrace will not be attached just by creating an exception (which is different to JS'es `new Error()` behavior).
## What does that mean for JS interop?
@@ -140,11 +141,10 @@ The `obj` value in the `Js.Exn.Error` branch is an opaque type to maintain type
- Please note that it's not allowed to rely on the key name `RE_EXN_ID`. It's an implementation detail which will probably be changed into a symbol in the future.
-- Don't over-use exceptions, remember exceptions should only be used in exceptional cases like division by zero. Whenever you try to express erroneous results, use the `result` or `option` type instead.
+- Don't over-use exceptions, remember exceptions should only be used in exceptional cases like division by zero. Whenever you try to express erroneous results, use the `result` or `option` type instead.
## Bonus
Now with our new exception encoding in place, a hidden feature called [extensible variant](https://caml.inria.fr/pub/docs/manual-ocaml/extensiblevariants.html) suddenly got way more interesting as well. Practically speaking, native exceptions are actually a special form of an extensible variant, so both are benefiting from the same representation changes!
-
Happy hacking and we would like your feedback!
diff --git a/_blogposts/archive/2020-05-06-state-of-reasonml-org-2020-q2-pt1.mdx b/_blogposts/archive/2020-05-06-state-of-reasonml-org-2020-q2-pt1.mdx
index 1e37bdedc..85d4d830b 100644
--- a/_blogposts/archive/2020-05-06-state-of-reasonml-org-2020-q2-pt1.mdx
+++ b/_blogposts/archive/2020-05-06-state-of-reasonml-org-2020-q2-pt1.mdx
@@ -41,16 +41,21 @@ It gives users a big-picture overview of the core Reason ecosystem as well as a
Last but not least, `reasonml.org` is built on Reason & BuckleScript as well, leading by example and dog-fooding along the way - spotting issues in newer compiler and syntax releases before they hit our users.
-We also give the community more power to chime in and take ownership over the documentation, and offer enough human capacity to collaborate on PRs (give guidance, help refine written texts, give early feedback), which is at the heart of great Open Source!
+We also give the community more power to chime in and take ownership over the documentation, and offer enough human capacity to collaborate on PRs (give guidance, help refine written texts, give early feedback), which is at the heart of great Open Source!
## What We've Accomplished
Building a documentation platform for a whole language ecosystem involves a lot of different disciplines. For this article we will cover three major topics: Structure & Design, the API Docs and the Reason Ecosystem Docs.
### The Structure and Design
+
The initial work was mostly about understanding the information architecture, relevant documentation dependencies, and finding all the relevant resources across different websites and blog posts. We have also spent a great amount of time finding a proper design language to visually codify different areas of the platform into a distinctive color scheme.
-
+
Surprisingly for us, the navigation and sitemap turned out to be the hardest part to figure out. We had to craft long-lived URLs that would work across multiple versions of the Reason compiler and standard library, had to do research about future localization possibilities, understand the guts and limits of different documentation tools such as docusaurus, find a way to enable component based theming, and then put everything in a layout that actually worked across all sorts of devices without being too cluttered or confusing.
@@ -60,7 +65,7 @@ We also focused a lot on early feedback from the community, so we regularly [pos
### Improving the API Docs (Belt / JS)
-The current [official BuckleScript's API docs](https://bucklescript.github.io/bucklescript/api/index_modules.html) aren't visually stunning, but they *are* important for getting things done as a user. The docs are maintained within the BuckleScript repository, and there was no process to make sure the documentation site remained up to date with each BuckleScript release. It also presented a huge bottleneck for anyone hoping to contribute from the outside. So [Nik Graf](https://twitter.com/nikgraf) bit the bullet, did the massive amount of grunt work to extract all the available modules and function headers into hand curated markdown files, and organize them into easily-maintained documents from a technical writer's perspective.
+The current [official BuckleScript's API docs](https://bucklescript.github.io/bucklescript/api/index_modules.html) aren't visually stunning, but they _are_ important for getting things done as a user. The docs are maintained within the BuckleScript repository, and there was no process to make sure the documentation site remained up to date with each BuckleScript release. It also presented a huge bottleneck for anyone hoping to contribute from the outside. So [Nik Graf](https://twitter.com/nikgraf) bit the bullet, did the massive amount of grunt work to extract all the available modules and function headers into hand curated markdown files, and organize them into easily-maintained documents from a technical writer's perspective.
So we now have most of BuckleScript v7's [JS / Belt module](/docs/manual/latest/api/belt) documented.
@@ -70,11 +75,14 @@ We are now working on further automating the process for generating BuckleScript
Our goal is to have a properly curated, well structured and streamlined overview for all core resources of the Reason platform. So we relocated all the information from the ReasonML, BuckleScript, ReasonReact and GenType website to the reasonml.org codebase.
-
+
It didn't take long until we realized that we can't just keep the upstream version in its original form, so we started to make adaptations where it made sense. We also accepted new additions from the community, such as explanations about [function signatures on optional arguments](/docs/manual/latest/function#signatures-and-type-annotations) in the Reason manual, or a new decorator overview in the BuckleScript section.
-
That said, we do keep track of new changes on the upstream sources and cherry-pick changes if necessary. To make this process more transparent, we introduced a version table on our [startpage](/) to make it easier to see the latest cherry-pick commit for each resource (ReasonML, BuckleScript, etc.).
### So Is reasonml.org Always Up to Date?
@@ -92,6 +100,7 @@ We will try to put a banner on the website soon to prevent confusion.
## What is still missing?
So far following features are still missing:
+
- Full Page Search
- Reason Playground
- Full API Docs
@@ -112,7 +121,7 @@ This article is part of the "State of reasonml.org 2020-Q2" series, which will c
The progress on `reasonml.org` has been fantastic so far. Even though the current global health situation pushed us a bit behind our original schedule with the Reason playground, etc, we are still quite happy with the outcome and we hope you are as well!
-`reasonml.org` is still a work in progress and there is, of course, *much* to build before reaching the first official release. Until then, we would love for you to give it a try and let us know what you think, either by opening an issue, or even a PR.
+`reasonml.org` is still a work in progress and there is, of course, _much_ to build before reaching the first official release. Until then, we would love for you to give it a try and let us know what you think, either by opening an issue, or even a PR.
In case you have any questions or comments, make sure to let us know in the [Reason Discord](https://discord.gg/reasonml) `#docs` channel!
diff --git a/_blogposts/archive/2020-05-11-state-of-reasonml-org-2020-q2-pt2.mdx b/_blogposts/archive/2020-05-11-state-of-reasonml-org-2020-q2-pt2.mdx
index abed7dcf0..67733aabb 100644
--- a/_blogposts/archive/2020-05-11-state-of-reasonml-org-2020-q2-pt2.mdx
+++ b/_blogposts/archive/2020-05-11-state-of-reasonml-org-2020-q2-pt2.mdx
@@ -21,19 +21,19 @@ To tackle this issue, we built a simple mechanism to automatically verify every
A markdown example with a code snippet might look like this:
-~~~
+````
some text with some broken `List.head` example:
```reason example
Belt.List.head([]); /* None */
List.head([1, 2, 3]); /* This should actually be Belt.List */
```
-~~~
+````
Running the test with the broken example would produce:
```sh
-node scripts/test-examples.js "pages/apis/latest/belt/list.mdx"
+node scripts/test-examples.mjs "pages/apis/latest/belt/list.mdx"
Testing example in 'pages/apis/latest/belt/list.mdx' on line 23...
Testing example in 'pages/apis/latest/belt/list.mdx' on line 43...
@@ -54,7 +54,7 @@ Failed: 1
Success: 55
Tip: You can also run tests just for specific files / globs:
-`node scripts/test-examples.js "pages/belt_docs/array.mdx"`
+`node scripts/test-examples.mjs "pages/belt_docs/array.mdx"`
-----------
Error Preview:
@@ -136,7 +136,7 @@ Right now, the official documentation websites are maintained by the Reason / Bu
Also knowing just one project well is not enough to build a documentation platform for the whole ecosystem. For instance, it doesn't make sense to only write about Reason syntax features when most of the interesting features are coupled to the Reason JS compiler (BuckleScript).
-We tried our best to raise enough funding and set our budgets in a way that allows us to allocate time and resources to work *full time* on the documentation for 2020. That means that we can build up competences with a holistic view on the whole Reason platform, and can spend enough time on reviewing PRs, giving feedback and allocating tasks. We also want to make sure to lower the bus factor by adding more core documentation maintainers in the future. Continuous and deep collaboration, proper guidance and mutual trust will be the foundation for this.
+We tried our best to raise enough funding and set our budgets in a way that allows us to allocate time and resources to work _full time_ on the documentation for 2020. That means that we can build up competences with a holistic view on the whole Reason platform, and can spend enough time on reviewing PRs, giving feedback and allocating tasks. We also want to make sure to lower the bus factor by adding more core documentation maintainers in the future. Continuous and deep collaboration, proper guidance and mutual trust will be the foundation for this.
To wrap things up, we think that we'll be able to establish a reliable documentation focused culture to share responsibilities within the community. That said, we'll try to be clear on our processes and goals, since we believe these are key aspects for successful collaboration.
diff --git a/_blogposts/archive/2020-05-12-state-of-reasonml-org-2020-q2-pt3.mdx b/_blogposts/archive/2020-05-12-state-of-reasonml-org-2020-q2-pt3.mdx
index 3bd1c4542..3fdfcc66b 100644
--- a/_blogposts/archive/2020-05-12-state-of-reasonml-org-2020-q2-pt3.mdx
+++ b/_blogposts/archive/2020-05-12-state-of-reasonml-org-2020-q2-pt3.mdx
@@ -16,7 +16,6 @@ In [part 2](/blog/state-of-reasonml-org-2020-q2-pt2) of this blog series, we tal
This article will cover some features and exciting ideas we have been working on for quite a while now. Even though these features are not fully implemented yet, we still think it's important to communicate the whole spectrum of the project.
-
## Generating Full API Docs
As we already mentioned in our previous posts, the API documentation is currently maintained by hand, and we only offer documentation for the `Js` and `Belt` module, since they are the most relevant for BuckleScript development.
@@ -37,7 +36,11 @@ We don't have any **search functionality** yet, and this will take some more tim
There were some solutions, but still, Algolia turned out to be the best candidate with its smallest pricing tier. We don't want to rely on the Algolia OSS webscraping API, since it doesn't give us enough control on manipulating the search results, and we need more control if we want to be able to design a custom search experience.
-
+
We did the ground work for our search feature and we will get into more detail as soon as we are able to generate API docs with our aforementioned `doc-tools`. Like with the API docs, we'll first need the doc-tools infrastructure so we can generate indexable data for Algolia as well.
@@ -45,7 +48,11 @@ We did the ground work for our search feature and we will get into more detail a
We also invested a lot of time into thinking about the future of the Reason playground from a UX perspective. Our most important goal is to make it possible to switch BuckleScript versions on demand. We also wanted the relevant Reason version to be part of the playground bundle.
-
+
Users should always know what version of BuckleScript / Reason is running when writing and sharing code, and the code written on a playground should be runnable with an equivalent bs-platform setup on a local machine. Right now, `reasonml.github.io/try` uses different refmt.js / playground bundle versions, which makes it really hard to write reproducible code for the same BuckleScript version.
diff --git a/_blogposts/archive/2020-05-15-a-story-of-lazy-encoding.mdx b/_blogposts/archive/2020-05-15-a-story-of-lazy-encoding.mdx
index c5f9e0ac4..e19b368b2 100644
--- a/_blogposts/archive/2020-05-15-a-story-of-lazy-encoding.mdx
+++ b/_blogposts/archive/2020-05-15-a-story-of-lazy-encoding.mdx
@@ -8,7 +8,6 @@ description: |
and how it will benefit our users.
---
-
## Introduction
Recently we made some significant improvements with our new encoding for lazy values, and we find it so exciting that we want to highlight the changes. The new encoding generates very idiomatic JS output like hand-written code.
@@ -35,6 +34,7 @@ Js.log2 (la, lb); // logging forced values
```
When compiled and run in `node`, the runtime representation of our lazy values will look something like:
+
```bash
lazy_demo$node src/lazy_demo.bs.js
[ [Function], tag: 246 ] 3 # logging the output of two lazy blocks
@@ -43,21 +43,22 @@ Hello, lazy # lazy1, laz2 evaluated forced by pattern match, hence logging
```
With the new encoding, the output of the same example code would look like this:
+
```bash
{ RE_LAZY_DONE: false, value: [Function: value] } { RE_LAZY_DONE: true, value: 3 } # logging block one with new encoding
Hello, lazy
1 3
```
-As you can see, with the new encoding, no magic tags like 246 appear, and the lazy status is clearly marked via `RE_LAZY_DONE: (true | false) `.
+As you can see, with the new encoding, no magic tags like 246 appear, and the lazy status is clearly marked via `RE_LAZY_DONE: (true | false) `.
In fact, the code quality of our generated `bs.js` files has also improved. Going back to our old version, the generated JS would look like this:
```js
-var lazy1 = Caml_obj.caml_lazy_make((function (param) {
- console.log("Hello, lazy");
- return 1;
- }));
+var lazy1 = Caml_obj.caml_lazy_make(function (param) {
+ console.log("Hello, lazy");
+ return 1;
+});
console.log(lazy1, 3);
@@ -71,18 +72,20 @@ var lazy2 = 3;
```
In our new version with all the new changes to the lazy encoding, the output is way more simplified:
+
```js
var lazy1 = {
RE_LAZY_DONE: false,
- value: (function () { // closure now is uncurried arity-0 function
- console.log("Hello, lazy");
- return 1;
- })
+ value: function () {
+ // closure now is uncurried arity-0 function
+ console.log("Hello, lazy");
+ return 1;
+ },
};
var lazy2 = {
RE_LAZY_DONE: true,
- value: 3
+ value: 3,
};
console.log(lazy1, lazy2);
@@ -105,11 +108,10 @@ In the native runtime environment, the encoding of lazy values is rather complic
So in our current master branch, we drastically simplified our lazy encoding scheme to optimize for the JS runtime as much as possible:
- The encoding is uniform; it is always an object of two key value pairs. One is `RE_LAZY_DONE` to mark its status,
-the other is either a closure or an evaluated value.
+ the other is either a closure or an evaluated value.
- The compiler optimization still kicks in at compile time: if it knows a lazy value is already evaluated or does not need to be evaluated, it will promote its status to be 'done'. However, unlike in a native environment, unboxing is not happening. This makes sense since the most interesting unboxing scenarios only happen during runtime and not during compile time (a scenario which is impossible in the JSVM).
-
With the new encoding, `lazy` is now way more viable for JS usage, so we encourage our users to use it whenever it is convenient!
## Caveats:
diff --git a/_blogposts/archive/2020-05-15-state-of-reasonml-org-2020-q2-pt4.mdx b/_blogposts/archive/2020-05-15-state-of-reasonml-org-2020-q2-pt4.mdx
index 47b47b0bb..4334541c4 100644
--- a/_blogposts/archive/2020-05-15-state-of-reasonml-org-2020-q2-pt4.mdx
+++ b/_blogposts/archive/2020-05-15-state-of-reasonml-org-2020-q2-pt4.mdx
@@ -22,7 +22,7 @@ Our goal is to increase the number of Reason developers by focusing on the bigge
Thinking back to when Reason got its first massive surge in traction around 2017, the primary motivation around adoption was its JS-dev friendly nature, with good JS interop and superb React support. Many people spoke at conferences and meetups because they were really excited about having a strongly typed language, with the right level of escape hatches to allow seamless interop with existing JS.
-We had *massive* success with ReasonConf 2018, which was mainly targeted at complete Reason beginners, and experienced JS developers. The demand was huge, and actually still is!
+We had _massive_ success with ReasonConf 2018, which was mainly targeted at complete Reason beginners, and experienced JS developers. The demand was huge, and actually still is!
#### What about Native Compilation?
@@ -40,14 +40,17 @@ In the app development space, for many companies the BuckleScript / NodeJS / Ele
There needs to be a clearer separation between both platforms (JS and OCaml), a stronger focus on the JS use-case and clear instructions on getting into native, for those who are ready to do so and need the extra performance.
-
#### Marketing and Newcomer Sustainability
In the past few months, we observed more and more newcomers getting into the BuckleScript platform to build ReasonReact applications. Those Reason developers also started to talk more about Reason at JS conferences, meetups and [podcasts](https://youtu.be/0Usnsda0WDo), which caused yet another wave of newcomers joining the Discord chat to ask for guidance, which is a great virtuous cycle (fun fact: it also seems we just hit the [10k users mark](https://discordapp.com/channels/235176658175262720/235176658175262720/702838691227369502))!
Fair enough, the only "real numbers and statistics" we can showcase are vague, but still interesting: Just typing in ["reasonml" on Youtube](https://www.youtube.com/results?search_query=reasonml) shows a list of videos mostly targeted to JS audiences.
-
+
To put this in relation to some "high volume" [ReasonConf](https://www.youtube.com/channel/UCtFP_Hn5nIbZY4Xi47qfHhw?view_as=subscriber) viewing numbers: Our best performing videos are our ReasonConf keynotes (2018: 3.3k, 2019: 4,3k, 2019 US: 18k). These are relatively low numbers in comparison to talks like [ReasonML for skeptics by Eric Shaefer](https://www.youtube.com/watch?v=EmBzyBQU760), ticking in at 6.4k views ([React Day Berlin](https://reactday.berlin/)) and Ken Wheeler's [ReasonML is Serious Business](https://www.youtube.com/watch?v=lzEweA7RPi0) at React Rally 2018, which accumulated a pretty huge number of 15k views.
@@ -62,6 +65,7 @@ Hopefully for the future, with a unified documentation platform and blog as a ce
So what about the native documentation then? `reasonml.org` reserved a spot for the Native platform, but it requires a lot of dedicated work to "Reasonify" most OCaml platform resources first.
**Documentation would include:**
+
- Reasonified OCaml manual
- esy & opam
- dune
@@ -77,7 +81,6 @@ Please be aware that we are not the ones to make a final decision on this: In th
That said, **we are looking for contributors** to help us with the documentation of the "Reason Native" section, since it requires a ton of work, knowledge and dedication to split the workload into a list of actionables and to coordinate the technical writing.
-
## Conclusion
Building documentation is not only a technical challenge, it's also about having a proper vision and putting focus on certain aspects of the language. We should not only think about technical ingenuity, but also keep an eye on bringing in more people. Our hopes is that we can break the complexity of understanding the language by focusing on a single use-case, then later branch out to more complex areas in well isolated manners, as soon as we get ready for prime time.
diff --git a/_blogposts/archive/2020-06-22-overview-of-new_encoding.mdx b/_blogposts/archive/2020-06-22-overview-of-new_encoding.mdx
index 4f44a87c8..066c75f3f 100644
--- a/_blogposts/archive/2020-06-22-overview-of-new_encoding.mdx
+++ b/_blogposts/archive/2020-06-22-overview-of-new_encoding.mdx
@@ -20,7 +20,7 @@ this is very helpful for advanced users to write performance predictable JS code
This is a nice [introduction](https://mrale.ph/blog/2012/06/03/explaining-js-vms-in-js-inline-caches.html) to inline caching if you are unfamiliar with this topic,
or you can skip the section about IC and come back later when you get more familiar.
-Note: this article is quite dense, so we will skip the old encoding.
+Note: this article is quite dense, so we will skip the old encoding.
## Record (stable)
@@ -39,14 +39,15 @@ let rand = ({loBits; hiBits}) => loBits + hiBits;
```
It will generate JS output as below:
+
```js
-var value = {lo : 32, hi : 33}
-function rand (param){
- return param.lo + param.hi
+var value = { lo: 32, hi: 33 };
+function rand(param) {
+ return param.lo + param.hi;
}
```
-If users want to make it even shorter, in next version, they can choose to compile record as an array, as follows:
+If users want to make it even shorter, in next version, they can choose to compile record as an array, as follows:
```reasonml
type int64 = {
@@ -60,9 +61,9 @@ let rand = ({loBits, hiBits}) => loBits + hiBits;
This produces the following JS output:
```js
-var value = [32,33]
-function rand(param){
- return param[0] + param[1]
+var value = [32, 33];
+function rand(param) {
+ return param[0] + param[1];
}
```
@@ -75,7 +76,8 @@ only the type definition needs to be adapted; other parts of code remain untouch
Records are always in a perfect position for Inline Caching(IC); the compiler can ensure all generated records are of the same shape.
## Variant (internal)
-This encoding for variants may be subject to change in the future, but it is so simple that it makes sense for users to have a basic understanding.
+
+This encoding for variants may be subject to change in the future, but it is so simple that it makes sense for users to have a basic understanding.
Take the following type definition, for example:
@@ -88,12 +90,13 @@ let empty = Empty ;
let v0 = Black (empty, 3, empty);
let v1 = Red (empty, 3, empty);
```
+
The generated JS code would be:
```js
-var empty =/*Empty*/ 0;
-var v0 = {TAG : 0/*Black*/, _0 : /*Empty*/ 0 , _1 : 3 , _2 : /*Empty */ 0};
-var v1 = {TAG : 1/*Red*/, _0 : /*Empty*/ 0 , _1 : 3 , _2 : /*Empty */ 0};
+var empty = /*Empty*/ 0;
+var v0 = { TAG: 0 /*Black*/, _0: /*Empty*/ 0, _1: 3, _2: /*Empty */ 0 };
+var v1 = { TAG: 1 /*Red*/, _0: /*Empty*/ 0, _1: 3, _2: /*Empty */ 0 };
```
As you can see, variants are divided into two categories.
@@ -113,14 +116,15 @@ let empty = Empty ;
let v0 = Black ({l:empty, value: 3, r:empty});
let v1 = Red ({l:empty, value:3, r: empty});
```
+
The generated JS code would be:
+
```js
var empty =/*Empty*/ 0;
var v0 = {TAG : 0/*Black*/, l: /*Empty*/ 0 , value : 3 , r: : /*Empty */ 0};
var v1 = {TAG : 1/*Red*/, l : /*Empty*/ 0 , value : 3 , r : /*Empty */ 0};
```
-
### Special case when the number of variants which has payload is only 1.
Take the types below for example:
@@ -131,17 +135,17 @@ type list =
| Cons (int , list);
```
-
-Since only one variant has a payload, the compiler does not need add `TAG` when we destructure the data for pattern matching.
+Since only one variant has a payload, the compiler does not need add `TAG` when we destructure the data for pattern matching.
Thus, the following code:
```reasonml
let u = Cons(1,Nil)
```
+
will generate the following JS output:
```js
-var u = {_0: 1, _1 : /*Nil*/ 0 }; // No TAG data.
+var u = { _0: 1, _1: /*Nil*/ 0 }; // No TAG data.
```
### Specialized for immutable list
@@ -160,7 +164,9 @@ Since lists are so pervasive, we provide some special treatment so that
```reasonml
let u = [0,1,2,3]
```
+
Will generate js code as below:
+
```js
var u = {hd : 0, {tl : {hd : 1, {tl : {hd: 2, {tl : {hd :3 , tl : /*[]*/0 }}}}}}}
```
@@ -196,13 +202,21 @@ Note we only generate constructor names in comments for debugging.
When constructor names are attached to the data, it will be more useful for debugging. When debug mode is activated using `-bs-g`,
The generated code will be changed from below
+
```js
-var v0 = {TAG : 0/*Black*/, _0 : /*Empty*/ 0 , _1 : 3 , _2 : /*Empty */ 0};
+var v0 = { TAG: 0 /*Black*/, _0: /*Empty*/ 0, _1: 3, _2: /*Empty */ 0 };
```
+
to
```js
-var v0 = {TAG : 0, _0 : /*Empty*/ 0 , _1 : 3 , _2 : /*Empty */ 0, [Symbol.for("name")]: "Black"};
+var v0 = {
+ TAG: 0,
+ _0: /*Empty*/ 0,
+ _1: 3,
+ _2: /*Empty */ 0,
+ [Symbol.for("name")]: "Black",
+};
```
## Polymorphic-variant (internal)
@@ -214,9 +228,11 @@ let u = 3 -> `hello
```
It will generate
+
```js
-var u = {HASH : MAGIC_NUMBER, VAL: 3 }
+var u = { HASH: MAGIC_NUMBER, VAL: 3 };
```
+
The field of `HASH` is the hash of name `"hello"`, while the `VAL` is the payload
### IC friendliness
@@ -224,25 +240,25 @@ The field of `HASH` is the hash of name `"hello"`, while the `VAL` is the payloa
Polymorphic variants are always in a perfect position for IC, the compiler can ensure all generated objects are of the same shape.
This is because the payload is not unpacked; it is always just one payload.
-
### Polymorphic variant in debug mode
In debug mode, similar to variant, we carry the name in generated code for debugging,
So instead of
+
```js
-var u = {HASH : MAGIC_NUMBER, VAL: 3 }
+var u = { HASH: MAGIC_NUMBER, VAL: 3 };
```
It will generate
```js
-var u = {HASH : MAGIC_NUMBER, VAL: 3 , [Symbol.for("name")] : "hello"}
+var u = { HASH: MAGIC_NUMBER, VAL: 3, [Symbol.for("name")]: "hello" };
```
## Conclusion
-BuckleScript users will profit from better runtime performance and a better debugging experience for various data types, such as variants,
+BuckleScript users will profit from better runtime performance and a better debugging experience for various data types, such as variants,
exceptions, lazy values and more since version 8.0.
Happy Hacking!
diff --git a/_blogposts/archive/2020-07-01-bucklescript-8-1-new-syntax.mdx b/_blogposts/archive/2020-07-01-bucklescript-8-1-new-syntax.mdx
index 9e7ec7bf0..a233692b4 100644
--- a/_blogposts/archive/2020-07-01-bucklescript-8-1-new-syntax.mdx
+++ b/_blogposts/archive/2020-07-01-bucklescript-8-1-new-syntax.mdx
@@ -16,9 +16,10 @@ The release of BuckleScript 8.1 contains a new important addition: we've rewritt
The rewrite was done by a community member of ours, [Maxim](https://twitter.com/_binary_search). Maxim was a main contributor to the old Reason repo, and together we've reached the conclusion a while ago that the codebase needed a revamp. After wrestling with it for the longest time, we've settled on a low-key rewrite.
-Syntax discussions have always been churny, so we didn't want to prematurity announce something before it's ready for proper critiques. After testing this extensively; we now deem it solid enough for your consumption.
+Syntax discussions have always been churny, so we didn't want to prematurely announce something before it's ready for proper critiques. After testing this extensively, we now deem it solid enough for your consumption.
**Here's what you need to know:**
+
- The new syntax comes directly with your BuckleScript >=8.1 installation. You won't have to install anything else. It does not depend on the old `refmt`.
- There are a few differences in syntax between the Reason syntax, documented in the [migration docs](/docs/manual/v8.0.0/migrate-from-bucklescript-reason).
- The migration docs also guides you toward converting your codebase to the new syntax, file by file or project by project.
diff --git a/_blogposts/archive/2020-07-06-a-note-on-bucklescripts-future-commitments.mdx b/_blogposts/archive/2020-07-06-a-note-on-bucklescripts-future-commitments.mdx
index 3f300f8ac..c9d15fa0c 100644
--- a/_blogposts/archive/2020-07-06-a-note-on-bucklescripts-future-commitments.mdx
+++ b/_blogposts/archive/2020-07-06-a-note-on-bucklescripts-future-commitments.mdx
@@ -16,7 +16,7 @@ description: |
Our [new ReScript syntax announcement](/blog/bucklescript-8-1-new-syntax) generated lots of good feedback, but also raised some concerns from community members whose use-cases still align with our goal, but sometimes extend outside of it, and who are worried about further commitments to the ecosystem in the face of new unknowns.
-This post is dedicated to answer some commons questions regarding trust, breakages, and future investment.
+This post is dedicated to answer some common questions regarding trust, breakages, and future investment.
## Q & A
diff --git a/_blogposts/archive/2020-07-17-bucklescript-release-8-1-1.mdx b/_blogposts/archive/2020-07-17-bucklescript-release-8-1-1.mdx
index e05a44d49..96a996451 100644
--- a/_blogposts/archive/2020-07-17-bucklescript-release-8-1-1.mdx
+++ b/_blogposts/archive/2020-07-17-bucklescript-release-8-1-1.mdx
@@ -23,7 +23,7 @@ Small changes, big difference. This release also marks our syntax's **feature fr
## A New Converter and Formatter Flag for `bsc`
-We added a new experimental flag `-fmt`, which allows you to format any `.res`/`.resi` file, or convert any `.re`/`.rei`/`.ml`/`.mli` file to the new syntax.
+We added a new experimental flag `-fmt`, which allows you to format any `.res`/`.resi` file, or convert any `.re`/`.rei`/`.ml`/`.mli` file to the new syntax.
**Usage:** `bsc -fmt MyFile.res` will print out the pretty printed content of `MyFile.res` to stdout.
diff --git a/_blogposts/archive/2020-07-28-string-literal-types-in-reason.mdx b/_blogposts/archive/2020-07-28-string-literal-types-in-reason.mdx
index 618344aa4..2a3332f58 100644
--- a/_blogposts/archive/2020-07-28-string-literal-types-in-reason.mdx
+++ b/_blogposts/archive/2020-07-28-string-literal-types-in-reason.mdx
@@ -8,7 +8,6 @@ description: |
and how they will benefit our users.
---
-
## String literal types in BuckleScript
[String literal types](https://www.typescriptlang.org/docs/handbook/advanced-types.html#string-literal-types) were introduced by TypeScript to model
@@ -46,7 +45,7 @@ function encoding(en) {
}
```
-If you pass a random encoding, e.g, `` encoding (`ucs32) ``, you get a type error:
+If you pass a random encoding, e.g, ``encoding (`ucs32)``, you get a type error:
```
This expression has type [> `ucs32 ]
@@ -99,6 +98,7 @@ type ascii = [
]
```
+
You can also embed string literal types directly inside other types without declaring it first:
```reasonml
@@ -158,6 +158,7 @@ type encoding = [
[@bs.val] [@bs.module "fs"]
external readFileSync: (string, encoding) => string = "readFileSync";
```
+
## String literal types attached to data
Since Reason is a typed language, you can not mix data of different types in a collection.
@@ -172,7 +173,7 @@ With string literal types, you can do things like this:
[ 3 -> `Int , "3" -> `String ]
```
-Note the generated code for `` 3 -> `Int`, "3"-> `String `` would be:
+Note the generated code for ``3 -> `Int`, "3"-> `String`` would be:
```js
{ NAME: "Int", VAL : 3}
diff --git a/_blogposts/archive/2020-08-03-bucklescript-release-8-2.mdx b/_blogposts/archive/2020-08-03-bucklescript-release-8-2.mdx
index f52104246..5bdd19640 100644
--- a/_blogposts/archive/2020-08-03-bucklescript-release-8-2.mdx
+++ b/_blogposts/archive/2020-08-03-bucklescript-release-8-2.mdx
@@ -16,8 +16,6 @@ Besides the exciting string literal types, this release continues to deliver bet
Thanks to the integration of Flow parser, we are able to make the JS interop [more safe and expressive](https://github.com/BuckleScript/bucklescript/issues/4463)
-
The full changes are listed [here](https://github.com/BuckleScript/bucklescript/blob/master/Changes.md)
Enjoy!
-
diff --git a/compilers/README.md b/compilers/README.md
index 37503ac3b..ceebd0b28 100644
--- a/compilers/README.md
+++ b/compilers/README.md
@@ -2,4 +2,4 @@
This folder is needed to install additional rescript compiler versions for testing our documented source code on multiple compiler versions.
-Our `scripts/test-examples.js` script will automatically install all package.json dependencies if it cannot find any compiler versions.
+Our `scripts/test-examples.mjs` script will automatically install all package.json dependencies if it cannot find any compiler versions.
diff --git a/compilers/dummy/Dummy.res b/compilers/dummy/Dummy.res
new file mode 100644
index 000000000..216d35a7a
--- /dev/null
+++ b/compilers/dummy/Dummy.res
@@ -0,0 +1 @@
+Console.log("I am a dummy file")
diff --git a/compilers/package-lock.json b/compilers/package-lock.json
index 758506298..9a20b57aa 100644
--- a/compilers/package-lock.json
+++ b/compilers/package-lock.json
@@ -9,13 +9,92 @@
"version": "1.0.0",
"license": "MIT",
"dependencies": {
+ "@rescript/core": "^1.3.0",
+ "@rescript/react": "^0.12.0",
"rescript-1000": "npm:rescript@10.0.0",
- "rescript-1010": "npm:rescript@10.1.0-rc.4",
+ "rescript-1010": "npm:rescript@10.1.0",
+ "rescript-1100": "npm:rescript@11.0.0",
+ "rescript-1110": "npm:rescript@11.1.0",
"rescript-820": "npm:bs-platform@8.2.0",
"rescript-902": "npm:bs-platform@9.0.2",
"rescript-912": "npm:rescript@9.1.2"
}
},
+ "node_modules/@rescript/core": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/@rescript/core/-/core-1.3.0.tgz",
+ "integrity": "sha512-wNZOZ63sYcaIYZCmTZeIPCeLa3HCGgPbIOR8zjyNkoBYUlxNV8Nb2ZyqlXR5Mb9ttvv8fTV56JbKhyVEZEYo8g==",
+ "peerDependencies": {
+ "rescript": "^11.1.0-rc.7"
+ }
+ },
+ "node_modules/@rescript/react": {
+ "version": "0.12.0",
+ "resolved": "https://registry.npmjs.org/@rescript/react/-/react-0.12.0.tgz",
+ "integrity": "sha512-EBLsf5rD7sJOjgfLLGwuLw/hONszc3UtYnIVgv7OdTyUNR41/m4deVm62PI0agvr3kWakXz4KchKRSd+19/bRA==",
+ "peerDependencies": {
+ "react": ">=18.0.0",
+ "react-dom": ">=18.0.0"
+ }
+ },
+ "node_modules/js-tokens": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
+ "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==",
+ "peer": true
+ },
+ "node_modules/loose-envify": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz",
+ "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==",
+ "peer": true,
+ "dependencies": {
+ "js-tokens": "^3.0.0 || ^4.0.0"
+ },
+ "bin": {
+ "loose-envify": "cli.js"
+ }
+ },
+ "node_modules/react": {
+ "version": "18.2.0",
+ "resolved": "https://registry.npmjs.org/react/-/react-18.2.0.tgz",
+ "integrity": "sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==",
+ "peer": true,
+ "dependencies": {
+ "loose-envify": "^1.1.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/react-dom": {
+ "version": "18.2.0",
+ "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.2.0.tgz",
+ "integrity": "sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==",
+ "peer": true,
+ "dependencies": {
+ "loose-envify": "^1.1.0",
+ "scheduler": "^0.23.0"
+ },
+ "peerDependencies": {
+ "react": "^18.2.0"
+ }
+ },
+ "node_modules/rescript": {
+ "version": "11.1.1",
+ "resolved": "https://registry.npmjs.org/rescript/-/rescript-11.1.1.tgz",
+ "integrity": "sha512-FMELeoiR1n3LzBdBt+k7U4l0vsz5Xh0HBSHf+0NhyhzZkMRLkEKEDNrcqZc6RIux9bxmxoO+zEa9qFM01VOXAw==",
+ "hasInstallScript": true,
+ "peer": true,
+ "bin": {
+ "bsc": "bsc",
+ "bstracing": "lib/bstracing",
+ "rescript": "rescript"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+ },
"node_modules/rescript-1000": {
"name": "rescript",
"version": "10.0.0",
@@ -31,9 +110,9 @@
},
"node_modules/rescript-1010": {
"name": "rescript",
- "version": "10.1.0-rc.4",
- "resolved": "https://registry.npmjs.org/rescript/-/rescript-10.1.0-rc.4.tgz",
- "integrity": "sha512-xvUfEKBs1U/WN1mFX8YipvNj7KUChX/ULvyb1TP2wSR2qgNrcRAy+dW7jc2F2tv0Qbrc47HEZi/1Ni0z3nVvmw==",
+ "version": "10.1.0",
+ "resolved": "https://registry.npmjs.org/rescript/-/rescript-10.1.0.tgz",
+ "integrity": "sha512-85KLtBECo+hYwObbifXk5xpxUCUFMWgCR1w7hDDGhhXIXqEpHQ2ds6o++YPxzXjLuU1/qA7Iovq2zUX4opejQw==",
"hasInstallScript": true,
"bin": {
"bsc": "bsc",
@@ -42,6 +121,36 @@
"rescript": "rescript"
}
},
+ "node_modules/rescript-1100": {
+ "name": "rescript",
+ "version": "11.0.0",
+ "resolved": "https://registry.npmjs.org/rescript/-/rescript-11.0.0.tgz",
+ "integrity": "sha512-uIUwDZZmDUb7ymGkBiiGioxMg8hXh1mze/2k/qhYQcZGgi7PrLHQIW9AksM7gb9WnpjCAvFsA8U2VgC0nA468w==",
+ "hasInstallScript": true,
+ "bin": {
+ "bsc": "bsc",
+ "bstracing": "lib/bstracing",
+ "rescript": "rescript"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/rescript-1110": {
+ "name": "rescript",
+ "version": "11.1.0",
+ "resolved": "https://registry.npmjs.org/rescript/-/rescript-11.1.0.tgz",
+ "integrity": "sha512-9la2Dv+ACylQ77I8s4spPu1JnLZXbH5WgxcLHLLUBWgFFSiv0wXqgzWztrBIZqwFgVX5BYcwldUqUVcEzdCyHg==",
+ "hasInstallScript": true,
+ "bin": {
+ "bsc": "bsc",
+ "bstracing": "lib/bstracing",
+ "rescript": "rescript"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+ },
"node_modules/rescript-820": {
"name": "bs-platform",
"version": "8.2.0",
@@ -66,18 +175,89 @@
"bstracing": "lib/bstracing",
"rescript": "rescript"
}
+ },
+ "node_modules/scheduler": {
+ "version": "0.23.0",
+ "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.0.tgz",
+ "integrity": "sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==",
+ "peer": true,
+ "dependencies": {
+ "loose-envify": "^1.1.0"
+ }
}
},
"dependencies": {
+ "@rescript/core": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/@rescript/core/-/core-1.3.0.tgz",
+ "integrity": "sha512-wNZOZ63sYcaIYZCmTZeIPCeLa3HCGgPbIOR8zjyNkoBYUlxNV8Nb2ZyqlXR5Mb9ttvv8fTV56JbKhyVEZEYo8g==",
+ "requires": {}
+ },
+ "@rescript/react": {
+ "version": "0.12.0",
+ "resolved": "https://registry.npmjs.org/@rescript/react/-/react-0.12.0.tgz",
+ "integrity": "sha512-EBLsf5rD7sJOjgfLLGwuLw/hONszc3UtYnIVgv7OdTyUNR41/m4deVm62PI0agvr3kWakXz4KchKRSd+19/bRA==",
+ "requires": {}
+ },
+ "js-tokens": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
+ "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==",
+ "peer": true
+ },
+ "loose-envify": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz",
+ "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==",
+ "peer": true,
+ "requires": {
+ "js-tokens": "^3.0.0 || ^4.0.0"
+ }
+ },
+ "react": {
+ "version": "18.2.0",
+ "resolved": "https://registry.npmjs.org/react/-/react-18.2.0.tgz",
+ "integrity": "sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==",
+ "peer": true,
+ "requires": {
+ "loose-envify": "^1.1.0"
+ }
+ },
+ "react-dom": {
+ "version": "18.2.0",
+ "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.2.0.tgz",
+ "integrity": "sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==",
+ "peer": true,
+ "requires": {
+ "loose-envify": "^1.1.0",
+ "scheduler": "^0.23.0"
+ }
+ },
+ "rescript": {
+ "version": "11.1.1",
+ "resolved": "https://registry.npmjs.org/rescript/-/rescript-11.1.1.tgz",
+ "integrity": "sha512-FMELeoiR1n3LzBdBt+k7U4l0vsz5Xh0HBSHf+0NhyhzZkMRLkEKEDNrcqZc6RIux9bxmxoO+zEa9qFM01VOXAw==",
+ "peer": true
+ },
"rescript-1000": {
"version": "npm:rescript@10.0.0",
"resolved": "https://registry.npmjs.org/rescript/-/rescript-10.0.0.tgz",
"integrity": "sha512-LhNg/4+0j8NvoFeslgAeYLlzUwkq6kR6l6v8BnZ61VDTxopK2l96uT1lq5lv1aMxzMDynvE2qnX0zalre+6XxA=="
},
"rescript-1010": {
- "version": "npm:rescript@10.1.0-rc.4",
- "resolved": "https://registry.npmjs.org/rescript/-/rescript-10.1.0-rc.4.tgz",
- "integrity": "sha512-xvUfEKBs1U/WN1mFX8YipvNj7KUChX/ULvyb1TP2wSR2qgNrcRAy+dW7jc2F2tv0Qbrc47HEZi/1Ni0z3nVvmw=="
+ "version": "npm:rescript@10.1.0",
+ "resolved": "https://registry.npmjs.org/rescript/-/rescript-10.1.0.tgz",
+ "integrity": "sha512-85KLtBECo+hYwObbifXk5xpxUCUFMWgCR1w7hDDGhhXIXqEpHQ2ds6o++YPxzXjLuU1/qA7Iovq2zUX4opejQw=="
+ },
+ "rescript-1100": {
+ "version": "npm:rescript@11.0.0",
+ "resolved": "https://registry.npmjs.org/rescript/-/rescript-11.0.0.tgz",
+ "integrity": "sha512-uIUwDZZmDUb7ymGkBiiGioxMg8hXh1mze/2k/qhYQcZGgi7PrLHQIW9AksM7gb9WnpjCAvFsA8U2VgC0nA468w=="
+ },
+ "rescript-1110": {
+ "version": "npm:rescript@11.1.0",
+ "resolved": "https://registry.npmjs.org/rescript/-/rescript-11.1.0.tgz",
+ "integrity": "sha512-9la2Dv+ACylQ77I8s4spPu1JnLZXbH5WgxcLHLLUBWgFFSiv0wXqgzWztrBIZqwFgVX5BYcwldUqUVcEzdCyHg=="
},
"rescript-820": {
"version": "npm:bs-platform@8.2.0",
@@ -93,6 +273,15 @@
"version": "npm:rescript@9.1.2",
"resolved": "https://registry.npmjs.org/rescript/-/rescript-9.1.2.tgz",
"integrity": "sha512-4wHvTDv3nyYnAPJHcg1RGG8z7u3HDiBf6RN3P/dITDv859Qo35aKOzJWQtfBzbAs0EKNafLqei3TnUqiAv6BwQ=="
+ },
+ "scheduler": {
+ "version": "0.23.0",
+ "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.0.tgz",
+ "integrity": "sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==",
+ "peer": true,
+ "requires": {
+ "loose-envify": "^1.1.0"
+ }
}
}
}
diff --git a/compilers/package.json b/compilers/package.json
index 5dc863069..f03ee4390 100644
--- a/compilers/package.json
+++ b/compilers/package.json
@@ -5,10 +5,14 @@
"main": "index.js",
"license": "MIT",
"dependencies": {
+ "@rescript/core": "^1.3.0",
+ "@rescript/react": "^0.12.0",
+ "rescript-1000": "npm:rescript@10.0.0",
+ "rescript-1010": "npm:rescript@10.1.0",
+ "rescript-1100": "npm:rescript@11.0.0",
+ "rescript-1110": "npm:rescript@11.1.0",
"rescript-820": "npm:bs-platform@8.2.0",
"rescript-902": "npm:bs-platform@9.0.2",
- "rescript-912": "npm:rescript@9.1.2",
- "rescript-1000": "npm:rescript@10.0.0",
- "rescript-1010": "npm:rescript@10.1.0-rc.4"
+ "rescript-912": "npm:rescript@9.1.2"
}
}
diff --git a/compilers/rescript.json b/compilers/rescript.json
new file mode 100644
index 000000000..f135476c7
--- /dev/null
+++ b/compilers/rescript.json
@@ -0,0 +1,10 @@
+{
+ "name": "dummy",
+ "jsx": { "version": 4 },
+ "sources": {
+ "dir": "dummy",
+ "subdirs": true
+ },
+ "bs-dependencies": ["@rescript/core", "@rescript/react"],
+ "bsc-flags": ["-open RescriptCore"]
+}
diff --git a/data/api/v11.0.0/belt.json b/data/api/v11.0.0/belt.json
new file mode 100644
index 000000000..745744e96
--- /dev/null
+++ b/data/api/v11.0.0/belt.json
@@ -0,0 +1,9082 @@
+{
+ "belt": {
+ "id": "Belt",
+ "name": "Belt",
+ "docstrings": [
+ "The ReScript standard library.\n\nBelt is currently mostly covering collection types. It has no string or date functions yet, although Belt.String is in the works. In the meantime, use [Js.String](js/string) for string functions and [Js.Date](js/date) for date functions.\n\n## Motivation\n\nBelt provides:\n\n- The **highest quality** immutable data structures in JavaScript.\n- Safety by default: A Belt function will never throw exceptions, unless it is\n indicated explicitly in the function name (suffix \"Exn\").\n- Better performance and smaller code size running on the JS platform.\n- Ready for [Tree Shaking](https://webpack.js.org/guides/tree-shaking/).\n\n## Usage\n\nTo use modules from Belt, either refer to them by their fully qualified name (`Belt.List`, `Belt.Array` etc.) or open the `Belt` module by putting\n\n## Examples\n\n```rescript\nopen Belt\n```\n\nat the top of your source files. After opening Belt this way, `Array` will refer to `Belt.Array`, `List` will refer to `Belt.List` etc. in the subsequent code.\n\nIf you want to open Belt globally for all files in your project instead, you can put\n\n```json\n{\n \"bsc-flags\": [\"-open Belt\"]\n}\n```\n\ninto your `bsconfig.json`.\n\n**Note**: this is the **only** `open` we encourage.\n\nExample usage:\n\n## Examples\n\n```rescript\nlet someNumbers = [1, 1, 4, 2, 3, 6, 3, 4, 2]\n\nlet greaterThan2UniqueAndSorted =\n someNumbers\n ->Belt.Array.keep(x => x > 2)\n // convert to and from set to make values unique\n ->Belt.Set.Int.fromArray\n ->Belt.Set.Int.toArray // output is already sorted\n\nJs.log2(\"result\", greaterThan2UniqueAndSorted)\n```\n\n## Curried vs. Uncurried Callbacks\n\nFor functions taking a callback parameter, there are usually two versions\navailable:\n\n- curried (no suffix)\n- uncurried (suffixed with `U`)\n\nE.g.:\n\n## Examples\n\n```rescript\nlet forEach: (t<'a>, 'a => unit) => unit\n\nlet forEachU: (t<'a>, (. 'a) => unit) => unit\n```\n\nThe uncurried version will be faster in some cases, but for simplicity we recommend to stick with the curried version unless you need the extra performance.\n\nThe two versions can be invoked as follows:\n\n## Examples\n\n```rescript\n[\"a\", \"b\", \"c\"]->Belt.Array.forEach(x => Js.log(x))\n\n[\"a\", \"b\", \"c\"]->Belt.Array.forEachU((. x) => Js.log(x))\n```\n\n## Specialized Collections\n\nFor collections types like set or map, Belt provides both a generic module as well as specialized, more efficient implementations for string and int keys.\n\nFor example, Belt has the following set modules:\n\n- [Belt.Set](belt/set)\n- [Belt.Set.Int](belt/set/int)\n- [Belt.Set.String](belt/set/string)\n\n## Implementation Details\n\n### Array access runtime safety\n\nOne common confusion comes from the way Belt handles array access. It differs from than the default standard library's.\n\n## Examples\n\n```rescript\nlet letters = [\"a\", \"b\", \"c\"]\nlet a = letters[0] // a == \"a\"\nlet capitalA = Js.String.toUpperCase(a)\nlet k = letters[10] // Raises an exception! The 10th index doesn't exist.\n```\n\nBecause Belt avoids exceptions and returns `options` instead, this code behaves differently:\n\n## Examples\n\n```rescript\nopen Belt\nlet letters = [\"a\", \"b\", \"c\"]\nlet a = letters[0] // a == Some(\"a\")\nlet captialA = Js.String.toUpperCase(a) // Type error! This code will not compile.\nlet k = letters[10] // k == None\n```\n\nAlthough we've fixed the problem where `k` raises an exception, we now have a type error when trying to capitalize `a`. There are a few things going on here:\n\n- Reason transforms array index access to the function `Array.get`. So `letters[0]` is the same as `Array.get(letters, 0)`.\n- The compiler uses whichever `Array` module is in scope. If you `open Belt`, then it uses `Belt.Array`.\n- `Belt.Array.get` returns values wrapped in options, so `letters[0] == Some(\"a\")`.\n\nFortunately, this is easy to fix:\n\n## Examples\n\n```rescript\nopen Belt\nlet letters = [\"a\", \"b\", \"c\"]\nlet a = letters[0]\n\n// Use a switch statement:\nlet capitalA =\n switch a {\n | Some(a) => Some(Js.String.toUpperCase(a))\n | None => None\n }\n\nlet k = letters[10] // k == None\n```\n\nWith that little bit of tweaking, our code now compiles successfully and is 100% free of runtime errors!\n\n### A Special Encoding for Collection Safety\n\nWhen we create a collection library for a custom data type we need a way to provide a comparator function. Take Set for example, suppose its element type is a pair of ints, it needs a custom compare function that takes two tuples and returns their order. The Set could not just be typed as Set.t (int \\* int) , its customized compare function needs to manifest itself in the signature, otherwise, if the user creates another customized compare function, the two collection could mix which would result in runtime error.\n\nWe use a phantom type to solve the problem:\n\n## Examples\n\n```rescript\nmodule Comparable1 =\n Belt.Id.MakeComparable(\n {\n type t = (int, int)\n let cmp = ((a0, a1), (b0, b1)) =>\n switch Pervasives.compare(a0, b0) {\n | 0 => Pervasives.compare(a1, b1)\n | c => c\n }\n }\n )\n\nlet mySet1 = Belt.Set.make(~id=module(Comparable1))\n\nmodule Comparable2 =\n Belt.Id.MakeComparable(\n {\n type t = (int, int)\n let cmp = ((a0, a1), (b0, b1)) =>\n switch Pervasives.compare(a0, b0) {\n | 0 => Pervasives.compare(a1, b1)\n | c => c\n }\n }\n )\n\nlet mySet2 = Belt.Set.make(~id=module(Comparable2))\n```\n\nHere, the compiler would infer `mySet1` and `mySet2` having different type, so e.g. a `merge` operation that tries to merge these two sets will correctly fail.\n\n## Examples\n\n```rescript\nlet mySet1: t<(int, int), Comparable1.identity>\nlet mySet2: t<(int, int), Comparable2.identity>\n```\n\n`Comparable1.identity` and `Comparable2.identity` are not the same using our encoding scheme."
+ ],
+ "items": []
+ },
+ "belt/hashmap/string": {
+ "id": "Belt.HashMap.String",
+ "name": "String",
+ "docstrings": [
+ "Specalized when key type is `string`, more efficient than the generic type"
+ ],
+ "items": [
+ {
+ "id": "Belt.HashMap.String.key",
+ "kind": "type",
+ "name": "key",
+ "docstrings": [],
+ "signature": "type key = string"
+ },
+ {
+ "id": "Belt.HashMap.String.t",
+ "kind": "type",
+ "name": "t",
+ "docstrings": [],
+ "signature": "type t<'b>"
+ },
+ {
+ "id": "Belt.HashMap.String.make",
+ "kind": "value",
+ "name": "make",
+ "docstrings": [],
+ "signature": "let make: (~hintSize: int) => t<'b>"
+ },
+ {
+ "id": "Belt.HashMap.String.clear",
+ "kind": "value",
+ "name": "clear",
+ "docstrings": [],
+ "signature": "let clear: t<'b> => unit"
+ },
+ {
+ "id": "Belt.HashMap.String.isEmpty",
+ "kind": "value",
+ "name": "isEmpty",
+ "docstrings": [],
+ "signature": "let isEmpty: t<'a> => bool"
+ },
+ {
+ "id": "Belt.HashMap.String.set",
+ "kind": "value",
+ "name": "set",
+ "docstrings": [
+ "`setDone(tbl, k, v)` if `k` does not exist, add the binding `k,v`, otherwise,\nupdate the old value with the new `v`"
+ ],
+ "signature": "let set: (t<'a>, key, 'a) => unit"
+ },
+ {
+ "id": "Belt.HashMap.String.copy",
+ "kind": "value",
+ "name": "copy",
+ "docstrings": [],
+ "signature": "let copy: t<'a> => t<'a>"
+ },
+ {
+ "id": "Belt.HashMap.String.get",
+ "kind": "value",
+ "name": "get",
+ "docstrings": [],
+ "signature": "let get: (t<'a>, key) => option<'a>"
+ },
+ {
+ "id": "Belt.HashMap.String.has",
+ "kind": "value",
+ "name": "has",
+ "docstrings": [],
+ "signature": "let has: (t<'b>, key) => bool"
+ },
+ {
+ "id": "Belt.HashMap.String.remove",
+ "kind": "value",
+ "name": "remove",
+ "docstrings": [],
+ "signature": "let remove: (t<'a>, key) => unit"
+ },
+ {
+ "id": "Belt.HashMap.String.forEachU",
+ "kind": "value",
+ "name": "forEachU",
+ "docstrings": [],
+ "signature": "let forEachU: (t<'b>, (key, 'b) => unit) => unit"
+ },
+ {
+ "id": "Belt.HashMap.String.forEach",
+ "kind": "value",
+ "name": "forEach",
+ "docstrings": [],
+ "signature": "let forEach: (t<'b>, (key, 'b) => unit) => unit"
+ },
+ {
+ "id": "Belt.HashMap.String.reduceU",
+ "kind": "value",
+ "name": "reduceU",
+ "docstrings": [],
+ "signature": "let reduceU: (t<'b>, 'c, ('c, key, 'b) => 'c) => 'c"
+ },
+ {
+ "id": "Belt.HashMap.String.reduce",
+ "kind": "value",
+ "name": "reduce",
+ "docstrings": [],
+ "signature": "let reduce: (t<'b>, 'c, ('c, key, 'b) => 'c) => 'c"
+ },
+ {
+ "id": "Belt.HashMap.String.keepMapInPlaceU",
+ "kind": "value",
+ "name": "keepMapInPlaceU",
+ "docstrings": [],
+ "signature": "let keepMapInPlaceU: (t<'a>, (key, 'a) => option<'a>) => unit"
+ },
+ {
+ "id": "Belt.HashMap.String.keepMapInPlace",
+ "kind": "value",
+ "name": "keepMapInPlace",
+ "docstrings": [],
+ "signature": "let keepMapInPlace: (t<'a>, (key, 'a) => option<'a>) => unit"
+ },
+ {
+ "id": "Belt.HashMap.String.size",
+ "kind": "value",
+ "name": "size",
+ "docstrings": [],
+ "signature": "let size: t<'a> => int"
+ },
+ {
+ "id": "Belt.HashMap.String.toArray",
+ "kind": "value",
+ "name": "toArray",
+ "docstrings": [],
+ "signature": "let toArray: t<'a> => array<(key, 'a)>"
+ },
+ {
+ "id": "Belt.HashMap.String.keysToArray",
+ "kind": "value",
+ "name": "keysToArray",
+ "docstrings": [],
+ "signature": "let keysToArray: t<'a> => array"
+ },
+ {
+ "id": "Belt.HashMap.String.valuesToArray",
+ "kind": "value",
+ "name": "valuesToArray",
+ "docstrings": [],
+ "signature": "let valuesToArray: t<'a> => array<'a>"
+ },
+ {
+ "id": "Belt.HashMap.String.fromArray",
+ "kind": "value",
+ "name": "fromArray",
+ "docstrings": [],
+ "signature": "let fromArray: array<(key, 'a)> => t<'a>"
+ },
+ {
+ "id": "Belt.HashMap.String.mergeMany",
+ "kind": "value",
+ "name": "mergeMany",
+ "docstrings": [],
+ "signature": "let mergeMany: (t<'a>, array<(key, 'a)>) => unit"
+ },
+ {
+ "id": "Belt.HashMap.String.getBucketHistogram",
+ "kind": "value",
+ "name": "getBucketHistogram",
+ "docstrings": [],
+ "signature": "let getBucketHistogram: t<'a> => array"
+ },
+ {
+ "id": "Belt.HashMap.String.logStats",
+ "kind": "value",
+ "name": "logStats",
+ "docstrings": [],
+ "signature": "let logStats: t<'a> => unit"
+ }
+ ]
+ },
+ "belt/hashmap/int": {
+ "id": "Belt.HashMap.Int",
+ "name": "Int",
+ "docstrings": [
+ "Specalized when key type is `int`, more efficient than the generic type"
+ ],
+ "items": [
+ {
+ "id": "Belt.HashMap.Int.key",
+ "kind": "type",
+ "name": "key",
+ "docstrings": [],
+ "signature": "type key = int"
+ },
+ {
+ "id": "Belt.HashMap.Int.t",
+ "kind": "type",
+ "name": "t",
+ "docstrings": [],
+ "signature": "type t<'b>"
+ },
+ {
+ "id": "Belt.HashMap.Int.make",
+ "kind": "value",
+ "name": "make",
+ "docstrings": [],
+ "signature": "let make: (~hintSize: int) => t<'b>"
+ },
+ {
+ "id": "Belt.HashMap.Int.clear",
+ "kind": "value",
+ "name": "clear",
+ "docstrings": [],
+ "signature": "let clear: t<'b> => unit"
+ },
+ {
+ "id": "Belt.HashMap.Int.isEmpty",
+ "kind": "value",
+ "name": "isEmpty",
+ "docstrings": [],
+ "signature": "let isEmpty: t<'a> => bool"
+ },
+ {
+ "id": "Belt.HashMap.Int.set",
+ "kind": "value",
+ "name": "set",
+ "docstrings": [
+ "`setDone(tbl, k, v)` if `k` does not exist, add the binding `k,v`, otherwise,\nupdate the old value with the new `v`"
+ ],
+ "signature": "let set: (t<'a>, key, 'a) => unit"
+ },
+ {
+ "id": "Belt.HashMap.Int.copy",
+ "kind": "value",
+ "name": "copy",
+ "docstrings": [],
+ "signature": "let copy: t<'a> => t<'a>"
+ },
+ {
+ "id": "Belt.HashMap.Int.get",
+ "kind": "value",
+ "name": "get",
+ "docstrings": [],
+ "signature": "let get: (t<'a>, key) => option<'a>"
+ },
+ {
+ "id": "Belt.HashMap.Int.has",
+ "kind": "value",
+ "name": "has",
+ "docstrings": [],
+ "signature": "let has: (t<'b>, key) => bool"
+ },
+ {
+ "id": "Belt.HashMap.Int.remove",
+ "kind": "value",
+ "name": "remove",
+ "docstrings": [],
+ "signature": "let remove: (t<'a>, key) => unit"
+ },
+ {
+ "id": "Belt.HashMap.Int.forEachU",
+ "kind": "value",
+ "name": "forEachU",
+ "docstrings": [],
+ "signature": "let forEachU: (t<'b>, (key, 'b) => unit) => unit"
+ },
+ {
+ "id": "Belt.HashMap.Int.forEach",
+ "kind": "value",
+ "name": "forEach",
+ "docstrings": [],
+ "signature": "let forEach: (t<'b>, (key, 'b) => unit) => unit"
+ },
+ {
+ "id": "Belt.HashMap.Int.reduceU",
+ "kind": "value",
+ "name": "reduceU",
+ "docstrings": [],
+ "signature": "let reduceU: (t<'b>, 'c, ('c, key, 'b) => 'c) => 'c"
+ },
+ {
+ "id": "Belt.HashMap.Int.reduce",
+ "kind": "value",
+ "name": "reduce",
+ "docstrings": [],
+ "signature": "let reduce: (t<'b>, 'c, ('c, key, 'b) => 'c) => 'c"
+ },
+ {
+ "id": "Belt.HashMap.Int.keepMapInPlaceU",
+ "kind": "value",
+ "name": "keepMapInPlaceU",
+ "docstrings": [],
+ "signature": "let keepMapInPlaceU: (t<'a>, (key, 'a) => option<'a>) => unit"
+ },
+ {
+ "id": "Belt.HashMap.Int.keepMapInPlace",
+ "kind": "value",
+ "name": "keepMapInPlace",
+ "docstrings": [],
+ "signature": "let keepMapInPlace: (t<'a>, (key, 'a) => option<'a>) => unit"
+ },
+ {
+ "id": "Belt.HashMap.Int.size",
+ "kind": "value",
+ "name": "size",
+ "docstrings": [],
+ "signature": "let size: t<'a> => int"
+ },
+ {
+ "id": "Belt.HashMap.Int.toArray",
+ "kind": "value",
+ "name": "toArray",
+ "docstrings": [],
+ "signature": "let toArray: t<'a> => array<(key, 'a)>"
+ },
+ {
+ "id": "Belt.HashMap.Int.keysToArray",
+ "kind": "value",
+ "name": "keysToArray",
+ "docstrings": [],
+ "signature": "let keysToArray: t<'a> => array"
+ },
+ {
+ "id": "Belt.HashMap.Int.valuesToArray",
+ "kind": "value",
+ "name": "valuesToArray",
+ "docstrings": [],
+ "signature": "let valuesToArray: t<'a> => array<'a>"
+ },
+ {
+ "id": "Belt.HashMap.Int.fromArray",
+ "kind": "value",
+ "name": "fromArray",
+ "docstrings": [],
+ "signature": "let fromArray: array<(key, 'a)> => t<'a>"
+ },
+ {
+ "id": "Belt.HashMap.Int.mergeMany",
+ "kind": "value",
+ "name": "mergeMany",
+ "docstrings": [],
+ "signature": "let mergeMany: (t<'a>, array<(key, 'a)>) => unit"
+ },
+ {
+ "id": "Belt.HashMap.Int.getBucketHistogram",
+ "kind": "value",
+ "name": "getBucketHistogram",
+ "docstrings": [],
+ "signature": "let getBucketHistogram: t<'a> => array"
+ },
+ {
+ "id": "Belt.HashMap.Int.logStats",
+ "kind": "value",
+ "name": "logStats",
+ "docstrings": [],
+ "signature": "let logStats: t<'a> => unit"
+ }
+ ]
+ },
+ "belt/hashset/string": {
+ "id": "Belt.HashSet.String",
+ "name": "String",
+ "docstrings": [
+ "Specalized when key type is `string`, more efficient than the generic type",
+ "This module is [`Belt.HashSet`]() specialized with key type to be a primitive type.\n\nIt is more efficient in general, the API is the same with [`Belt.HashSet`]() except its key type is fixed,\nand identity is not needed(using the built-in one)\n\n**See** [`Belt.HashSet`]()"
+ ],
+ "items": [
+ {
+ "id": "Belt.HashSet.String.key",
+ "kind": "type",
+ "name": "key",
+ "docstrings": [],
+ "signature": "type key = string"
+ },
+ {
+ "id": "Belt.HashSet.String.t",
+ "kind": "type",
+ "name": "t",
+ "docstrings": [],
+ "signature": "type t"
+ },
+ {
+ "id": "Belt.HashSet.String.make",
+ "kind": "value",
+ "name": "make",
+ "docstrings": [],
+ "signature": "let make: (~hintSize: int) => t"
+ },
+ {
+ "id": "Belt.HashSet.String.clear",
+ "kind": "value",
+ "name": "clear",
+ "docstrings": [],
+ "signature": "let clear: t => unit"
+ },
+ {
+ "id": "Belt.HashSet.String.isEmpty",
+ "kind": "value",
+ "name": "isEmpty",
+ "docstrings": [],
+ "signature": "let isEmpty: t => bool"
+ },
+ {
+ "id": "Belt.HashSet.String.add",
+ "kind": "value",
+ "name": "add",
+ "docstrings": [],
+ "signature": "let add: (t, key) => unit"
+ },
+ {
+ "id": "Belt.HashSet.String.copy",
+ "kind": "value",
+ "name": "copy",
+ "docstrings": [],
+ "signature": "let copy: t => t"
+ },
+ {
+ "id": "Belt.HashSet.String.has",
+ "kind": "value",
+ "name": "has",
+ "docstrings": [],
+ "signature": "let has: (t, key) => bool"
+ },
+ {
+ "id": "Belt.HashSet.String.remove",
+ "kind": "value",
+ "name": "remove",
+ "docstrings": [],
+ "signature": "let remove: (t, key) => unit"
+ },
+ {
+ "id": "Belt.HashSet.String.forEachU",
+ "kind": "value",
+ "name": "forEachU",
+ "docstrings": [],
+ "signature": "let forEachU: (t, key => unit) => unit"
+ },
+ {
+ "id": "Belt.HashSet.String.forEach",
+ "kind": "value",
+ "name": "forEach",
+ "docstrings": [],
+ "signature": "let forEach: (t, key => unit) => unit"
+ },
+ {
+ "id": "Belt.HashSet.String.reduceU",
+ "kind": "value",
+ "name": "reduceU",
+ "docstrings": [],
+ "signature": "let reduceU: (t, 'c, ('c, key) => 'c) => 'c"
+ },
+ {
+ "id": "Belt.HashSet.String.reduce",
+ "kind": "value",
+ "name": "reduce",
+ "docstrings": [],
+ "signature": "let reduce: (t, 'c, ('c, key) => 'c) => 'c"
+ },
+ {
+ "id": "Belt.HashSet.String.size",
+ "kind": "value",
+ "name": "size",
+ "docstrings": [],
+ "signature": "let size: t => int"
+ },
+ {
+ "id": "Belt.HashSet.String.logStats",
+ "kind": "value",
+ "name": "logStats",
+ "docstrings": [],
+ "signature": "let logStats: t => unit"
+ },
+ {
+ "id": "Belt.HashSet.String.toArray",
+ "kind": "value",
+ "name": "toArray",
+ "docstrings": [],
+ "signature": "let toArray: t => array"
+ },
+ {
+ "id": "Belt.HashSet.String.fromArray",
+ "kind": "value",
+ "name": "fromArray",
+ "docstrings": [],
+ "signature": "let fromArray: array => t"
+ },
+ {
+ "id": "Belt.HashSet.String.mergeMany",
+ "kind": "value",
+ "name": "mergeMany",
+ "docstrings": [],
+ "signature": "let mergeMany: (t, array) => unit"
+ },
+ {
+ "id": "Belt.HashSet.String.getBucketHistogram",
+ "kind": "value",
+ "name": "getBucketHistogram",
+ "docstrings": [],
+ "signature": "let getBucketHistogram: t => array"
+ }
+ ]
+ },
+ "belt/hashset/int": {
+ "id": "Belt.HashSet.Int",
+ "name": "Int",
+ "docstrings": [
+ "Specalized when key type is `int`, more efficient than the generic type",
+ "This module is [`Belt.HashSet`]() specialized with key type to be a primitive type.\n\nIt is more efficient in general, the API is the same with [`Belt.HashSet`]() except its key type is fixed,\nand identity is not needed(using the built-in one)\n\n**See** [`Belt.HashSet`]()"
+ ],
+ "items": [
+ {
+ "id": "Belt.HashSet.Int.key",
+ "kind": "type",
+ "name": "key",
+ "docstrings": [],
+ "signature": "type key = int"
+ },
+ {
+ "id": "Belt.HashSet.Int.t",
+ "kind": "type",
+ "name": "t",
+ "docstrings": [],
+ "signature": "type t"
+ },
+ {
+ "id": "Belt.HashSet.Int.make",
+ "kind": "value",
+ "name": "make",
+ "docstrings": [],
+ "signature": "let make: (~hintSize: int) => t"
+ },
+ {
+ "id": "Belt.HashSet.Int.clear",
+ "kind": "value",
+ "name": "clear",
+ "docstrings": [],
+ "signature": "let clear: t => unit"
+ },
+ {
+ "id": "Belt.HashSet.Int.isEmpty",
+ "kind": "value",
+ "name": "isEmpty",
+ "docstrings": [],
+ "signature": "let isEmpty: t => bool"
+ },
+ {
+ "id": "Belt.HashSet.Int.add",
+ "kind": "value",
+ "name": "add",
+ "docstrings": [],
+ "signature": "let add: (t, key) => unit"
+ },
+ {
+ "id": "Belt.HashSet.Int.copy",
+ "kind": "value",
+ "name": "copy",
+ "docstrings": [],
+ "signature": "let copy: t => t"
+ },
+ {
+ "id": "Belt.HashSet.Int.has",
+ "kind": "value",
+ "name": "has",
+ "docstrings": [],
+ "signature": "let has: (t, key) => bool"
+ },
+ {
+ "id": "Belt.HashSet.Int.remove",
+ "kind": "value",
+ "name": "remove",
+ "docstrings": [],
+ "signature": "let remove: (t, key) => unit"
+ },
+ {
+ "id": "Belt.HashSet.Int.forEachU",
+ "kind": "value",
+ "name": "forEachU",
+ "docstrings": [],
+ "signature": "let forEachU: (t, key => unit) => unit"
+ },
+ {
+ "id": "Belt.HashSet.Int.forEach",
+ "kind": "value",
+ "name": "forEach",
+ "docstrings": [],
+ "signature": "let forEach: (t, key => unit) => unit"
+ },
+ {
+ "id": "Belt.HashSet.Int.reduceU",
+ "kind": "value",
+ "name": "reduceU",
+ "docstrings": [],
+ "signature": "let reduceU: (t, 'c, ('c, key) => 'c) => 'c"
+ },
+ {
+ "id": "Belt.HashSet.Int.reduce",
+ "kind": "value",
+ "name": "reduce",
+ "docstrings": [],
+ "signature": "let reduce: (t, 'c, ('c, key) => 'c) => 'c"
+ },
+ {
+ "id": "Belt.HashSet.Int.size",
+ "kind": "value",
+ "name": "size",
+ "docstrings": [],
+ "signature": "let size: t => int"
+ },
+ {
+ "id": "Belt.HashSet.Int.logStats",
+ "kind": "value",
+ "name": "logStats",
+ "docstrings": [],
+ "signature": "let logStats: t => unit"
+ },
+ {
+ "id": "Belt.HashSet.Int.toArray",
+ "kind": "value",
+ "name": "toArray",
+ "docstrings": [],
+ "signature": "let toArray: t => array"
+ },
+ {
+ "id": "Belt.HashSet.Int.fromArray",
+ "kind": "value",
+ "name": "fromArray",
+ "docstrings": [],
+ "signature": "let fromArray: array => t"
+ },
+ {
+ "id": "Belt.HashSet.Int.mergeMany",
+ "kind": "value",
+ "name": "mergeMany",
+ "docstrings": [],
+ "signature": "let mergeMany: (t, array) => unit"
+ },
+ {
+ "id": "Belt.HashSet.Int.getBucketHistogram",
+ "kind": "value",
+ "name": "getBucketHistogram",
+ "docstrings": [],
+ "signature": "let getBucketHistogram: t => array"
+ }
+ ]
+ },
+ "belt/mutablemap/string": {
+ "id": "Belt.MutableMap.String",
+ "name": "String",
+ "docstrings": [],
+ "items": [
+ {
+ "id": "Belt.MutableMap.String.key",
+ "kind": "type",
+ "name": "key",
+ "docstrings": [],
+ "signature": "type key = string"
+ },
+ {
+ "id": "Belt.MutableMap.String.t",
+ "kind": "type",
+ "name": "t",
+ "docstrings": [],
+ "signature": "type t<'a>"
+ },
+ {
+ "id": "Belt.MutableMap.String.make",
+ "kind": "value",
+ "name": "make",
+ "docstrings": [],
+ "signature": "let make: unit => t<'a>"
+ },
+ {
+ "id": "Belt.MutableMap.String.clear",
+ "kind": "value",
+ "name": "clear",
+ "docstrings": [],
+ "signature": "let clear: t<'a> => unit"
+ },
+ {
+ "id": "Belt.MutableMap.String.isEmpty",
+ "kind": "value",
+ "name": "isEmpty",
+ "docstrings": [],
+ "signature": "let isEmpty: t<'a> => bool"
+ },
+ {
+ "id": "Belt.MutableMap.String.has",
+ "kind": "value",
+ "name": "has",
+ "docstrings": [],
+ "signature": "let has: (t<'a>, key) => bool"
+ },
+ {
+ "id": "Belt.MutableMap.String.cmpU",
+ "kind": "value",
+ "name": "cmpU",
+ "docstrings": [],
+ "signature": "let cmpU: (t<'a>, t<'a>, ('a, 'a) => int) => int"
+ },
+ {
+ "id": "Belt.MutableMap.String.cmp",
+ "kind": "value",
+ "name": "cmp",
+ "docstrings": [
+ "`cmp(m1, m2, cmp)`. First compare by size, if size is the same, compare by key,\nvalue pair"
+ ],
+ "signature": "let cmp: (t<'a>, t<'a>, ('a, 'a) => int) => int"
+ },
+ {
+ "id": "Belt.MutableMap.String.eqU",
+ "kind": "value",
+ "name": "eqU",
+ "docstrings": [],
+ "signature": "let eqU: (t<'a>, t<'a>, ('a, 'a) => bool) => bool"
+ },
+ {
+ "id": "Belt.MutableMap.String.eq",
+ "kind": "value",
+ "name": "eq",
+ "docstrings": ["`eq(m1, m2, cmp)`"],
+ "signature": "let eq: (t<'a>, t<'a>, ('a, 'a) => bool) => bool"
+ },
+ {
+ "id": "Belt.MutableMap.String.forEachU",
+ "kind": "value",
+ "name": "forEachU",
+ "docstrings": [],
+ "signature": "let forEachU: (t<'a>, (key, 'a) => unit) => unit"
+ },
+ {
+ "id": "Belt.MutableMap.String.forEach",
+ "kind": "value",
+ "name": "forEach",
+ "docstrings": [
+ "`forEach(m, f)` applies `f` to all bindings in map `m`. `f` receives the key as\nfirst argument, and the associated value as second argument. The application \norder of `f` is in increasing order."
+ ],
+ "signature": "let forEach: (t<'a>, (key, 'a) => unit) => unit"
+ },
+ {
+ "id": "Belt.MutableMap.String.reduceU",
+ "kind": "value",
+ "name": "reduceU",
+ "docstrings": [],
+ "signature": "let reduceU: (t<'a>, 'b, ('b, key, 'a) => 'b) => 'b"
+ },
+ {
+ "id": "Belt.MutableMap.String.reduce",
+ "kind": "value",
+ "name": "reduce",
+ "docstrings": [
+ "`reduce(m, a, f)` computes `(f kN dN ... (f k1 d1 a)...)`, where `k1 ... kN` are\nthe keys of all bindings in `m` (in increasing order), and `d1 ... dN` are the\nassociated data."
+ ],
+ "signature": "let reduce: (t<'a>, 'b, ('b, key, 'a) => 'b) => 'b"
+ },
+ {
+ "id": "Belt.MutableMap.String.everyU",
+ "kind": "value",
+ "name": "everyU",
+ "docstrings": [],
+ "signature": "let everyU: (t<'a>, (key, 'a) => bool) => bool"
+ },
+ {
+ "id": "Belt.MutableMap.String.every",
+ "kind": "value",
+ "name": "every",
+ "docstrings": [
+ "`every(m, p)` checks if all the bindings of the map satisfy the predicate `p`.\nThe application order of `p` is unspecified."
+ ],
+ "signature": "let every: (t<'a>, (key, 'a) => bool) => bool"
+ },
+ {
+ "id": "Belt.MutableMap.String.someU",
+ "kind": "value",
+ "name": "someU",
+ "docstrings": [],
+ "signature": "let someU: (t<'a>, (key, 'a) => bool) => bool"
+ },
+ {
+ "id": "Belt.MutableMap.String.some",
+ "kind": "value",
+ "name": "some",
+ "docstrings": [
+ "`some(m, p)` checks if at least one binding of the map satisfy the predicate `p`.\nThe application order of `p` is unspecified."
+ ],
+ "signature": "let some: (t<'a>, (key, 'a) => bool) => bool"
+ },
+ {
+ "id": "Belt.MutableMap.String.size",
+ "kind": "value",
+ "name": "size",
+ "docstrings": [],
+ "signature": "let size: t<'a> => int"
+ },
+ {
+ "id": "Belt.MutableMap.String.toList",
+ "kind": "value",
+ "name": "toList",
+ "docstrings": ["In increasing order"],
+ "signature": "let toList: t<'a> => list<(key, 'a)>"
+ },
+ {
+ "id": "Belt.MutableMap.String.toArray",
+ "kind": "value",
+ "name": "toArray",
+ "docstrings": ["In increasing order"],
+ "signature": "let toArray: t<'a> => array<(key, 'a)>"
+ },
+ {
+ "id": "Belt.MutableMap.String.fromArray",
+ "kind": "value",
+ "name": "fromArray",
+ "docstrings": [],
+ "signature": "let fromArray: array<(key, 'a)> => t<'a>"
+ },
+ {
+ "id": "Belt.MutableMap.String.keysToArray",
+ "kind": "value",
+ "name": "keysToArray",
+ "docstrings": [],
+ "signature": "let keysToArray: t<'a> => array"
+ },
+ {
+ "id": "Belt.MutableMap.String.valuesToArray",
+ "kind": "value",
+ "name": "valuesToArray",
+ "docstrings": [],
+ "signature": "let valuesToArray: t<'a> => array<'a>"
+ },
+ {
+ "id": "Belt.MutableMap.String.minKey",
+ "kind": "value",
+ "name": "minKey",
+ "docstrings": [],
+ "signature": "let minKey: t<'a> => option"
+ },
+ {
+ "id": "Belt.MutableMap.String.minKeyUndefined",
+ "kind": "value",
+ "name": "minKeyUndefined",
+ "docstrings": [],
+ "signature": "let minKeyUndefined: t<'a> => Js.undefined"
+ },
+ {
+ "id": "Belt.MutableMap.String.maxKey",
+ "kind": "value",
+ "name": "maxKey",
+ "docstrings": [],
+ "signature": "let maxKey: t<'a> => option"
+ },
+ {
+ "id": "Belt.MutableMap.String.maxKeyUndefined",
+ "kind": "value",
+ "name": "maxKeyUndefined",
+ "docstrings": [],
+ "signature": "let maxKeyUndefined: t<'a> => Js.undefined"
+ },
+ {
+ "id": "Belt.MutableMap.String.minimum",
+ "kind": "value",
+ "name": "minimum",
+ "docstrings": [],
+ "signature": "let minimum: t<'a> => option<(key, 'a)>"
+ },
+ {
+ "id": "Belt.MutableMap.String.minUndefined",
+ "kind": "value",
+ "name": "minUndefined",
+ "docstrings": [],
+ "signature": "let minUndefined: t<'a> => Js.undefined<(key, 'a)>"
+ },
+ {
+ "id": "Belt.MutableMap.String.maximum",
+ "kind": "value",
+ "name": "maximum",
+ "docstrings": [],
+ "signature": "let maximum: t<'a> => option<(key, 'a)>"
+ },
+ {
+ "id": "Belt.MutableMap.String.maxUndefined",
+ "kind": "value",
+ "name": "maxUndefined",
+ "docstrings": [],
+ "signature": "let maxUndefined: t<'a> => Js.undefined<(key, 'a)>"
+ },
+ {
+ "id": "Belt.MutableMap.String.get",
+ "kind": "value",
+ "name": "get",
+ "docstrings": [],
+ "signature": "let get: (t<'a>, key) => option<'a>"
+ },
+ {
+ "id": "Belt.MutableMap.String.getUndefined",
+ "kind": "value",
+ "name": "getUndefined",
+ "docstrings": [],
+ "signature": "let getUndefined: (t<'a>, key) => Js.undefined<'a>"
+ },
+ {
+ "id": "Belt.MutableMap.String.getWithDefault",
+ "kind": "value",
+ "name": "getWithDefault",
+ "docstrings": [],
+ "signature": "let getWithDefault: (t<'a>, key, 'a) => 'a"
+ },
+ {
+ "id": "Belt.MutableMap.String.getExn",
+ "kind": "value",
+ "name": "getExn",
+ "docstrings": [],
+ "signature": "let getExn: (t<'a>, key) => 'a"
+ },
+ {
+ "id": "Belt.MutableMap.String.checkInvariantInternal",
+ "kind": "value",
+ "name": "checkInvariantInternal",
+ "docstrings": ["**raise** when invariant is not held"],
+ "signature": "let checkInvariantInternal: t<'a> => unit"
+ },
+ {
+ "id": "Belt.MutableMap.String.remove",
+ "kind": "value",
+ "name": "remove",
+ "docstrings": ["`remove(m, x)` do the in-place modification"],
+ "signature": "let remove: (t<'a>, key) => unit"
+ },
+ {
+ "id": "Belt.MutableMap.String.removeMany",
+ "kind": "value",
+ "name": "removeMany",
+ "docstrings": [],
+ "signature": "let removeMany: (t<'a>, array) => unit"
+ },
+ {
+ "id": "Belt.MutableMap.String.set",
+ "kind": "value",
+ "name": "set",
+ "docstrings": [
+ "`set(m, x, y)` do the in-place modification, return `m` for chaining. If `x` was\nalready bound in `m`, its previous binding disappears."
+ ],
+ "signature": "let set: (t<'a>, key, 'a) => unit"
+ },
+ {
+ "id": "Belt.MutableMap.String.updateU",
+ "kind": "value",
+ "name": "updateU",
+ "docstrings": [],
+ "signature": "let updateU: (t<'a>, key, option<'a> => option<'a>) => unit"
+ },
+ {
+ "id": "Belt.MutableMap.String.update",
+ "kind": "value",
+ "name": "update",
+ "docstrings": [],
+ "signature": "let update: (t<'a>, key, option<'a> => option<'a>) => unit"
+ },
+ {
+ "id": "Belt.MutableMap.String.mapU",
+ "kind": "value",
+ "name": "mapU",
+ "docstrings": [],
+ "signature": "let mapU: (t<'a>, 'a => 'b) => t<'b>"
+ },
+ {
+ "id": "Belt.MutableMap.String.map",
+ "kind": "value",
+ "name": "map",
+ "docstrings": [
+ "`map(m, f)` returns a map with same domain as `m`, where the associated value `a`\nof all bindings of `m` has been replaced by the result of the application of `f`\nto `a`. The bindings are passed to `f` in increasing order with respect to the\nordering over the type of the keys."
+ ],
+ "signature": "let map: (t<'a>, 'a => 'b) => t<'b>"
+ },
+ {
+ "id": "Belt.MutableMap.String.mapWithKeyU",
+ "kind": "value",
+ "name": "mapWithKeyU",
+ "docstrings": [],
+ "signature": "let mapWithKeyU: (t<'a>, (key, 'a) => 'b) => t<'b>"
+ },
+ {
+ "id": "Belt.MutableMap.String.mapWithKey",
+ "kind": "value",
+ "name": "mapWithKey",
+ "docstrings": [],
+ "signature": "let mapWithKey: (t<'a>, (key, 'a) => 'b) => t<'b>"
+ }
+ ]
+ },
+ "belt/mutablemap/int": {
+ "id": "Belt.MutableMap.Int",
+ "name": "Int",
+ "docstrings": [],
+ "items": [
+ {
+ "id": "Belt.MutableMap.Int.key",
+ "kind": "type",
+ "name": "key",
+ "docstrings": [],
+ "signature": "type key = int"
+ },
+ {
+ "id": "Belt.MutableMap.Int.t",
+ "kind": "type",
+ "name": "t",
+ "docstrings": [],
+ "signature": "type t<'a>"
+ },
+ {
+ "id": "Belt.MutableMap.Int.make",
+ "kind": "value",
+ "name": "make",
+ "docstrings": [],
+ "signature": "let make: unit => t<'a>"
+ },
+ {
+ "id": "Belt.MutableMap.Int.clear",
+ "kind": "value",
+ "name": "clear",
+ "docstrings": [],
+ "signature": "let clear: t<'a> => unit"
+ },
+ {
+ "id": "Belt.MutableMap.Int.isEmpty",
+ "kind": "value",
+ "name": "isEmpty",
+ "docstrings": [],
+ "signature": "let isEmpty: t<'a> => bool"
+ },
+ {
+ "id": "Belt.MutableMap.Int.has",
+ "kind": "value",
+ "name": "has",
+ "docstrings": [],
+ "signature": "let has: (t<'a>, key) => bool"
+ },
+ {
+ "id": "Belt.MutableMap.Int.cmpU",
+ "kind": "value",
+ "name": "cmpU",
+ "docstrings": [],
+ "signature": "let cmpU: (t<'a>, t<'a>, ('a, 'a) => int) => int"
+ },
+ {
+ "id": "Belt.MutableMap.Int.cmp",
+ "kind": "value",
+ "name": "cmp",
+ "docstrings": [
+ "`cmp(m1, m2, cmp)`. First compare by size, if size is the same, compare by key,\nvalue pair"
+ ],
+ "signature": "let cmp: (t<'a>, t<'a>, ('a, 'a) => int) => int"
+ },
+ {
+ "id": "Belt.MutableMap.Int.eqU",
+ "kind": "value",
+ "name": "eqU",
+ "docstrings": [],
+ "signature": "let eqU: (t<'a>, t<'a>, ('a, 'a) => bool) => bool"
+ },
+ {
+ "id": "Belt.MutableMap.Int.eq",
+ "kind": "value",
+ "name": "eq",
+ "docstrings": ["`eq(m1, m2, cmp)`"],
+ "signature": "let eq: (t<'a>, t<'a>, ('a, 'a) => bool) => bool"
+ },
+ {
+ "id": "Belt.MutableMap.Int.forEachU",
+ "kind": "value",
+ "name": "forEachU",
+ "docstrings": [],
+ "signature": "let forEachU: (t<'a>, (key, 'a) => unit) => unit"
+ },
+ {
+ "id": "Belt.MutableMap.Int.forEach",
+ "kind": "value",
+ "name": "forEach",
+ "docstrings": [
+ "`forEach(m, f)` applies `f` to all bindings in map `m`. `f` receives the key as\nfirst argument, and the associated value as second argument. The application \norder of `f` is in increasing order."
+ ],
+ "signature": "let forEach: (t<'a>, (key, 'a) => unit) => unit"
+ },
+ {
+ "id": "Belt.MutableMap.Int.reduceU",
+ "kind": "value",
+ "name": "reduceU",
+ "docstrings": [],
+ "signature": "let reduceU: (t<'a>, 'b, ('b, key, 'a) => 'b) => 'b"
+ },
+ {
+ "id": "Belt.MutableMap.Int.reduce",
+ "kind": "value",
+ "name": "reduce",
+ "docstrings": [
+ "`reduce(m, a, f)` computes `(f kN dN ... (f k1 d1 a)...)`, where `k1 ... kN` are\nthe keys of all bindings in `m` (in increasing order), and `d1 ... dN` are the\nassociated data."
+ ],
+ "signature": "let reduce: (t<'a>, 'b, ('b, key, 'a) => 'b) => 'b"
+ },
+ {
+ "id": "Belt.MutableMap.Int.everyU",
+ "kind": "value",
+ "name": "everyU",
+ "docstrings": [],
+ "signature": "let everyU: (t<'a>, (key, 'a) => bool) => bool"
+ },
+ {
+ "id": "Belt.MutableMap.Int.every",
+ "kind": "value",
+ "name": "every",
+ "docstrings": [
+ "`every(m, p)` checks if all the bindings of the map satisfy the predicate `p`.\nThe application order of `p` is unspecified."
+ ],
+ "signature": "let every: (t<'a>, (key, 'a) => bool) => bool"
+ },
+ {
+ "id": "Belt.MutableMap.Int.someU",
+ "kind": "value",
+ "name": "someU",
+ "docstrings": [],
+ "signature": "let someU: (t<'a>, (key, 'a) => bool) => bool"
+ },
+ {
+ "id": "Belt.MutableMap.Int.some",
+ "kind": "value",
+ "name": "some",
+ "docstrings": [
+ "`some(m, p)` checks if at least one binding of the map satisfy the predicate `p`.\nThe application order of `p` is unspecified."
+ ],
+ "signature": "let some: (t<'a>, (key, 'a) => bool) => bool"
+ },
+ {
+ "id": "Belt.MutableMap.Int.size",
+ "kind": "value",
+ "name": "size",
+ "docstrings": [],
+ "signature": "let size: t<'a> => int"
+ },
+ {
+ "id": "Belt.MutableMap.Int.toList",
+ "kind": "value",
+ "name": "toList",
+ "docstrings": ["In increasing order"],
+ "signature": "let toList: t<'a> => list<(key, 'a)>"
+ },
+ {
+ "id": "Belt.MutableMap.Int.toArray",
+ "kind": "value",
+ "name": "toArray",
+ "docstrings": ["In increasing order"],
+ "signature": "let toArray: t<'a> => array<(key, 'a)>"
+ },
+ {
+ "id": "Belt.MutableMap.Int.fromArray",
+ "kind": "value",
+ "name": "fromArray",
+ "docstrings": [],
+ "signature": "let fromArray: array<(key, 'a)> => t<'a>"
+ },
+ {
+ "id": "Belt.MutableMap.Int.keysToArray",
+ "kind": "value",
+ "name": "keysToArray",
+ "docstrings": [],
+ "signature": "let keysToArray: t<'a> => array"
+ },
+ {
+ "id": "Belt.MutableMap.Int.valuesToArray",
+ "kind": "value",
+ "name": "valuesToArray",
+ "docstrings": [],
+ "signature": "let valuesToArray: t<'a> => array<'a>"
+ },
+ {
+ "id": "Belt.MutableMap.Int.minKey",
+ "kind": "value",
+ "name": "minKey",
+ "docstrings": [],
+ "signature": "let minKey: t<'a> => option"
+ },
+ {
+ "id": "Belt.MutableMap.Int.minKeyUndefined",
+ "kind": "value",
+ "name": "minKeyUndefined",
+ "docstrings": [],
+ "signature": "let minKeyUndefined: t<'a> => Js.undefined"
+ },
+ {
+ "id": "Belt.MutableMap.Int.maxKey",
+ "kind": "value",
+ "name": "maxKey",
+ "docstrings": [],
+ "signature": "let maxKey: t<'a> => option"
+ },
+ {
+ "id": "Belt.MutableMap.Int.maxKeyUndefined",
+ "kind": "value",
+ "name": "maxKeyUndefined",
+ "docstrings": [],
+ "signature": "let maxKeyUndefined: t<'a> => Js.undefined"
+ },
+ {
+ "id": "Belt.MutableMap.Int.minimum",
+ "kind": "value",
+ "name": "minimum",
+ "docstrings": [],
+ "signature": "let minimum: t<'a> => option<(key, 'a)>"
+ },
+ {
+ "id": "Belt.MutableMap.Int.minUndefined",
+ "kind": "value",
+ "name": "minUndefined",
+ "docstrings": [],
+ "signature": "let minUndefined: t<'a> => Js.undefined<(key, 'a)>"
+ },
+ {
+ "id": "Belt.MutableMap.Int.maximum",
+ "kind": "value",
+ "name": "maximum",
+ "docstrings": [],
+ "signature": "let maximum: t<'a> => option<(key, 'a)>"
+ },
+ {
+ "id": "Belt.MutableMap.Int.maxUndefined",
+ "kind": "value",
+ "name": "maxUndefined",
+ "docstrings": [],
+ "signature": "let maxUndefined: t<'a> => Js.undefined<(key, 'a)>"
+ },
+ {
+ "id": "Belt.MutableMap.Int.get",
+ "kind": "value",
+ "name": "get",
+ "docstrings": [],
+ "signature": "let get: (t<'a>, key) => option<'a>"
+ },
+ {
+ "id": "Belt.MutableMap.Int.getUndefined",
+ "kind": "value",
+ "name": "getUndefined",
+ "docstrings": [],
+ "signature": "let getUndefined: (t<'a>, key) => Js.undefined<'a>"
+ },
+ {
+ "id": "Belt.MutableMap.Int.getWithDefault",
+ "kind": "value",
+ "name": "getWithDefault",
+ "docstrings": [],
+ "signature": "let getWithDefault: (t<'a>, key, 'a) => 'a"
+ },
+ {
+ "id": "Belt.MutableMap.Int.getExn",
+ "kind": "value",
+ "name": "getExn",
+ "docstrings": [],
+ "signature": "let getExn: (t<'a>, key) => 'a"
+ },
+ {
+ "id": "Belt.MutableMap.Int.checkInvariantInternal",
+ "kind": "value",
+ "name": "checkInvariantInternal",
+ "docstrings": ["**raise** when invariant is not held"],
+ "signature": "let checkInvariantInternal: t<'a> => unit"
+ },
+ {
+ "id": "Belt.MutableMap.Int.remove",
+ "kind": "value",
+ "name": "remove",
+ "docstrings": ["`remove(m, x)` do the in-place modification"],
+ "signature": "let remove: (t<'a>, key) => unit"
+ },
+ {
+ "id": "Belt.MutableMap.Int.removeMany",
+ "kind": "value",
+ "name": "removeMany",
+ "docstrings": [],
+ "signature": "let removeMany: (t<'a>, array) => unit"
+ },
+ {
+ "id": "Belt.MutableMap.Int.set",
+ "kind": "value",
+ "name": "set",
+ "docstrings": [
+ "`set(m, x, y)` do the in-place modification, return `m` for chaining. If `x` was\nalready bound in `m`, its previous binding disappears."
+ ],
+ "signature": "let set: (t<'a>, key, 'a) => unit"
+ },
+ {
+ "id": "Belt.MutableMap.Int.updateU",
+ "kind": "value",
+ "name": "updateU",
+ "docstrings": [],
+ "signature": "let updateU: (t<'a>, key, option<'a> => option<'a>) => unit"
+ },
+ {
+ "id": "Belt.MutableMap.Int.update",
+ "kind": "value",
+ "name": "update",
+ "docstrings": [],
+ "signature": "let update: (t<'a>, key, option<'a> => option<'a>) => unit"
+ },
+ {
+ "id": "Belt.MutableMap.Int.mapU",
+ "kind": "value",
+ "name": "mapU",
+ "docstrings": [],
+ "signature": "let mapU: (t<'a>, 'a => 'b) => t<'b>"
+ },
+ {
+ "id": "Belt.MutableMap.Int.map",
+ "kind": "value",
+ "name": "map",
+ "docstrings": [
+ "`map(m, f)` returns a map with same domain as `m`, where the associated value `a`\nof all bindings of `m` has been replaced by the result of the application of `f`\nto `a`. The bindings are passed to `f` in increasing order with respect to the\nordering over the type of the keys."
+ ],
+ "signature": "let map: (t<'a>, 'a => 'b) => t<'b>"
+ },
+ {
+ "id": "Belt.MutableMap.Int.mapWithKeyU",
+ "kind": "value",
+ "name": "mapWithKeyU",
+ "docstrings": [],
+ "signature": "let mapWithKeyU: (t<'a>, (key, 'a) => 'b) => t<'b>"
+ },
+ {
+ "id": "Belt.MutableMap.Int.mapWithKey",
+ "kind": "value",
+ "name": "mapWithKey",
+ "docstrings": [],
+ "signature": "let mapWithKey: (t<'a>, (key, 'a) => 'b) => t<'b>"
+ }
+ ]
+ },
+ "belt/mutableset/string": {
+ "id": "Belt.MutableSet.String",
+ "name": "String",
+ "docstrings": [
+ "Specialized when key type is `string`, more efficient than the generic type",
+ "This module is [`Belt.MutableSet`]() specialized with key type to be a primitive type.\n\nIt is more efficient in general, the API is the same with [`Belt.MutableSet`]() except its key type is fixed,\nand identity is not needed(using the built-in one)\n\n**See** [`Belt.MutableSet`]()"
+ ],
+ "items": [
+ {
+ "id": "Belt.MutableSet.String.value",
+ "kind": "type",
+ "name": "value",
+ "docstrings": ["The type of the set elements."],
+ "signature": "type value = string"
+ },
+ {
+ "id": "Belt.MutableSet.String.t",
+ "kind": "type",
+ "name": "t",
+ "docstrings": ["The type of sets."],
+ "signature": "type t"
+ },
+ {
+ "id": "Belt.MutableSet.String.make",
+ "kind": "value",
+ "name": "make",
+ "docstrings": [],
+ "signature": "let make: unit => t"
+ },
+ {
+ "id": "Belt.MutableSet.String.fromArray",
+ "kind": "value",
+ "name": "fromArray",
+ "docstrings": [],
+ "signature": "let fromArray: array => t"
+ },
+ {
+ "id": "Belt.MutableSet.String.fromSortedArrayUnsafe",
+ "kind": "value",
+ "name": "fromSortedArrayUnsafe",
+ "docstrings": [],
+ "signature": "let fromSortedArrayUnsafe: array => t"
+ },
+ {
+ "id": "Belt.MutableSet.String.copy",
+ "kind": "value",
+ "name": "copy",
+ "docstrings": [],
+ "signature": "let copy: t => t"
+ },
+ {
+ "id": "Belt.MutableSet.String.isEmpty",
+ "kind": "value",
+ "name": "isEmpty",
+ "docstrings": [],
+ "signature": "let isEmpty: t => bool"
+ },
+ {
+ "id": "Belt.MutableSet.String.has",
+ "kind": "value",
+ "name": "has",
+ "docstrings": [],
+ "signature": "let has: (t, value) => bool"
+ },
+ {
+ "id": "Belt.MutableSet.String.add",
+ "kind": "value",
+ "name": "add",
+ "docstrings": [],
+ "signature": "let add: (t, value) => unit"
+ },
+ {
+ "id": "Belt.MutableSet.String.addCheck",
+ "kind": "value",
+ "name": "addCheck",
+ "docstrings": [],
+ "signature": "let addCheck: (t, value) => bool"
+ },
+ {
+ "id": "Belt.MutableSet.String.mergeMany",
+ "kind": "value",
+ "name": "mergeMany",
+ "docstrings": [],
+ "signature": "let mergeMany: (t, array) => unit"
+ },
+ {
+ "id": "Belt.MutableSet.String.remove",
+ "kind": "value",
+ "name": "remove",
+ "docstrings": [],
+ "signature": "let remove: (t, value) => unit"
+ },
+ {
+ "id": "Belt.MutableSet.String.removeCheck",
+ "kind": "value",
+ "name": "removeCheck",
+ "docstrings": [],
+ "signature": "let removeCheck: (t, value) => bool"
+ },
+ {
+ "id": "Belt.MutableSet.String.removeMany",
+ "kind": "value",
+ "name": "removeMany",
+ "docstrings": [],
+ "signature": "let removeMany: (t, array) => unit"
+ },
+ {
+ "id": "Belt.MutableSet.String.union",
+ "kind": "value",
+ "name": "union",
+ "docstrings": [],
+ "signature": "let union: (t, t) => t"
+ },
+ {
+ "id": "Belt.MutableSet.String.intersect",
+ "kind": "value",
+ "name": "intersect",
+ "docstrings": [],
+ "signature": "let intersect: (t, t) => t"
+ },
+ {
+ "id": "Belt.MutableSet.String.diff",
+ "kind": "value",
+ "name": "diff",
+ "docstrings": [],
+ "signature": "let diff: (t, t) => t"
+ },
+ {
+ "id": "Belt.MutableSet.String.subset",
+ "kind": "value",
+ "name": "subset",
+ "docstrings": [],
+ "signature": "let subset: (t, t) => bool"
+ },
+ {
+ "id": "Belt.MutableSet.String.cmp",
+ "kind": "value",
+ "name": "cmp",
+ "docstrings": [],
+ "signature": "let cmp: (t, t) => int"
+ },
+ {
+ "id": "Belt.MutableSet.String.eq",
+ "kind": "value",
+ "name": "eq",
+ "docstrings": [],
+ "signature": "let eq: (t, t) => bool"
+ },
+ {
+ "id": "Belt.MutableSet.String.forEachU",
+ "kind": "value",
+ "name": "forEachU",
+ "docstrings": [],
+ "signature": "let forEachU: (t, value => unit) => unit"
+ },
+ {
+ "id": "Belt.MutableSet.String.forEach",
+ "kind": "value",
+ "name": "forEach",
+ "docstrings": ["In increasing order"],
+ "signature": "let forEach: (t, value => unit) => unit"
+ },
+ {
+ "id": "Belt.MutableSet.String.reduceU",
+ "kind": "value",
+ "name": "reduceU",
+ "docstrings": [],
+ "signature": "let reduceU: (t, 'a, ('a, value) => 'a) => 'a"
+ },
+ {
+ "id": "Belt.MutableSet.String.reduce",
+ "kind": "value",
+ "name": "reduce",
+ "docstrings": ["Iterate in increasing order."],
+ "signature": "let reduce: (t, 'a, ('a, value) => 'a) => 'a"
+ },
+ {
+ "id": "Belt.MutableSet.String.everyU",
+ "kind": "value",
+ "name": "everyU",
+ "docstrings": [],
+ "signature": "let everyU: (t, value => bool) => bool"
+ },
+ {
+ "id": "Belt.MutableSet.String.every",
+ "kind": "value",
+ "name": "every",
+ "docstrings": [
+ "`every(p, s)` checks if all elements of the set satisfy the predicate `p`.\nOrder unspecified."
+ ],
+ "signature": "let every: (t, value => bool) => bool"
+ },
+ {
+ "id": "Belt.MutableSet.String.someU",
+ "kind": "value",
+ "name": "someU",
+ "docstrings": [],
+ "signature": "let someU: (t, value => bool) => bool"
+ },
+ {
+ "id": "Belt.MutableSet.String.some",
+ "kind": "value",
+ "name": "some",
+ "docstrings": [
+ "`some(p, s)` checks if at least one element of the set satisfies the predicate\n`p`. Oder unspecified."
+ ],
+ "signature": "let some: (t, value => bool) => bool"
+ },
+ {
+ "id": "Belt.MutableSet.String.keepU",
+ "kind": "value",
+ "name": "keepU",
+ "docstrings": [],
+ "signature": "let keepU: (t, value => bool) => t"
+ },
+ {
+ "id": "Belt.MutableSet.String.keep",
+ "kind": "value",
+ "name": "keep",
+ "docstrings": [
+ "`keep(s, p)` returns a fresh copy of the set of all elements in `s` that satisfy\npredicate `p`."
+ ],
+ "signature": "let keep: (t, value => bool) => t"
+ },
+ {
+ "id": "Belt.MutableSet.String.partitionU",
+ "kind": "value",
+ "name": "partitionU",
+ "docstrings": [],
+ "signature": "let partitionU: (t, value => bool) => (t, t)"
+ },
+ {
+ "id": "Belt.MutableSet.String.partition",
+ "kind": "value",
+ "name": "partition",
+ "docstrings": [
+ "`partition(s, p)` returns a fresh copy pair of sets `(s1, s2)`, where `s1` is\nthe set of all the elements of `s` that satisfy the predicate `p`, and `s2` is\nthe set of all the elements of `s` that do not satisfy `p`."
+ ],
+ "signature": "let partition: (t, value => bool) => (t, t)"
+ },
+ {
+ "id": "Belt.MutableSet.String.size",
+ "kind": "value",
+ "name": "size",
+ "docstrings": [],
+ "signature": "let size: t => int"
+ },
+ {
+ "id": "Belt.MutableSet.String.toList",
+ "kind": "value",
+ "name": "toList",
+ "docstrings": ["In increasing order with respect"],
+ "signature": "let toList: t => list"
+ },
+ {
+ "id": "Belt.MutableSet.String.toArray",
+ "kind": "value",
+ "name": "toArray",
+ "docstrings": ["In increasing order with respect"],
+ "signature": "let toArray: t => array"
+ },
+ {
+ "id": "Belt.MutableSet.String.minimum",
+ "kind": "value",
+ "name": "minimum",
+ "docstrings": [],
+ "signature": "let minimum: t => option"
+ },
+ {
+ "id": "Belt.MutableSet.String.minUndefined",
+ "kind": "value",
+ "name": "minUndefined",
+ "docstrings": [],
+ "signature": "let minUndefined: t => Js.undefined"
+ },
+ {
+ "id": "Belt.MutableSet.String.maximum",
+ "kind": "value",
+ "name": "maximum",
+ "docstrings": [],
+ "signature": "let maximum: t => option"
+ },
+ {
+ "id": "Belt.MutableSet.String.maxUndefined",
+ "kind": "value",
+ "name": "maxUndefined",
+ "docstrings": [],
+ "signature": "let maxUndefined: t => Js.undefined"
+ },
+ {
+ "id": "Belt.MutableSet.String.get",
+ "kind": "value",
+ "name": "get",
+ "docstrings": [],
+ "signature": "let get: (t, value) => option"
+ },
+ {
+ "id": "Belt.MutableSet.String.getUndefined",
+ "kind": "value",
+ "name": "getUndefined",
+ "docstrings": [],
+ "signature": "let getUndefined: (t, value) => Js.undefined"
+ },
+ {
+ "id": "Belt.MutableSet.String.getExn",
+ "kind": "value",
+ "name": "getExn",
+ "docstrings": [],
+ "signature": "let getExn: (t, value) => value"
+ },
+ {
+ "id": "Belt.MutableSet.String.split",
+ "kind": "value",
+ "name": "split",
+ "docstrings": ["`split(s, key)` return a fresh copy of each"],
+ "signature": "let split: (t, value) => ((t, t), bool)"
+ },
+ {
+ "id": "Belt.MutableSet.String.checkInvariantInternal",
+ "kind": "value",
+ "name": "checkInvariantInternal",
+ "docstrings": ["**raise** when invariant is not held"],
+ "signature": "let checkInvariantInternal: t => unit"
+ }
+ ]
+ },
+ "belt/mutableset/int": {
+ "id": "Belt.MutableSet.Int",
+ "name": "Int",
+ "docstrings": [
+ "Specialized when key type is `int`, more efficient than the generic type",
+ "This module is [`Belt.MutableSet`]() specialized with key type to be a primitive type.\n\nIt is more efficient in general, the API is the same with [`Belt.MutableSet`]() except its key type is fixed,\nand identity is not needed(using the built-in one)\n\n**See** [`Belt.MutableSet`]()"
+ ],
+ "items": [
+ {
+ "id": "Belt.MutableSet.Int.value",
+ "kind": "type",
+ "name": "value",
+ "docstrings": ["The type of the set elements."],
+ "signature": "type value = int"
+ },
+ {
+ "id": "Belt.MutableSet.Int.t",
+ "kind": "type",
+ "name": "t",
+ "docstrings": ["The type of sets."],
+ "signature": "type t"
+ },
+ {
+ "id": "Belt.MutableSet.Int.make",
+ "kind": "value",
+ "name": "make",
+ "docstrings": [],
+ "signature": "let make: unit => t"
+ },
+ {
+ "id": "Belt.MutableSet.Int.fromArray",
+ "kind": "value",
+ "name": "fromArray",
+ "docstrings": [],
+ "signature": "let fromArray: array => t"
+ },
+ {
+ "id": "Belt.MutableSet.Int.fromSortedArrayUnsafe",
+ "kind": "value",
+ "name": "fromSortedArrayUnsafe",
+ "docstrings": [],
+ "signature": "let fromSortedArrayUnsafe: array => t"
+ },
+ {
+ "id": "Belt.MutableSet.Int.copy",
+ "kind": "value",
+ "name": "copy",
+ "docstrings": [],
+ "signature": "let copy: t => t"
+ },
+ {
+ "id": "Belt.MutableSet.Int.isEmpty",
+ "kind": "value",
+ "name": "isEmpty",
+ "docstrings": [],
+ "signature": "let isEmpty: t => bool"
+ },
+ {
+ "id": "Belt.MutableSet.Int.has",
+ "kind": "value",
+ "name": "has",
+ "docstrings": [],
+ "signature": "let has: (t, value) => bool"
+ },
+ {
+ "id": "Belt.MutableSet.Int.add",
+ "kind": "value",
+ "name": "add",
+ "docstrings": [],
+ "signature": "let add: (t, value) => unit"
+ },
+ {
+ "id": "Belt.MutableSet.Int.addCheck",
+ "kind": "value",
+ "name": "addCheck",
+ "docstrings": [],
+ "signature": "let addCheck: (t, value) => bool"
+ },
+ {
+ "id": "Belt.MutableSet.Int.mergeMany",
+ "kind": "value",
+ "name": "mergeMany",
+ "docstrings": [],
+ "signature": "let mergeMany: (t, array) => unit"
+ },
+ {
+ "id": "Belt.MutableSet.Int.remove",
+ "kind": "value",
+ "name": "remove",
+ "docstrings": [],
+ "signature": "let remove: (t, value) => unit"
+ },
+ {
+ "id": "Belt.MutableSet.Int.removeCheck",
+ "kind": "value",
+ "name": "removeCheck",
+ "docstrings": [],
+ "signature": "let removeCheck: (t, value) => bool"
+ },
+ {
+ "id": "Belt.MutableSet.Int.removeMany",
+ "kind": "value",
+ "name": "removeMany",
+ "docstrings": [],
+ "signature": "let removeMany: (t, array) => unit"
+ },
+ {
+ "id": "Belt.MutableSet.Int.union",
+ "kind": "value",
+ "name": "union",
+ "docstrings": [],
+ "signature": "let union: (t, t) => t"
+ },
+ {
+ "id": "Belt.MutableSet.Int.intersect",
+ "kind": "value",
+ "name": "intersect",
+ "docstrings": [],
+ "signature": "let intersect: (t, t) => t"
+ },
+ {
+ "id": "Belt.MutableSet.Int.diff",
+ "kind": "value",
+ "name": "diff",
+ "docstrings": [],
+ "signature": "let diff: (t, t) => t"
+ },
+ {
+ "id": "Belt.MutableSet.Int.subset",
+ "kind": "value",
+ "name": "subset",
+ "docstrings": [],
+ "signature": "let subset: (t, t) => bool"
+ },
+ {
+ "id": "Belt.MutableSet.Int.cmp",
+ "kind": "value",
+ "name": "cmp",
+ "docstrings": [],
+ "signature": "let cmp: (t, t) => int"
+ },
+ {
+ "id": "Belt.MutableSet.Int.eq",
+ "kind": "value",
+ "name": "eq",
+ "docstrings": [],
+ "signature": "let eq: (t, t) => bool"
+ },
+ {
+ "id": "Belt.MutableSet.Int.forEachU",
+ "kind": "value",
+ "name": "forEachU",
+ "docstrings": [],
+ "signature": "let forEachU: (t, value => unit) => unit"
+ },
+ {
+ "id": "Belt.MutableSet.Int.forEach",
+ "kind": "value",
+ "name": "forEach",
+ "docstrings": ["In increasing order"],
+ "signature": "let forEach: (t, value => unit) => unit"
+ },
+ {
+ "id": "Belt.MutableSet.Int.reduceU",
+ "kind": "value",
+ "name": "reduceU",
+ "docstrings": [],
+ "signature": "let reduceU: (t, 'a, ('a, value) => 'a) => 'a"
+ },
+ {
+ "id": "Belt.MutableSet.Int.reduce",
+ "kind": "value",
+ "name": "reduce",
+ "docstrings": ["Iterate in increasing order."],
+ "signature": "let reduce: (t, 'a, ('a, value) => 'a) => 'a"
+ },
+ {
+ "id": "Belt.MutableSet.Int.everyU",
+ "kind": "value",
+ "name": "everyU",
+ "docstrings": [],
+ "signature": "let everyU: (t, value => bool) => bool"
+ },
+ {
+ "id": "Belt.MutableSet.Int.every",
+ "kind": "value",
+ "name": "every",
+ "docstrings": [
+ "`every(p, s)` checks if all elements of the set satisfy the predicate `p`.\nOrder unspecified."
+ ],
+ "signature": "let every: (t, value => bool) => bool"
+ },
+ {
+ "id": "Belt.MutableSet.Int.someU",
+ "kind": "value",
+ "name": "someU",
+ "docstrings": [],
+ "signature": "let someU: (t, value => bool) => bool"
+ },
+ {
+ "id": "Belt.MutableSet.Int.some",
+ "kind": "value",
+ "name": "some",
+ "docstrings": [
+ "`some(p, s)` checks if at least one element of the set satisfies the predicate\n`p`. Oder unspecified."
+ ],
+ "signature": "let some: (t, value => bool) => bool"
+ },
+ {
+ "id": "Belt.MutableSet.Int.keepU",
+ "kind": "value",
+ "name": "keepU",
+ "docstrings": [],
+ "signature": "let keepU: (t, value => bool) => t"
+ },
+ {
+ "id": "Belt.MutableSet.Int.keep",
+ "kind": "value",
+ "name": "keep",
+ "docstrings": [
+ "`keep(s, p)` returns a fresh copy of the set of all elements in `s` that satisfy\npredicate `p`."
+ ],
+ "signature": "let keep: (t, value => bool) => t"
+ },
+ {
+ "id": "Belt.MutableSet.Int.partitionU",
+ "kind": "value",
+ "name": "partitionU",
+ "docstrings": [],
+ "signature": "let partitionU: (t, value => bool) => (t, t)"
+ },
+ {
+ "id": "Belt.MutableSet.Int.partition",
+ "kind": "value",
+ "name": "partition",
+ "docstrings": [
+ "`partition(s, p)` returns a fresh copy pair of sets `(s1, s2)`, where `s1` is\nthe set of all the elements of `s` that satisfy the predicate `p`, and `s2` is\nthe set of all the elements of `s` that do not satisfy `p`."
+ ],
+ "signature": "let partition: (t, value => bool) => (t, t)"
+ },
+ {
+ "id": "Belt.MutableSet.Int.size",
+ "kind": "value",
+ "name": "size",
+ "docstrings": [],
+ "signature": "let size: t => int"
+ },
+ {
+ "id": "Belt.MutableSet.Int.toList",
+ "kind": "value",
+ "name": "toList",
+ "docstrings": ["In increasing order with respect"],
+ "signature": "let toList: t => list"
+ },
+ {
+ "id": "Belt.MutableSet.Int.toArray",
+ "kind": "value",
+ "name": "toArray",
+ "docstrings": ["In increasing order with respect"],
+ "signature": "let toArray: t => array"
+ },
+ {
+ "id": "Belt.MutableSet.Int.minimum",
+ "kind": "value",
+ "name": "minimum",
+ "docstrings": [],
+ "signature": "let minimum: t => option"
+ },
+ {
+ "id": "Belt.MutableSet.Int.minUndefined",
+ "kind": "value",
+ "name": "minUndefined",
+ "docstrings": [],
+ "signature": "let minUndefined: t => Js.undefined"
+ },
+ {
+ "id": "Belt.MutableSet.Int.maximum",
+ "kind": "value",
+ "name": "maximum",
+ "docstrings": [],
+ "signature": "let maximum: t => option"
+ },
+ {
+ "id": "Belt.MutableSet.Int.maxUndefined",
+ "kind": "value",
+ "name": "maxUndefined",
+ "docstrings": [],
+ "signature": "let maxUndefined: t => Js.undefined"
+ },
+ {
+ "id": "Belt.MutableSet.Int.get",
+ "kind": "value",
+ "name": "get",
+ "docstrings": [],
+ "signature": "let get: (t, value) => option"
+ },
+ {
+ "id": "Belt.MutableSet.Int.getUndefined",
+ "kind": "value",
+ "name": "getUndefined",
+ "docstrings": [],
+ "signature": "let getUndefined: (t, value) => Js.undefined"
+ },
+ {
+ "id": "Belt.MutableSet.Int.getExn",
+ "kind": "value",
+ "name": "getExn",
+ "docstrings": [],
+ "signature": "let getExn: (t, value) => value"
+ },
+ {
+ "id": "Belt.MutableSet.Int.split",
+ "kind": "value",
+ "name": "split",
+ "docstrings": ["`split(s, key)` return a fresh copy of each"],
+ "signature": "let split: (t, value) => ((t, t), bool)"
+ },
+ {
+ "id": "Belt.MutableSet.Int.checkInvariantInternal",
+ "kind": "value",
+ "name": "checkInvariantInternal",
+ "docstrings": ["**raise** when invariant is not held"],
+ "signature": "let checkInvariantInternal: t => unit"
+ }
+ ]
+ },
+ "belt/map/dict": {
+ "id": "Belt.Map.Dict",
+ "name": "Dict",
+ "docstrings": [
+ "This module separates identity from data, it is a bit more verbose but\nslightly more efficient due to the fact that there is no need to pack\nidentity and data back after each operation.\n\n**_Advanced usage only_**"
+ ],
+ "items": [
+ {
+ "id": "Belt.Map.Dict.t",
+ "kind": "type",
+ "name": "t",
+ "docstrings": [],
+ "signature": "type t<'key, 'value, 'id>"
+ },
+ {
+ "id": "Belt.Map.Dict.cmp",
+ "kind": "type",
+ "name": "cmp",
+ "docstrings": [],
+ "signature": "type cmp<'key, 'id> = Belt_Id.cmp<'key, 'id>"
+ },
+ {
+ "id": "Belt.Map.Dict.empty",
+ "kind": "value",
+ "name": "empty",
+ "docstrings": [],
+ "signature": "let empty: t<'k, 'v, 'id>"
+ },
+ {
+ "id": "Belt.Map.Dict.isEmpty",
+ "kind": "value",
+ "name": "isEmpty",
+ "docstrings": [],
+ "signature": "let isEmpty: t<'k, 'v, 'id> => bool"
+ },
+ {
+ "id": "Belt.Map.Dict.has",
+ "kind": "value",
+ "name": "has",
+ "docstrings": [],
+ "signature": "let has: (t<'k, 'a, 'id>, 'k, ~cmp: cmp<'k, 'id>) => bool"
+ },
+ {
+ "id": "Belt.Map.Dict.cmpU",
+ "kind": "value",
+ "name": "cmpU",
+ "docstrings": [],
+ "signature": "let cmpU: (\n t<'k, 'v, 'id>,\n t<'k, 'v, 'id>,\n ~kcmp: cmp<'k, 'id>,\n ~vcmp: ('v, 'v) => int,\n) => int"
+ },
+ {
+ "id": "Belt.Map.Dict.cmp",
+ "kind": "value",
+ "name": "cmp",
+ "docstrings": [],
+ "signature": "let cmp: (\n t<'k, 'v, 'id>,\n t<'k, 'v, 'id>,\n ~kcmp: cmp<'k, 'id>,\n ~vcmp: ('v, 'v) => int,\n) => int"
+ },
+ {
+ "id": "Belt.Map.Dict.eqU",
+ "kind": "value",
+ "name": "eqU",
+ "docstrings": [],
+ "signature": "let eqU: (\n t<'k, 'a, 'id>,\n t<'k, 'a, 'id>,\n ~kcmp: cmp<'k, 'id>,\n ~veq: ('a, 'a) => bool,\n) => bool"
+ },
+ {
+ "id": "Belt.Map.Dict.eq",
+ "kind": "value",
+ "name": "eq",
+ "docstrings": [
+ "`eq(m1, m2, cmp)` tests whether the maps `m1` and `m2` are equal, that is,\ncontain equal keys and associate them with equal data. `cmp` is the\nequality predicate used to compare the data associated with the keys."
+ ],
+ "signature": "let eq: (\n t<'k, 'a, 'id>,\n t<'k, 'a, 'id>,\n ~kcmp: cmp<'k, 'id>,\n ~veq: ('a, 'a) => bool,\n) => bool"
+ },
+ {
+ "id": "Belt.Map.Dict.findFirstByU",
+ "kind": "value",
+ "name": "findFirstByU",
+ "docstrings": [],
+ "signature": "let findFirstByU: (t<'k, 'v, 'id>, ('k, 'v) => bool) => option<('k, 'v)>"
+ },
+ {
+ "id": "Belt.Map.Dict.findFirstBy",
+ "kind": "value",
+ "name": "findFirstBy",
+ "docstrings": [
+ "`findFirstBy(m, p)` uses function `f` to find the first key value pair to\nmatch predicate `p`.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Map.Dict.fromArray([(4, \"4\"), (1, \"1\"), (2, \"2\"), (3, \"3\")], ~cmp=IntCmp.cmp)\n\nBelt.Map.Dict.findFirstBy(s0, (k, _) => k == 4) == Some((4, \"4\"))\n```"
+ ],
+ "signature": "let findFirstBy: (t<'k, 'v, 'id>, ('k, 'v) => bool) => option<('k, 'v)>"
+ },
+ {
+ "id": "Belt.Map.Dict.forEachU",
+ "kind": "value",
+ "name": "forEachU",
+ "docstrings": [],
+ "signature": "let forEachU: (t<'k, 'a, 'id>, ('k, 'a) => unit) => unit"
+ },
+ {
+ "id": "Belt.Map.Dict.forEach",
+ "kind": "value",
+ "name": "forEach",
+ "docstrings": [
+ "`forEach(m, f)` applies `f` to all bindings in map `m`. `f` receives the\nkey as first argument, and the associated value as second argument. The\nbindings are passed to `f` in increasing order with respect to the ordering\nover the type of the keys."
+ ],
+ "signature": "let forEach: (t<'k, 'a, 'id>, ('k, 'a) => unit) => unit"
+ },
+ {
+ "id": "Belt.Map.Dict.reduceU",
+ "kind": "value",
+ "name": "reduceU",
+ "docstrings": [],
+ "signature": "let reduceU: (t<'k, 'a, 'id>, 'b, ('b, 'k, 'a) => 'b) => 'b"
+ },
+ {
+ "id": "Belt.Map.Dict.reduce",
+ "kind": "value",
+ "name": "reduce",
+ "docstrings": [
+ "`reduce(m, a, f)` computes `f(kN, dN ... f(k1, d1, a)...)`, where `k1 ... kN` \nare the keys of all bindings in `m` (in increasing order), and `d1 ... dN` \nare the associated data."
+ ],
+ "signature": "let reduce: (t<'k, 'a, 'id>, 'b, ('b, 'k, 'a) => 'b) => 'b"
+ },
+ {
+ "id": "Belt.Map.Dict.everyU",
+ "kind": "value",
+ "name": "everyU",
+ "docstrings": [],
+ "signature": "let everyU: (t<'k, 'a, 'id>, ('k, 'a) => bool) => bool"
+ },
+ {
+ "id": "Belt.Map.Dict.every",
+ "kind": "value",
+ "name": "every",
+ "docstrings": [
+ "`every(m, p)` checks if all the bindings of the map satisfy the predicate\n`p`. Order unspecified"
+ ],
+ "signature": "let every: (t<'k, 'a, 'id>, ('k, 'a) => bool) => bool"
+ },
+ {
+ "id": "Belt.Map.Dict.someU",
+ "kind": "value",
+ "name": "someU",
+ "docstrings": [],
+ "signature": "let someU: (t<'k, 'a, 'id>, ('k, 'a) => bool) => bool"
+ },
+ {
+ "id": "Belt.Map.Dict.some",
+ "kind": "value",
+ "name": "some",
+ "docstrings": [
+ "`some(m, p)` checks if at least one binding of the map satisfy the\npredicate `p`. Order unspecified"
+ ],
+ "signature": "let some: (t<'k, 'a, 'id>, ('k, 'a) => bool) => bool"
+ },
+ {
+ "id": "Belt.Map.Dict.size",
+ "kind": "value",
+ "name": "size",
+ "docstrings": [],
+ "signature": "let size: t<'k, 'a, 'id> => int"
+ },
+ {
+ "id": "Belt.Map.Dict.toList",
+ "kind": "value",
+ "name": "toList",
+ "docstrings": ["In increasing order."],
+ "signature": "let toList: t<'k, 'a, 'id> => list<('k, 'a)>"
+ },
+ {
+ "id": "Belt.Map.Dict.toArray",
+ "kind": "value",
+ "name": "toArray",
+ "docstrings": [],
+ "signature": "let toArray: t<'k, 'a, 'id> => array<('k, 'a)>"
+ },
+ {
+ "id": "Belt.Map.Dict.fromArray",
+ "kind": "value",
+ "name": "fromArray",
+ "docstrings": [],
+ "signature": "let fromArray: (array<('k, 'a)>, ~cmp: cmp<'k, 'id>) => t<'k, 'a, 'id>"
+ },
+ {
+ "id": "Belt.Map.Dict.keysToArray",
+ "kind": "value",
+ "name": "keysToArray",
+ "docstrings": [],
+ "signature": "let keysToArray: t<'k, 'a, 'id> => array<'k>"
+ },
+ {
+ "id": "Belt.Map.Dict.valuesToArray",
+ "kind": "value",
+ "name": "valuesToArray",
+ "docstrings": [],
+ "signature": "let valuesToArray: t<'k, 'a, 'id> => array<'a>"
+ },
+ {
+ "id": "Belt.Map.Dict.minKey",
+ "kind": "value",
+ "name": "minKey",
+ "docstrings": [],
+ "signature": "let minKey: t<'k, 'a, 'b> => option<'k>"
+ },
+ {
+ "id": "Belt.Map.Dict.minKeyUndefined",
+ "kind": "value",
+ "name": "minKeyUndefined",
+ "docstrings": [],
+ "signature": "let minKeyUndefined: t<'k, 'a, 'b> => Js.undefined<'k>"
+ },
+ {
+ "id": "Belt.Map.Dict.maxKey",
+ "kind": "value",
+ "name": "maxKey",
+ "docstrings": [],
+ "signature": "let maxKey: t<'k, 'a, 'b> => option<'k>"
+ },
+ {
+ "id": "Belt.Map.Dict.maxKeyUndefined",
+ "kind": "value",
+ "name": "maxKeyUndefined",
+ "docstrings": [],
+ "signature": "let maxKeyUndefined: t<'k, 'a, 'b> => Js.undefined<'k>"
+ },
+ {
+ "id": "Belt.Map.Dict.minimum",
+ "kind": "value",
+ "name": "minimum",
+ "docstrings": [],
+ "signature": "let minimum: t<'k, 'a, 'b> => option<('k, 'a)>"
+ },
+ {
+ "id": "Belt.Map.Dict.minUndefined",
+ "kind": "value",
+ "name": "minUndefined",
+ "docstrings": [],
+ "signature": "let minUndefined: t<'k, 'a, 'b> => Js.undefined<('k, 'a)>"
+ },
+ {
+ "id": "Belt.Map.Dict.maximum",
+ "kind": "value",
+ "name": "maximum",
+ "docstrings": [],
+ "signature": "let maximum: t<'k, 'a, 'b> => option<('k, 'a)>"
+ },
+ {
+ "id": "Belt.Map.Dict.maxUndefined",
+ "kind": "value",
+ "name": "maxUndefined",
+ "docstrings": [],
+ "signature": "let maxUndefined: t<'k, 'a, 'b> => Js.undefined<('k, 'a)>"
+ },
+ {
+ "id": "Belt.Map.Dict.get",
+ "kind": "value",
+ "name": "get",
+ "docstrings": [],
+ "signature": "let get: (t<'k, 'a, 'id>, 'k, ~cmp: cmp<'k, 'id>) => option<'a>"
+ },
+ {
+ "id": "Belt.Map.Dict.getUndefined",
+ "kind": "value",
+ "name": "getUndefined",
+ "docstrings": [],
+ "signature": "let getUndefined: (t<'k, 'a, 'id>, 'k, ~cmp: cmp<'k, 'id>) => Js.undefined<'a>"
+ },
+ {
+ "id": "Belt.Map.Dict.getWithDefault",
+ "kind": "value",
+ "name": "getWithDefault",
+ "docstrings": [],
+ "signature": "let getWithDefault: (t<'k, 'a, 'id>, 'k, 'a, ~cmp: cmp<'k, 'id>) => 'a"
+ },
+ {
+ "id": "Belt.Map.Dict.getExn",
+ "kind": "value",
+ "name": "getExn",
+ "docstrings": [],
+ "signature": "let getExn: (t<'k, 'a, 'id>, 'k, ~cmp: cmp<'k, 'id>) => 'a"
+ },
+ {
+ "id": "Belt.Map.Dict.checkInvariantInternal",
+ "kind": "value",
+ "name": "checkInvariantInternal",
+ "docstrings": [],
+ "signature": "let checkInvariantInternal: t<'a, 'b, 'c> => unit"
+ },
+ {
+ "id": "Belt.Map.Dict.remove",
+ "kind": "value",
+ "name": "remove",
+ "docstrings": [
+ "`remove(m, x)` returns a map containing the same bindings as `m`, except\nfor `x` which is unbound in the returned map."
+ ],
+ "signature": "let remove: (t<'a, 'b, 'id>, 'a, ~cmp: cmp<'a, 'id>) => t<'a, 'b, 'id>"
+ },
+ {
+ "id": "Belt.Map.Dict.removeMany",
+ "kind": "value",
+ "name": "removeMany",
+ "docstrings": [],
+ "signature": "let removeMany: (\n t<'a, 'b, 'id>,\n array<'a>,\n ~cmp: cmp<'a, 'id>,\n) => t<'a, 'b, 'id>"
+ },
+ {
+ "id": "Belt.Map.Dict.set",
+ "kind": "value",
+ "name": "set",
+ "docstrings": [
+ "`set(m, x, y)` returns a map containing the same bindings as `m`, plus a\nbinding of `x` to `y`. If `x` was already bound in `m`, its previous\nbinding disappears."
+ ],
+ "signature": "let set: (\n t<'a, 'b, 'id>,\n 'a,\n 'b,\n ~cmp: cmp<'a, 'id>,\n) => t<'a, 'b, 'id>"
+ },
+ {
+ "id": "Belt.Map.Dict.updateU",
+ "kind": "value",
+ "name": "updateU",
+ "docstrings": [],
+ "signature": "let updateU: (\n t<'a, 'b, 'id>,\n 'a,\n option<'b> => option<'b>,\n ~cmp: cmp<'a, 'id>,\n) => t<'a, 'b, 'id>"
+ },
+ {
+ "id": "Belt.Map.Dict.update",
+ "kind": "value",
+ "name": "update",
+ "docstrings": [],
+ "signature": "let update: (\n t<'a, 'b, 'id>,\n 'a,\n option<'b> => option<'b>,\n ~cmp: cmp<'a, 'id>,\n) => t<'a, 'b, 'id>"
+ },
+ {
+ "id": "Belt.Map.Dict.mergeU",
+ "kind": "value",
+ "name": "mergeU",
+ "docstrings": [],
+ "signature": "let mergeU: (\n t<'a, 'b, 'id>,\n t<'a, 'c, 'id>,\n ('a, option<'b>, option<'c>) => option<'d>,\n ~cmp: cmp<'a, 'id>,\n) => t<'a, 'd, 'id>"
+ },
+ {
+ "id": "Belt.Map.Dict.merge",
+ "kind": "value",
+ "name": "merge",
+ "docstrings": [
+ "`merge(m1, m2, f)` computes a map whose keys is a subset of keys of `m1`\nand of `m2`. The presence of each such binding, and the corresponding\nvalue, is determined with the function `f`."
+ ],
+ "signature": "let merge: (\n t<'a, 'b, 'id>,\n t<'a, 'c, 'id>,\n ('a, option<'b>, option<'c>) => option<'d>,\n ~cmp: cmp<'a, 'id>,\n) => t<'a, 'd, 'id>"
+ },
+ {
+ "id": "Belt.Map.Dict.mergeMany",
+ "kind": "value",
+ "name": "mergeMany",
+ "docstrings": [],
+ "signature": "let mergeMany: (\n t<'a, 'b, 'id>,\n array<('a, 'b)>,\n ~cmp: cmp<'a, 'id>,\n) => t<'a, 'b, 'id>"
+ },
+ {
+ "id": "Belt.Map.Dict.keepU",
+ "kind": "value",
+ "name": "keepU",
+ "docstrings": [],
+ "signature": "let keepU: (t<'k, 'a, 'id>, ('k, 'a) => bool) => t<'k, 'a, 'id>"
+ },
+ {
+ "id": "Belt.Map.Dict.keep",
+ "kind": "value",
+ "name": "keep",
+ "docstrings": [
+ "`keep(m, p)` returns the map with all the bindings in `m` that satisfy\npredicate `p`."
+ ],
+ "signature": "let keep: (t<'k, 'a, 'id>, ('k, 'a) => bool) => t<'k, 'a, 'id>"
+ },
+ {
+ "id": "Belt.Map.Dict.partitionU",
+ "kind": "value",
+ "name": "partitionU",
+ "docstrings": [],
+ "signature": "let partitionU: (\n t<'k, 'a, 'id>,\n ('k, 'a) => bool,\n) => (t<'k, 'a, 'id>, t<'k, 'a, 'id>)"
+ },
+ {
+ "id": "Belt.Map.Dict.partition",
+ "kind": "value",
+ "name": "partition",
+ "docstrings": [
+ "`partition(m, p)` returns a pair of maps `(m1, m2)`, where `m1` contains\nall the bindings of `s` that satisfy the predicate `p`, and `m2` is the map\nwith all the bindings of `s` that do not satisfy `p`."
+ ],
+ "signature": "let partition: (\n t<'k, 'a, 'id>,\n ('k, 'a) => bool,\n) => (t<'k, 'a, 'id>, t<'k, 'a, 'id>)"
+ },
+ {
+ "id": "Belt.Map.Dict.split",
+ "kind": "value",
+ "name": "split",
+ "docstrings": [
+ "`split(x, m)` returns a triple `(l, data, r)`, where `l` is the map with\nall the bindings of `m` whose key is strictly less than `x`; `r` is the map\nwith all the bindings of `m` whose key is strictly greater than `x`; `data`\nis `None` if `m` contains no binding for `x`, or `Some(v)` if `m` binds `v`\nto `x`."
+ ],
+ "signature": "let split: (\n t<'a, 'b, 'id>,\n 'a,\n ~cmp: cmp<'a, 'id>,\n) => ((t<'a, 'b, 'id>, t<'a, 'b, 'id>), option<'b>)"
+ },
+ {
+ "id": "Belt.Map.Dict.mapU",
+ "kind": "value",
+ "name": "mapU",
+ "docstrings": [],
+ "signature": "let mapU: (t<'k, 'a, 'id>, 'a => 'b) => t<'k, 'b, 'id>"
+ },
+ {
+ "id": "Belt.Map.Dict.map",
+ "kind": "value",
+ "name": "map",
+ "docstrings": [
+ "`map(m, f)` returns a map with same domain as `m`, where the associated\nvalue `a` of all bindings of `m` has been replaced by the result of the\napplication of `f` to `a`. The bindings are passed to `f` in increasing\norder with respect to the ordering over the type of the keys."
+ ],
+ "signature": "let map: (t<'k, 'a, 'id>, 'a => 'b) => t<'k, 'b, 'id>"
+ },
+ {
+ "id": "Belt.Map.Dict.mapWithKeyU",
+ "kind": "value",
+ "name": "mapWithKeyU",
+ "docstrings": [],
+ "signature": "let mapWithKeyU: (t<'k, 'a, 'id>, ('k, 'a) => 'b) => t<'k, 'b, 'id>"
+ },
+ {
+ "id": "Belt.Map.Dict.mapWithKey",
+ "kind": "value",
+ "name": "mapWithKey",
+ "docstrings": [],
+ "signature": "let mapWithKey: (t<'k, 'a, 'id>, ('k, 'a) => 'b) => t<'k, 'b, 'id>"
+ }
+ ]
+ },
+ "belt/map/string": {
+ "id": "Belt.Map.String",
+ "name": "String",
+ "docstrings": [],
+ "items": [
+ {
+ "id": "Belt.Map.String.key",
+ "kind": "type",
+ "name": "key",
+ "docstrings": [],
+ "signature": "type key = string"
+ },
+ {
+ "id": "Belt.Map.String.t",
+ "kind": "type",
+ "name": "t",
+ "docstrings": ["The type of maps from type `key` to type `'value`."],
+ "signature": "type t<'value>"
+ },
+ {
+ "id": "Belt.Map.String.empty",
+ "kind": "value",
+ "name": "empty",
+ "docstrings": [],
+ "signature": "let empty: t<'v>"
+ },
+ {
+ "id": "Belt.Map.String.isEmpty",
+ "kind": "value",
+ "name": "isEmpty",
+ "docstrings": [],
+ "signature": "let isEmpty: t<'v> => bool"
+ },
+ {
+ "id": "Belt.Map.String.has",
+ "kind": "value",
+ "name": "has",
+ "docstrings": [],
+ "signature": "let has: (t<'v>, key) => bool"
+ },
+ {
+ "id": "Belt.Map.String.cmpU",
+ "kind": "value",
+ "name": "cmpU",
+ "docstrings": [],
+ "signature": "let cmpU: (t<'v>, t<'v>, ('v, 'v) => int) => int"
+ },
+ {
+ "id": "Belt.Map.String.cmp",
+ "kind": "value",
+ "name": "cmp",
+ "docstrings": [],
+ "signature": "let cmp: (t<'v>, t<'v>, ('v, 'v) => int) => int"
+ },
+ {
+ "id": "Belt.Map.String.eqU",
+ "kind": "value",
+ "name": "eqU",
+ "docstrings": [],
+ "signature": "let eqU: (t<'v>, t<'v>, ('v, 'v) => bool) => bool"
+ },
+ {
+ "id": "Belt.Map.String.eq",
+ "kind": "value",
+ "name": "eq",
+ "docstrings": [
+ "`eq(m1, m2)` tests whether the maps `m1` and `m2` are\nequal, that is, contain equal keys and associate them with\nequal data."
+ ],
+ "signature": "let eq: (t<'v>, t<'v>, ('v, 'v) => bool) => bool"
+ },
+ {
+ "id": "Belt.Map.String.findFirstByU",
+ "kind": "value",
+ "name": "findFirstByU",
+ "docstrings": [],
+ "signature": "let findFirstByU: (t<'v>, (key, 'v) => bool) => option<(key, 'v)>"
+ },
+ {
+ "id": "Belt.Map.String.findFirstBy",
+ "kind": "value",
+ "name": "findFirstBy",
+ "docstrings": [
+ "`findFirstBy(m, p)` uses funcion `f` to find the first key value pair\nto match predicate `p`.\n\n```rescript\nlet s0 = fromArray(~id=module(IntCmp), [(4, \"4\"), (1, \"1\"), (2, \"2,\"(3, \"\"))])\nfindFirstBy(s0, (k, v) => k == 4) == option((4, \"4\"))\n```"
+ ],
+ "signature": "let findFirstBy: (t<'v>, (key, 'v) => bool) => option<(key, 'v)>"
+ },
+ {
+ "id": "Belt.Map.String.forEachU",
+ "kind": "value",
+ "name": "forEachU",
+ "docstrings": [],
+ "signature": "let forEachU: (t<'v>, (key, 'v) => unit) => unit"
+ },
+ {
+ "id": "Belt.Map.String.forEach",
+ "kind": "value",
+ "name": "forEach",
+ "docstrings": [
+ "`forEach(m, f)` applies `f` to all bindings in map `m`.\n`f` receives the key as first argument, and the associated value\nas second argument. The bindings are passed to `f` in increasing\norder with respect to the ordering over the type of the keys."
+ ],
+ "signature": "let forEach: (t<'v>, (key, 'v) => unit) => unit"
+ },
+ {
+ "id": "Belt.Map.String.reduceU",
+ "kind": "value",
+ "name": "reduceU",
+ "docstrings": [],
+ "signature": "let reduceU: (t<'v>, 'v2, ('v2, key, 'v) => 'v2) => 'v2"
+ },
+ {
+ "id": "Belt.Map.String.reduce",
+ "kind": "value",
+ "name": "reduce",
+ "docstrings": [
+ "`reduce(m, a, f)` computes `(f kN dN ... (f k1 d1 a)...)`,\nwhere `k1 ... kN` are the keys of all bindings in `m`\n(in increasing order), and `d1 ... dN` are the associated data."
+ ],
+ "signature": "let reduce: (t<'v>, 'v2, ('v2, key, 'v) => 'v2) => 'v2"
+ },
+ {
+ "id": "Belt.Map.String.everyU",
+ "kind": "value",
+ "name": "everyU",
+ "docstrings": [],
+ "signature": "let everyU: (t<'v>, (key, 'v) => bool) => bool"
+ },
+ {
+ "id": "Belt.Map.String.every",
+ "kind": "value",
+ "name": "every",
+ "docstrings": [
+ "`every(m, p)` checks if all the bindings of the map satisfy the predicate `p`.\nOrder unspecified"
+ ],
+ "signature": "let every: (t<'v>, (key, 'v) => bool) => bool"
+ },
+ {
+ "id": "Belt.Map.String.someU",
+ "kind": "value",
+ "name": "someU",
+ "docstrings": [],
+ "signature": "let someU: (t<'v>, (key, 'v) => bool) => bool"
+ },
+ {
+ "id": "Belt.Map.String.some",
+ "kind": "value",
+ "name": "some",
+ "docstrings": [
+ "`some(m, p)` checks if at least one binding of the map satisfy the predicate\n`p`. Order unspecified"
+ ],
+ "signature": "let some: (t<'v>, (key, 'v) => bool) => bool"
+ },
+ {
+ "id": "Belt.Map.String.size",
+ "kind": "value",
+ "name": "size",
+ "docstrings": [],
+ "signature": "let size: t<'v> => int"
+ },
+ {
+ "id": "Belt.Map.String.toList",
+ "kind": "value",
+ "name": "toList",
+ "docstrings": ["In increasing order."],
+ "signature": "let toList: t<'v> => list<(key, 'v)>"
+ },
+ {
+ "id": "Belt.Map.String.toArray",
+ "kind": "value",
+ "name": "toArray",
+ "docstrings": [],
+ "signature": "let toArray: t<'v> => array<(key, 'v)>"
+ },
+ {
+ "id": "Belt.Map.String.fromArray",
+ "kind": "value",
+ "name": "fromArray",
+ "docstrings": [],
+ "signature": "let fromArray: array<(key, 'v)> => t<'v>"
+ },
+ {
+ "id": "Belt.Map.String.keysToArray",
+ "kind": "value",
+ "name": "keysToArray",
+ "docstrings": [],
+ "signature": "let keysToArray: t<'v> => array"
+ },
+ {
+ "id": "Belt.Map.String.valuesToArray",
+ "kind": "value",
+ "name": "valuesToArray",
+ "docstrings": [],
+ "signature": "let valuesToArray: t<'v> => array<'v>"
+ },
+ {
+ "id": "Belt.Map.String.minKey",
+ "kind": "value",
+ "name": "minKey",
+ "docstrings": [],
+ "signature": "let minKey: t<'a> => option"
+ },
+ {
+ "id": "Belt.Map.String.minKeyUndefined",
+ "kind": "value",
+ "name": "minKeyUndefined",
+ "docstrings": [],
+ "signature": "let minKeyUndefined: t<'a> => Js.undefined"
+ },
+ {
+ "id": "Belt.Map.String.maxKey",
+ "kind": "value",
+ "name": "maxKey",
+ "docstrings": [],
+ "signature": "let maxKey: t<'a> => option"
+ },
+ {
+ "id": "Belt.Map.String.maxKeyUndefined",
+ "kind": "value",
+ "name": "maxKeyUndefined",
+ "docstrings": [],
+ "signature": "let maxKeyUndefined: t<'a> => Js.undefined"
+ },
+ {
+ "id": "Belt.Map.String.minimum",
+ "kind": "value",
+ "name": "minimum",
+ "docstrings": [],
+ "signature": "let minimum: t<'v> => option<(key, 'v)>"
+ },
+ {
+ "id": "Belt.Map.String.minUndefined",
+ "kind": "value",
+ "name": "minUndefined",
+ "docstrings": [],
+ "signature": "let minUndefined: t<'v> => Js.undefined<(key, 'v)>"
+ },
+ {
+ "id": "Belt.Map.String.maximum",
+ "kind": "value",
+ "name": "maximum",
+ "docstrings": [],
+ "signature": "let maximum: t<'v> => option<(key, 'v)>"
+ },
+ {
+ "id": "Belt.Map.String.maxUndefined",
+ "kind": "value",
+ "name": "maxUndefined",
+ "docstrings": [],
+ "signature": "let maxUndefined: t<'v> => Js.undefined<(key, 'v)>"
+ },
+ {
+ "id": "Belt.Map.String.get",
+ "kind": "value",
+ "name": "get",
+ "docstrings": [],
+ "signature": "let get: (t<'v>, key) => option<'v>"
+ },
+ {
+ "id": "Belt.Map.String.getUndefined",
+ "kind": "value",
+ "name": "getUndefined",
+ "docstrings": [],
+ "signature": "let getUndefined: (t<'v>, key) => Js.undefined<'v>"
+ },
+ {
+ "id": "Belt.Map.String.getWithDefault",
+ "kind": "value",
+ "name": "getWithDefault",
+ "docstrings": [],
+ "signature": "let getWithDefault: (t<'v>, key, 'v) => 'v"
+ },
+ {
+ "id": "Belt.Map.String.getExn",
+ "kind": "value",
+ "name": "getExn",
+ "docstrings": [],
+ "signature": "let getExn: (t<'v>, key) => 'v"
+ },
+ {
+ "id": "Belt.Map.String.checkInvariantInternal",
+ "kind": "value",
+ "name": "checkInvariantInternal",
+ "docstrings": ["**raise** when invariant is not held"],
+ "signature": "let checkInvariantInternal: t<'a> => unit"
+ },
+ {
+ "id": "Belt.Map.String.remove",
+ "kind": "value",
+ "name": "remove",
+ "docstrings": [
+ "`remove m x` returns a map containing the same bindings as\n `m`, except for `x` which is unbound in the returned map."
+ ],
+ "signature": "let remove: (t<'v>, key) => t<'v>"
+ },
+ {
+ "id": "Belt.Map.String.removeMany",
+ "kind": "value",
+ "name": "removeMany",
+ "docstrings": [],
+ "signature": "let removeMany: (t<'v>, array) => t<'v>"
+ },
+ {
+ "id": "Belt.Map.String.set",
+ "kind": "value",
+ "name": "set",
+ "docstrings": [
+ "`set(m, x, y)` returns a map containing the same bindings as\n`m`, plus a binding of `x` to `y`. If `x` was already bound\nin `m`, its previous binding disappears."
+ ],
+ "signature": "let set: (t<'v>, key, 'v) => t<'v>"
+ },
+ {
+ "id": "Belt.Map.String.updateU",
+ "kind": "value",
+ "name": "updateU",
+ "docstrings": [],
+ "signature": "let updateU: (t<'v>, key, option<'v> => option<'v>) => t<'v>"
+ },
+ {
+ "id": "Belt.Map.String.update",
+ "kind": "value",
+ "name": "update",
+ "docstrings": [],
+ "signature": "let update: (t<'v>, key, option<'v> => option<'v>) => t<'v>"
+ },
+ {
+ "id": "Belt.Map.String.mergeU",
+ "kind": "value",
+ "name": "mergeU",
+ "docstrings": [],
+ "signature": "let mergeU: (\n t<'v>,\n t<'v2>,\n (key, option<'v>, option<'v2>) => option<'c>,\n) => t<'c>"
+ },
+ {
+ "id": "Belt.Map.String.merge",
+ "kind": "value",
+ "name": "merge",
+ "docstrings": [
+ "`merge(m1, m2, f)` computes a map whose keys is a subset of keys of `m1`\nand of `m2`. The presence of each such binding, and the corresponding\nvalue, is determined with the function `f`."
+ ],
+ "signature": "let merge: (\n t<'v>,\n t<'v2>,\n (key, option<'v>, option<'v2>) => option<'c>,\n) => t<'c>"
+ },
+ {
+ "id": "Belt.Map.String.mergeMany",
+ "kind": "value",
+ "name": "mergeMany",
+ "docstrings": [],
+ "signature": "let mergeMany: (t<'v>, array<(key, 'v)>) => t<'v>"
+ },
+ {
+ "id": "Belt.Map.String.keepU",
+ "kind": "value",
+ "name": "keepU",
+ "docstrings": [],
+ "signature": "let keepU: (t<'v>, (key, 'v) => bool) => t<'v>"
+ },
+ {
+ "id": "Belt.Map.String.keep",
+ "kind": "value",
+ "name": "keep",
+ "docstrings": [
+ "`keep(m, p)` returns the map with all the bindings in `m` that satisfy predicate\n`p`."
+ ],
+ "signature": "let keep: (t<'v>, (key, 'v) => bool) => t<'v>"
+ },
+ {
+ "id": "Belt.Map.String.partitionU",
+ "kind": "value",
+ "name": "partitionU",
+ "docstrings": [],
+ "signature": "let partitionU: (t<'v>, (key, 'v) => bool) => (t<'v>, t<'v>)"
+ },
+ {
+ "id": "Belt.Map.String.partition",
+ "kind": "value",
+ "name": "partition",
+ "docstrings": [
+ "`partition(m, p)` returns a pair of maps `(m1, m2)`, where `m1` contains all the\nbindings of `s` that satisfy the predicate `p`, and `m2` is the map with all the\nbindings of `s` that do not satisfy `p`."
+ ],
+ "signature": "let partition: (t<'v>, (key, 'v) => bool) => (t<'v>, t<'v>)"
+ },
+ {
+ "id": "Belt.Map.String.split",
+ "kind": "value",
+ "name": "split",
+ "docstrings": [
+ "`split(x, m)` returns a triple `(l, data, r)`, where `l` is the map with all the\nbindings of `m` whose key is strictly less than `x`; `r` is the map with all the\nbindings of `m` whose key is strictly greater than `x`; `data` is `None` if `m`\ncontains no binding for `x`, or `Some(v)` if `m` binds `v` to `x`."
+ ],
+ "signature": "let split: (key, t<'v>) => (t<'v>, option<'v>, t<'v>)"
+ },
+ {
+ "id": "Belt.Map.String.mapU",
+ "kind": "value",
+ "name": "mapU",
+ "docstrings": [],
+ "signature": "let mapU: (t<'v>, 'v => 'v2) => t<'v2>"
+ },
+ {
+ "id": "Belt.Map.String.map",
+ "kind": "value",
+ "name": "map",
+ "docstrings": [
+ "`map(m, f)` returns a map with same domain as `m`, where the associated value `a`\nof all bindings of `m` has been replaced by the result of the application of `f`\nto `a`. The bindings are passed to `f` in increasing order with respect to the\nordering over the type of the keys."
+ ],
+ "signature": "let map: (t<'v>, 'v => 'v2) => t<'v2>"
+ },
+ {
+ "id": "Belt.Map.String.mapWithKeyU",
+ "kind": "value",
+ "name": "mapWithKeyU",
+ "docstrings": [],
+ "signature": "let mapWithKeyU: (t<'v>, (key, 'v) => 'v2) => t<'v2>"
+ },
+ {
+ "id": "Belt.Map.String.mapWithKey",
+ "kind": "value",
+ "name": "mapWithKey",
+ "docstrings": [],
+ "signature": "let mapWithKey: (t<'v>, (key, 'v) => 'v2) => t<'v2>"
+ }
+ ]
+ },
+ "belt/map/int": {
+ "id": "Belt.Map.Int",
+ "name": "Int",
+ "docstrings": [
+ "## Examples\n\n```rescript\ntype t<'key, 'value, 'identity>\ntype id<'key, 'id> = Belt_Id.comparable<'key, 'id>\n```"
+ ],
+ "items": [
+ {
+ "id": "Belt.Map.Int.key",
+ "kind": "type",
+ "name": "key",
+ "docstrings": [],
+ "signature": "type key = int"
+ },
+ {
+ "id": "Belt.Map.Int.t",
+ "kind": "type",
+ "name": "t",
+ "docstrings": ["The type of maps from type `key` to type `'value`."],
+ "signature": "type t<'value>"
+ },
+ {
+ "id": "Belt.Map.Int.empty",
+ "kind": "value",
+ "name": "empty",
+ "docstrings": [],
+ "signature": "let empty: t<'v>"
+ },
+ {
+ "id": "Belt.Map.Int.isEmpty",
+ "kind": "value",
+ "name": "isEmpty",
+ "docstrings": [],
+ "signature": "let isEmpty: t<'v> => bool"
+ },
+ {
+ "id": "Belt.Map.Int.has",
+ "kind": "value",
+ "name": "has",
+ "docstrings": [],
+ "signature": "let has: (t<'v>, key) => bool"
+ },
+ {
+ "id": "Belt.Map.Int.cmpU",
+ "kind": "value",
+ "name": "cmpU",
+ "docstrings": [],
+ "signature": "let cmpU: (t<'v>, t<'v>, ('v, 'v) => int) => int"
+ },
+ {
+ "id": "Belt.Map.Int.cmp",
+ "kind": "value",
+ "name": "cmp",
+ "docstrings": [],
+ "signature": "let cmp: (t<'v>, t<'v>, ('v, 'v) => int) => int"
+ },
+ {
+ "id": "Belt.Map.Int.eqU",
+ "kind": "value",
+ "name": "eqU",
+ "docstrings": [],
+ "signature": "let eqU: (t<'v>, t<'v>, ('v, 'v) => bool) => bool"
+ },
+ {
+ "id": "Belt.Map.Int.eq",
+ "kind": "value",
+ "name": "eq",
+ "docstrings": [
+ "`eq(m1, m2)` tests whether the maps `m1` and `m2` are\nequal, that is, contain equal keys and associate them with\nequal data."
+ ],
+ "signature": "let eq: (t<'v>, t<'v>, ('v, 'v) => bool) => bool"
+ },
+ {
+ "id": "Belt.Map.Int.findFirstByU",
+ "kind": "value",
+ "name": "findFirstByU",
+ "docstrings": [],
+ "signature": "let findFirstByU: (t<'v>, (key, 'v) => bool) => option<(key, 'v)>"
+ },
+ {
+ "id": "Belt.Map.Int.findFirstBy",
+ "kind": "value",
+ "name": "findFirstBy",
+ "docstrings": [
+ "`findFirstBy(m, p)` uses funcion `f` to find the first key value pair\nto match predicate `p`.\n\n```rescript\nlet s0 = fromArray(~id=module(IntCmp), [(4, \"4\"), (1, \"1\"), (2, \"2,\"(3, \"\"))])\nfindFirstBy(s0, (k, v) => k == 4) == option((4, \"4\"))\n```"
+ ],
+ "signature": "let findFirstBy: (t<'v>, (key, 'v) => bool) => option<(key, 'v)>"
+ },
+ {
+ "id": "Belt.Map.Int.forEachU",
+ "kind": "value",
+ "name": "forEachU",
+ "docstrings": [],
+ "signature": "let forEachU: (t<'v>, (key, 'v) => unit) => unit"
+ },
+ {
+ "id": "Belt.Map.Int.forEach",
+ "kind": "value",
+ "name": "forEach",
+ "docstrings": [
+ "`forEach(m, f)` applies `f` to all bindings in map `m`.\n`f` receives the key as first argument, and the associated value\nas second argument. The bindings are passed to `f` in increasing\norder with respect to the ordering over the type of the keys."
+ ],
+ "signature": "let forEach: (t<'v>, (key, 'v) => unit) => unit"
+ },
+ {
+ "id": "Belt.Map.Int.reduceU",
+ "kind": "value",
+ "name": "reduceU",
+ "docstrings": [],
+ "signature": "let reduceU: (t<'v>, 'v2, ('v2, key, 'v) => 'v2) => 'v2"
+ },
+ {
+ "id": "Belt.Map.Int.reduce",
+ "kind": "value",
+ "name": "reduce",
+ "docstrings": [
+ "`reduce(m, a, f)` computes `(f kN dN ... (f k1 d1 a)...)`,\nwhere `k1 ... kN` are the keys of all bindings in `m`\n(in increasing order), and `d1 ... dN` are the associated data."
+ ],
+ "signature": "let reduce: (t<'v>, 'v2, ('v2, key, 'v) => 'v2) => 'v2"
+ },
+ {
+ "id": "Belt.Map.Int.everyU",
+ "kind": "value",
+ "name": "everyU",
+ "docstrings": [],
+ "signature": "let everyU: (t<'v>, (key, 'v) => bool) => bool"
+ },
+ {
+ "id": "Belt.Map.Int.every",
+ "kind": "value",
+ "name": "every",
+ "docstrings": [
+ "`every(m, p)` checks if all the bindings of the map satisfy the predicate `p`.\nOrder unspecified"
+ ],
+ "signature": "let every: (t<'v>, (key, 'v) => bool) => bool"
+ },
+ {
+ "id": "Belt.Map.Int.someU",
+ "kind": "value",
+ "name": "someU",
+ "docstrings": [],
+ "signature": "let someU: (t<'v>, (key, 'v) => bool) => bool"
+ },
+ {
+ "id": "Belt.Map.Int.some",
+ "kind": "value",
+ "name": "some",
+ "docstrings": [
+ "`some(m, p)` checks if at least one binding of the map satisfy the predicate\n`p`. Order unspecified"
+ ],
+ "signature": "let some: (t<'v>, (key, 'v) => bool) => bool"
+ },
+ {
+ "id": "Belt.Map.Int.size",
+ "kind": "value",
+ "name": "size",
+ "docstrings": [],
+ "signature": "let size: t<'v> => int"
+ },
+ {
+ "id": "Belt.Map.Int.toList",
+ "kind": "value",
+ "name": "toList",
+ "docstrings": ["In increasing order."],
+ "signature": "let toList: t<'v> => list<(key, 'v)>"
+ },
+ {
+ "id": "Belt.Map.Int.toArray",
+ "kind": "value",
+ "name": "toArray",
+ "docstrings": [],
+ "signature": "let toArray: t<'v> => array<(key, 'v)>"
+ },
+ {
+ "id": "Belt.Map.Int.fromArray",
+ "kind": "value",
+ "name": "fromArray",
+ "docstrings": [],
+ "signature": "let fromArray: array<(key, 'v)> => t<'v>"
+ },
+ {
+ "id": "Belt.Map.Int.keysToArray",
+ "kind": "value",
+ "name": "keysToArray",
+ "docstrings": [],
+ "signature": "let keysToArray: t<'v> => array"
+ },
+ {
+ "id": "Belt.Map.Int.valuesToArray",
+ "kind": "value",
+ "name": "valuesToArray",
+ "docstrings": [],
+ "signature": "let valuesToArray: t<'v> => array<'v>"
+ },
+ {
+ "id": "Belt.Map.Int.minKey",
+ "kind": "value",
+ "name": "minKey",
+ "docstrings": [],
+ "signature": "let minKey: t<'a> => option"
+ },
+ {
+ "id": "Belt.Map.Int.minKeyUndefined",
+ "kind": "value",
+ "name": "minKeyUndefined",
+ "docstrings": [],
+ "signature": "let minKeyUndefined: t<'a> => Js.undefined"
+ },
+ {
+ "id": "Belt.Map.Int.maxKey",
+ "kind": "value",
+ "name": "maxKey",
+ "docstrings": [],
+ "signature": "let maxKey: t<'a> => option"
+ },
+ {
+ "id": "Belt.Map.Int.maxKeyUndefined",
+ "kind": "value",
+ "name": "maxKeyUndefined",
+ "docstrings": [],
+ "signature": "let maxKeyUndefined: t<'a> => Js.undefined"
+ },
+ {
+ "id": "Belt.Map.Int.minimum",
+ "kind": "value",
+ "name": "minimum",
+ "docstrings": [],
+ "signature": "let minimum: t<'v> => option<(key, 'v)>"
+ },
+ {
+ "id": "Belt.Map.Int.minUndefined",
+ "kind": "value",
+ "name": "minUndefined",
+ "docstrings": [],
+ "signature": "let minUndefined: t<'v> => Js.undefined<(key, 'v)>"
+ },
+ {
+ "id": "Belt.Map.Int.maximum",
+ "kind": "value",
+ "name": "maximum",
+ "docstrings": [],
+ "signature": "let maximum: t<'v> => option<(key, 'v)>"
+ },
+ {
+ "id": "Belt.Map.Int.maxUndefined",
+ "kind": "value",
+ "name": "maxUndefined",
+ "docstrings": [],
+ "signature": "let maxUndefined: t<'v> => Js.undefined<(key, 'v)>"
+ },
+ {
+ "id": "Belt.Map.Int.get",
+ "kind": "value",
+ "name": "get",
+ "docstrings": [],
+ "signature": "let get: (t<'v>, key) => option<'v>"
+ },
+ {
+ "id": "Belt.Map.Int.getUndefined",
+ "kind": "value",
+ "name": "getUndefined",
+ "docstrings": [],
+ "signature": "let getUndefined: (t<'v>, key) => Js.undefined<'v>"
+ },
+ {
+ "id": "Belt.Map.Int.getWithDefault",
+ "kind": "value",
+ "name": "getWithDefault",
+ "docstrings": [],
+ "signature": "let getWithDefault: (t<'v>, key, 'v) => 'v"
+ },
+ {
+ "id": "Belt.Map.Int.getExn",
+ "kind": "value",
+ "name": "getExn",
+ "docstrings": [],
+ "signature": "let getExn: (t<'v>, key) => 'v"
+ },
+ {
+ "id": "Belt.Map.Int.checkInvariantInternal",
+ "kind": "value",
+ "name": "checkInvariantInternal",
+ "docstrings": ["**raise** when invariant is not held"],
+ "signature": "let checkInvariantInternal: t<'a> => unit"
+ },
+ {
+ "id": "Belt.Map.Int.remove",
+ "kind": "value",
+ "name": "remove",
+ "docstrings": [
+ "`remove m x` returns a map containing the same bindings as\n `m`, except for `x` which is unbound in the returned map."
+ ],
+ "signature": "let remove: (t<'v>, key) => t<'v>"
+ },
+ {
+ "id": "Belt.Map.Int.removeMany",
+ "kind": "value",
+ "name": "removeMany",
+ "docstrings": [],
+ "signature": "let removeMany: (t<'v>, array) => t<'v>"
+ },
+ {
+ "id": "Belt.Map.Int.set",
+ "kind": "value",
+ "name": "set",
+ "docstrings": [
+ "`set(m, x, y)` returns a map containing the same bindings as\n`m`, plus a binding of `x` to `y`. If `x` was already bound\nin `m`, its previous binding disappears."
+ ],
+ "signature": "let set: (t<'v>, key, 'v) => t<'v>"
+ },
+ {
+ "id": "Belt.Map.Int.updateU",
+ "kind": "value",
+ "name": "updateU",
+ "docstrings": [],
+ "signature": "let updateU: (t<'v>, key, option<'v> => option<'v>) => t<'v>"
+ },
+ {
+ "id": "Belt.Map.Int.update",
+ "kind": "value",
+ "name": "update",
+ "docstrings": [],
+ "signature": "let update: (t<'v>, key, option<'v> => option<'v>) => t<'v>"
+ },
+ {
+ "id": "Belt.Map.Int.mergeU",
+ "kind": "value",
+ "name": "mergeU",
+ "docstrings": [],
+ "signature": "let mergeU: (\n t<'v>,\n t<'v2>,\n (key, option<'v>, option<'v2>) => option<'c>,\n) => t<'c>"
+ },
+ {
+ "id": "Belt.Map.Int.merge",
+ "kind": "value",
+ "name": "merge",
+ "docstrings": [
+ "`merge(m1, m2, f)` computes a map whose keys is a subset of keys of `m1`\nand of `m2`. The presence of each such binding, and the corresponding\nvalue, is determined with the function `f`."
+ ],
+ "signature": "let merge: (\n t<'v>,\n t<'v2>,\n (key, option<'v>, option<'v2>) => option<'c>,\n) => t<'c>"
+ },
+ {
+ "id": "Belt.Map.Int.mergeMany",
+ "kind": "value",
+ "name": "mergeMany",
+ "docstrings": [],
+ "signature": "let mergeMany: (t<'v>, array<(key, 'v)>) => t<'v>"
+ },
+ {
+ "id": "Belt.Map.Int.keepU",
+ "kind": "value",
+ "name": "keepU",
+ "docstrings": [],
+ "signature": "let keepU: (t<'v>, (key, 'v) => bool) => t<'v>"
+ },
+ {
+ "id": "Belt.Map.Int.keep",
+ "kind": "value",
+ "name": "keep",
+ "docstrings": [
+ "`keep(m, p)` returns the map with all the bindings in `m` that satisfy predicate\n`p`."
+ ],
+ "signature": "let keep: (t<'v>, (key, 'v) => bool) => t<'v>"
+ },
+ {
+ "id": "Belt.Map.Int.partitionU",
+ "kind": "value",
+ "name": "partitionU",
+ "docstrings": [],
+ "signature": "let partitionU: (t<'v>, (key, 'v) => bool) => (t<'v>, t<'v>)"
+ },
+ {
+ "id": "Belt.Map.Int.partition",
+ "kind": "value",
+ "name": "partition",
+ "docstrings": [
+ "`partition(m, p)` returns a pair of maps `(m1, m2)`, where `m1` contains all the\nbindings of `s` that satisfy the predicate `p`, and `m2` is the map with all the\nbindings of `s` that do not satisfy `p`."
+ ],
+ "signature": "let partition: (t<'v>, (key, 'v) => bool) => (t<'v>, t<'v>)"
+ },
+ {
+ "id": "Belt.Map.Int.split",
+ "kind": "value",
+ "name": "split",
+ "docstrings": [
+ "`split(x, m)` returns a triple `(l, data, r)`, where `l` is the map with all the\nbindings of `m` whose key is strictly less than `x`; `r` is the map with all the\nbindings of `m` whose key is strictly greater than `x`; `data` is `None` if `m`\ncontains no binding for `x`, or `Some(v)` if `m` binds `v` to `x`."
+ ],
+ "signature": "let split: (key, t<'v>) => (t<'v>, option<'v>, t<'v>)"
+ },
+ {
+ "id": "Belt.Map.Int.mapU",
+ "kind": "value",
+ "name": "mapU",
+ "docstrings": [],
+ "signature": "let mapU: (t<'v>, 'v => 'v2) => t<'v2>"
+ },
+ {
+ "id": "Belt.Map.Int.map",
+ "kind": "value",
+ "name": "map",
+ "docstrings": [
+ "`map(m, f)` returns a map with same domain as `m`, where the associated value `a`\nof all bindings of `m` has been replaced by the result of the application of `f`\nto `a`. The bindings are passed to `f` in increasing order with respect to the\nordering over the type of the keys."
+ ],
+ "signature": "let map: (t<'v>, 'v => 'v2) => t<'v2>"
+ },
+ {
+ "id": "Belt.Map.Int.mapWithKeyU",
+ "kind": "value",
+ "name": "mapWithKeyU",
+ "docstrings": [],
+ "signature": "let mapWithKeyU: (t<'v>, (key, 'v) => 'v2) => t<'v2>"
+ },
+ {
+ "id": "Belt.Map.Int.mapWithKey",
+ "kind": "value",
+ "name": "mapWithKey",
+ "docstrings": [],
+ "signature": "let mapWithKey: (t<'v>, (key, 'v) => 'v2) => t<'v2>"
+ }
+ ]
+ },
+ "belt/set/dict": {
+ "id": "Belt.Set.Dict",
+ "name": "Dict",
+ "docstrings": [
+ "This module separates identity from data, it is a bit more verbose but slightly\nmore efficient due to the fact that there is no need to pack identity and data back\nafter each operation",
+ "This module separates identity from data. It is a bit more verbose but slightly\nmore efficient due to the fact that there is no need to pack identity and data\nback after each operation."
+ ],
+ "items": [
+ {
+ "id": "Belt.Set.Dict.t",
+ "kind": "type",
+ "name": "t",
+ "docstrings": [
+ "`'value` is the element type\n\n`'identity` the identity of the collection"
+ ],
+ "signature": "type t<'value, 'identity>"
+ },
+ {
+ "id": "Belt.Set.Dict.cmp",
+ "kind": "type",
+ "name": "cmp",
+ "docstrings": ["Type of compare function."],
+ "signature": "type cmp<'value, 'id> = Belt_Id.cmp<'value, 'id>"
+ },
+ {
+ "id": "Belt.Set.Dict.empty",
+ "kind": "value",
+ "name": "empty",
+ "docstrings": [
+ "## Examples\n\n```rescript\nlet s0 = Belt.Set.Dict.empty\n```"
+ ],
+ "signature": "let empty: t<'value, 'id>"
+ },
+ {
+ "id": "Belt.Set.Dict.fromArray",
+ "kind": "value",
+ "name": "fromArray",
+ "docstrings": [
+ "Creates new set from array of elements.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([1, 3, 2, 4], ~cmp=IntCmp.cmp)\n\ns0->Belt.Set.Dict.toArray /* [1, 2, 3, 4] */\n```"
+ ],
+ "signature": "let fromArray: (array<'value>, ~cmp: cmp<'value, 'id>) => t<'value, 'id>"
+ },
+ {
+ "id": "Belt.Set.Dict.fromSortedArrayUnsafe",
+ "kind": "value",
+ "name": "fromSortedArrayUnsafe",
+ "docstrings": [
+ "The same as [fromArray][#fromarray] except it is after assuming the input array\nis already sorted."
+ ],
+ "signature": "let fromSortedArrayUnsafe: array<'value> => t<'value, 'id>"
+ },
+ {
+ "id": "Belt.Set.Dict.isEmpty",
+ "kind": "value",
+ "name": "isEmpty",
+ "docstrings": [
+ "Checks if set is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet empty = Belt.Set.Dict.fromArray([], ~cmp=IntCmp.cmp)\nlet notEmpty = Belt.Set.Dict.fromArray([1], ~cmp=IntCmp.cmp)\n\nBelt.Set.Dict.isEmpty(empty) /* true */\nBelt.Set.Dict.isEmpty(notEmpty) /* false */\n```"
+ ],
+ "signature": "let isEmpty: t<'a, 'b> => bool"
+ },
+ {
+ "id": "Belt.Set.Dict.has",
+ "kind": "value",
+ "name": "has",
+ "docstrings": [
+ "Checks if an element exists in the set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet set = Belt.Set.Dict.fromArray([1, 4, 2, 5], ~cmp=IntCmp.cmp)\n\nset->Belt.Set.Dict.has(3, ~cmp=IntCmp.cmp) /* false */\nset->Belt.Set.Dict.has(1, ~cmp=IntCmp.cmp) /* true */\n```"
+ ],
+ "signature": "let has: (t<'value, 'id>, 'value, ~cmp: cmp<'value, 'id>) => bool"
+ },
+ {
+ "id": "Belt.Set.Dict.add",
+ "kind": "value",
+ "name": "add",
+ "docstrings": [
+ "Adds element to set. If element existed in set, value is unchanged.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.empty\nlet s1 = s0->Belt.Set.Dict.add(1, ~cmp=IntCmp.cmp)\nlet s2 = s1->Belt.Set.Dict.add(2, ~cmp=IntCmp.cmp)\nlet s3 = s2->Belt.Set.Dict.add(2, ~cmp=IntCmp.cmp)\ns0->Belt.Set.Dict.toArray /* [] */\ns1->Belt.Set.Dict.toArray /* [1] */\ns2->Belt.Set.Dict.toArray /* [1, 2] */\ns3->Belt.Set.Dict.toArray /* [1,2 ] */\ns2 == s3 /* true */\n```"
+ ],
+ "signature": "let add: (\n t<'value, 'id>,\n 'value,\n ~cmp: cmp<'value, 'id>,\n) => t<'value, 'id>"
+ },
+ {
+ "id": "Belt.Set.Dict.mergeMany",
+ "kind": "value",
+ "name": "mergeMany",
+ "docstrings": [
+ "Adds each element of array to set. Unlike [add](#add), the reference of return value might be changed even if all values in array already exist in set\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet set = Belt.Set.Dict.empty\n\nlet newSet = set->Belt.Set.Dict.mergeMany([5, 4, 3, 2, 1], ~cmp=IntCmp.cmp)\nnewSet->Belt.Set.Dict.toArray /* [1, 2, 3, 4, 5] */\n```"
+ ],
+ "signature": "let mergeMany: (\n t<'value, 'id>,\n array<'value>,\n ~cmp: cmp<'value, 'id>,\n) => t<'value, 'id>"
+ },
+ {
+ "id": "Belt.Set.Dict.remove",
+ "kind": "value",
+ "name": "remove",
+ "docstrings": [
+ "Removes element from set. If element did not exist in set, value is unchanged.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([2, 3, 1, 4, 5], ~cmp=IntCmp.cmp)\nlet s1 = s0->Belt.Set.Dict.remove(1, ~cmp=IntCmp.cmp)\nlet s2 = s1->Belt.Set.Dict.remove(3, ~cmp=IntCmp.cmp)\nlet s3 = s2->Belt.Set.Dict.remove(3, ~cmp=IntCmp.cmp)\n\ns1->Belt.Set.Dict.toArray /* [2,3,4,5] */\ns2->Belt.Set.Dict.toArray /* [2,4,5] */\ns2 == s3 /* true */\n```"
+ ],
+ "signature": "let remove: (\n t<'value, 'id>,\n 'value,\n ~cmp: cmp<'value, 'id>,\n) => t<'value, 'id>"
+ },
+ {
+ "id": "Belt.Set.Dict.removeMany",
+ "kind": "value",
+ "name": "removeMany",
+ "docstrings": [
+ "Removes each element of array from set. Unlike [remove](#remove), the reference of return value might be changed even if any values in array not existed in set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet set = Belt.Set.Dict.fromArray([1, 2, 3, 4], ~cmp=IntCmp.cmp)\n\nlet newSet = set->Belt.Set.Dict.removeMany([5, 4, 3, 2, 1], ~cmp=IntCmp.cmp)\nnewSet->Belt.Set.Dict.toArray /* [] */\n```"
+ ],
+ "signature": "let removeMany: (\n t<'value, 'id>,\n array<'value>,\n ~cmp: cmp<'value, 'id>,\n) => t<'value, 'id>"
+ },
+ {
+ "id": "Belt.Set.Dict.union",
+ "kind": "value",
+ "name": "union",
+ "docstrings": [
+ "Returns union of two sets.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([5, 2, 3, 5, 6], ~cmp=IntCmp.cmp)\nlet s1 = Belt.Set.Dict.fromArray([5, 2, 3, 1, 5, 4], ~cmp=IntCmp.cmp)\nlet union = Belt.Set.Dict.union(s0, s1, ~cmp=IntCmp.cmp)\nunion->Belt.Set.Dict.toArray /* [1,2,3,4,5,6] */\n```"
+ ],
+ "signature": "let union: (\n t<'value, 'id>,\n t<'value, 'id>,\n ~cmp: cmp<'value, 'id>,\n) => t<'value, 'id>"
+ },
+ {
+ "id": "Belt.Set.Dict.intersect",
+ "kind": "value",
+ "name": "intersect",
+ "docstrings": [
+ "Returns intersection of two sets.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([5, 2, 3, 5, 6], ~cmp=IntCmp.cmp)\nlet s1 = Belt.Set.Dict.fromArray([5, 2, 3, 1, 5, 4], ~cmp=IntCmp.cmp)\nlet intersect = Belt.Set.Dict.intersect(s0, s1, ~cmp=IntCmp.cmp)\nintersect->Belt.Set.Dict.toArray /* [2,3,5] */\n```"
+ ],
+ "signature": "let intersect: (\n t<'value, 'id>,\n t<'value, 'id>,\n ~cmp: cmp<'value, 'id>,\n) => t<'value, 'id>"
+ },
+ {
+ "id": "Belt.Set.Dict.diff",
+ "kind": "value",
+ "name": "diff",
+ "docstrings": [
+ "Returns elements from first set, not existing in second set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([5, 2, 3, 5, 6], ~cmp=IntCmp.cmp)\nlet s1 = Belt.Set.Dict.fromArray([5, 2, 3, 1, 5, 4], ~cmp=IntCmp.cmp)\n\nlet diff1 = Belt.Set.Dict.diff(s0, s1, ~cmp=IntCmp.cmp)\nlet diff2 = Belt.Set.Dict.diff(s1, s0, ~cmp=IntCmp.cmp)\n\ndiff1->Belt.Set.Dict.toArray /* [6] */\ndiff2->Belt.Set.Dict.toArray /* [1,4] */\n```"
+ ],
+ "signature": "let diff: (\n t<'value, 'id>,\n t<'value, 'id>,\n ~cmp: cmp<'value, 'id>,\n) => t<'value, 'id>"
+ },
+ {
+ "id": "Belt.Set.Dict.subset",
+ "kind": "value",
+ "name": "subset",
+ "docstrings": [
+ "Checks if second set is subset of first set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([5, 2, 3, 5, 6], ~cmp=IntCmp.cmp)\nlet s1 = Belt.Set.Dict.fromArray([5, 2, 3, 1, 5, 4], ~cmp=IntCmp.cmp)\nlet s2 = Belt.Set.Dict.intersect(s0, s1, ~cmp=IntCmp.cmp)\nBelt.Set.Dict.subset(s2, s0, ~cmp=IntCmp.cmp) /* true */\nBelt.Set.Dict.subset(s2, s1, ~cmp=IntCmp.cmp) /* true */\nBelt.Set.Dict.subset(s1, s0, ~cmp=IntCmp.cmp) /* false */\n```"
+ ],
+ "signature": "let subset: (\n t<'value, 'id>,\n t<'value, 'id>,\n ~cmp: cmp<'value, 'id>,\n) => bool"
+ },
+ {
+ "id": "Belt.Set.Dict.cmp",
+ "kind": "value",
+ "name": "cmp",
+ "docstrings": [
+ "Total ordering between sets. Can be used as the ordering function for doing sets\nof sets. It compares size first and then iterates over each element following the\norder of elements."
+ ],
+ "signature": "let cmp: (\n t<'value, 'id>,\n t<'value, 'id>,\n ~cmp: cmp<'value, 'id>,\n) => int"
+ },
+ {
+ "id": "Belt.Set.Dict.eq",
+ "kind": "value",
+ "name": "eq",
+ "docstrings": [
+ "Checks if two sets are equal.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([5, 2, 3], ~cmp=IntCmp.cmp)\nlet s1 = Belt.Set.Dict.fromArray([3, 2, 5], ~cmp=IntCmp.cmp)\n\nBelt.Set.Dict.eq(s0, s1, ~cmp=IntCmp.cmp) /* true */\n```"
+ ],
+ "signature": "let eq: (\n t<'value, 'id>,\n t<'value, 'id>,\n ~cmp: cmp<'value, 'id>,\n) => bool"
+ },
+ {
+ "id": "Belt.Set.Dict.forEachU",
+ "kind": "value",
+ "name": "forEachU",
+ "docstrings": [
+ "Same as [forEach](##forEach) but takes uncurried functon."
+ ],
+ "signature": "let forEachU: (t<'value, 'id>, 'value => unit) => unit"
+ },
+ {
+ "id": "Belt.Set.Dict.forEach",
+ "kind": "value",
+ "name": "forEach",
+ "docstrings": [
+ "Applies function `f` in turn to all elements of set in increasing order.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([5, 2, 3, 5, 6], ~cmp=IntCmp.cmp)\nlet acc = ref(list{})\ns0->Belt.Set.Dict.forEach(x => acc := Belt.List.add(acc.contents, x))\nacc /* [6,5,3,2] */\n```"
+ ],
+ "signature": "let forEach: (t<'value, 'id>, 'value => unit) => unit"
+ },
+ {
+ "id": "Belt.Set.Dict.reduceU",
+ "kind": "value",
+ "name": "reduceU",
+ "docstrings": [],
+ "signature": "let reduceU: (t<'value, 'id>, 'a, ('a, 'value) => 'a) => 'a"
+ },
+ {
+ "id": "Belt.Set.Dict.reduce",
+ "kind": "value",
+ "name": "reduce",
+ "docstrings": [
+ "Applies function `f` to each element of set in increasing order. Function `f` has two parameters: the item from the set and an “accumulator”, which starts with a value of `initialValue`. `reduce` returns the final value of the accumulator.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([5, 2, 3, 5, 6], ~cmp=IntCmp.cmp)\ns0->Belt.Set.Dict.reduce(list{}, (acc, element) => acc->Belt.List.add(element)) /* [6,5,3,2] */\n```"
+ ],
+ "signature": "let reduce: (t<'value, 'id>, 'a, ('a, 'value) => 'a) => 'a"
+ },
+ {
+ "id": "Belt.Set.Dict.everyU",
+ "kind": "value",
+ "name": "everyU",
+ "docstrings": [],
+ "signature": "let everyU: (t<'value, 'id>, 'value => bool) => bool"
+ },
+ {
+ "id": "Belt.Set.Dict.every",
+ "kind": "value",
+ "name": "every",
+ "docstrings": [
+ "Checks if all elements of the set satisfy the predicate. Order unspecified.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet isEven = x => mod(x, 2) == 0\n\nlet s0 = Belt.Set.Dict.fromArray([2, 4, 6, 8], ~cmp=IntCmp.cmp)\ns0->Belt.Set.Dict.every(isEven) /* true */\n```"
+ ],
+ "signature": "let every: (t<'value, 'id>, 'value => bool) => bool"
+ },
+ {
+ "id": "Belt.Set.Dict.someU",
+ "kind": "value",
+ "name": "someU",
+ "docstrings": [],
+ "signature": "let someU: (t<'value, 'id>, 'value => bool) => bool"
+ },
+ {
+ "id": "Belt.Set.Dict.some",
+ "kind": "value",
+ "name": "some",
+ "docstrings": [
+ "Checks if at least one element of the set satisfies the predicate.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet isOdd = x => mod(x, 2) != 0\n\nlet s0 = Belt.Set.Dict.fromArray([1, 2, 4, 6, 8], ~cmp=IntCmp.cmp)\ns0->Belt.Set.Dict.some(isOdd) /* true */\n```"
+ ],
+ "signature": "let some: (t<'value, 'id>, 'value => bool) => bool"
+ },
+ {
+ "id": "Belt.Set.Dict.keepU",
+ "kind": "value",
+ "name": "keepU",
+ "docstrings": [],
+ "signature": "let keepU: (t<'value, 'id>, 'value => bool) => t<'value, 'id>"
+ },
+ {
+ "id": "Belt.Set.Dict.keep",
+ "kind": "value",
+ "name": "keep",
+ "docstrings": [
+ "Returns the set of all elements that satisfy the predicate.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet isEven = x => mod(x, 2) == 0\n\nlet s0 = Belt.Set.Dict.fromArray([1, 2, 3, 4, 5], ~cmp=IntCmp.cmp)\nlet s1 = s0->Belt.Set.Dict.keep(isEven)\n\ns1->Belt.Set.Dict.toArray /* [2,4] */\n```"
+ ],
+ "signature": "let keep: (t<'value, 'id>, 'value => bool) => t<'value, 'id>"
+ },
+ {
+ "id": "Belt.Set.Dict.partitionU",
+ "kind": "value",
+ "name": "partitionU",
+ "docstrings": [],
+ "signature": "let partitionU: (\n t<'value, 'id>,\n 'value => bool,\n) => (t<'value, 'id>, t<'value, 'id>)"
+ },
+ {
+ "id": "Belt.Set.Dict.partition",
+ "kind": "value",
+ "name": "partition",
+ "docstrings": [
+ "Returns a pair of sets, where first is the set of all the elements of set that satisfy the predicate, and second is the set of all the elements of set that do not satisfy the predicate.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet isOdd = x => mod(x, 2) != 0\n\nlet s0 = Belt.Set.Dict.fromArray([1, 2, 3, 4, 5], ~cmp=IntCmp.cmp)\nlet (s1, s2) = s0->Belt.Set.Dict.partition(isOdd)\n\ns1->Belt.Set.Dict.toArray /* [1,3,5] */\ns2->Belt.Set.Dict.toArray /* [2,4] */\n```"
+ ],
+ "signature": "let partition: (\n t<'value, 'id>,\n 'value => bool,\n) => (t<'value, 'id>, t<'value, 'id>)"
+ },
+ {
+ "id": "Belt.Set.Dict.size",
+ "kind": "value",
+ "name": "size",
+ "docstrings": [
+ "Returns size of the set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([1, 2, 3, 4], ~cmp=IntCmp.cmp)\n\ns0->Belt.Set.Dict.size /* 4 */\n```"
+ ],
+ "signature": "let size: t<'value, 'id> => int"
+ },
+ {
+ "id": "Belt.Set.Dict.toList",
+ "kind": "value",
+ "name": "toList",
+ "docstrings": [
+ "Returns list of ordered set elements.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([3, 2, 1, 5], ~cmp=IntCmp.cmp)\n\ns0->Belt.Set.Dict.toList /* [1,2,3,5] */\n```"
+ ],
+ "signature": "let toList: t<'value, 'id> => list<'value>"
+ },
+ {
+ "id": "Belt.Set.Dict.toArray",
+ "kind": "value",
+ "name": "toArray",
+ "docstrings": [
+ "Returns array of ordered set elements.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([3, 2, 1, 5], ~cmp=IntCmp.cmp)\n\ns0->Belt.Set.Dict.toArray /* [1,2,3,5] */\n```"
+ ],
+ "signature": "let toArray: t<'value, 'id> => array<'value>"
+ },
+ {
+ "id": "Belt.Set.Dict.minimum",
+ "kind": "value",
+ "name": "minimum",
+ "docstrings": [
+ "Returns minimum value of the collection. `None` if collection is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.empty\nlet s1 = Belt.Set.Dict.fromArray([3, 2, 1, 5], ~cmp=IntCmp.cmp)\n\ns0->Belt.Set.Dict.minimum /* None */\ns1->Belt.Set.Dict.minimum /* Some(1) */\n```"
+ ],
+ "signature": "let minimum: t<'value, 'id> => option<'value>"
+ },
+ {
+ "id": "Belt.Set.Dict.minUndefined",
+ "kind": "value",
+ "name": "minUndefined",
+ "docstrings": [
+ "Returns minimum value of the collection. `undefined` if collection is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.empty\nlet s1 = Belt.Set.Dict.fromArray([3, 2, 1, 5], ~cmp=IntCmp.cmp)\n\ns0->Belt.Set.Dict.minUndefined /* undefined */\ns1->Belt.Set.Dict.minUndefined /* 1 */\n```"
+ ],
+ "signature": "let minUndefined: t<'value, 'id> => Js.undefined<'value>"
+ },
+ {
+ "id": "Belt.Set.Dict.maximum",
+ "kind": "value",
+ "name": "maximum",
+ "docstrings": [
+ "Returns maximum value of the collection. `None` if collection is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.empty\nlet s1 = Belt.Set.Dict.fromArray([3, 2, 1, 5], ~cmp=IntCmp.cmp)\n\ns0->Belt.Set.Dict.maximum /* None */\ns1->Belt.Set.Dict.maximum /* Some(5) */\n```"
+ ],
+ "signature": "let maximum: t<'value, 'id> => option<'value>"
+ },
+ {
+ "id": "Belt.Set.Dict.maxUndefined",
+ "kind": "value",
+ "name": "maxUndefined",
+ "docstrings": [
+ "Returns maximum value of the collection. `undefined` if collection is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.empty\nlet s1 = Belt.Set.Dict.fromArray([3, 2, 1, 5], ~cmp=IntCmp.cmp)\n\ns0->Belt.Set.Dict.maxUndefined /* undefined */\ns1->Belt.Set.Dict.maxUndefined /* 5 */\n```"
+ ],
+ "signature": "let maxUndefined: t<'value, 'id> => Js.undefined<'value>"
+ },
+ {
+ "id": "Belt.Set.Dict.get",
+ "kind": "value",
+ "name": "get",
+ "docstrings": [
+ "Returns the reference of the value which is equivalent to value using the comparator\nspecifiecd by this collection. Returns `None` if element does not exist.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([1, 2, 3, 4, 5], ~cmp=IntCmp.cmp)\n\ns0->Belt.Set.Dict.get(3, ~cmp=IntCmp.cmp) /* Some(3) */\ns0->Belt.Set.Dict.get(20, ~cmp=IntCmp.cmp) /* None */\n```"
+ ],
+ "signature": "let get: (\n t<'value, 'id>,\n 'value,\n ~cmp: cmp<'value, 'id>,\n) => option<'value>"
+ },
+ {
+ "id": "Belt.Set.Dict.getUndefined",
+ "kind": "value",
+ "name": "getUndefined",
+ "docstrings": [
+ "Same as [get](#get) but returns `undefined` when element does not exist."
+ ],
+ "signature": "let getUndefined: (\n t<'value, 'id>,\n 'value,\n ~cmp: cmp<'value, 'id>,\n) => Js.undefined<'value>"
+ },
+ {
+ "id": "Belt.Set.Dict.getExn",
+ "kind": "value",
+ "name": "getExn",
+ "docstrings": [
+ "Same as [get](#get) but raise when element does not exist."
+ ],
+ "signature": "let getExn: (t<'value, 'id>, 'value, ~cmp: cmp<'value, 'id>) => 'value"
+ },
+ {
+ "id": "Belt.Set.Dict.split",
+ "kind": "value",
+ "name": "split",
+ "docstrings": [
+ "Returns a tuple `((smaller, larger), present)`, `present` is true when element exist in set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.Set.Dict.fromArray([1, 2, 3, 4, 5], ~cmp=IntCmp.cmp)\n\nlet ((smaller, larger), present) = s0->Belt.Set.Dict.split(3, ~cmp=IntCmp.cmp)\n\npresent /* true */\nsmaller->Belt.Set.Dict.toArray /* [1,2] */\nlarger->Belt.Set.Dict.toArray /* [4,5] */\n```"
+ ],
+ "signature": "let split: (\n t<'value, 'id>,\n 'value,\n ~cmp: cmp<'value, 'id>,\n) => ((t<'value, 'id>, t<'value, 'id>), bool)"
+ },
+ {
+ "id": "Belt.Set.Dict.checkInvariantInternal",
+ "kind": "value",
+ "name": "checkInvariantInternal",
+ "docstrings": ["**raise** when invariant is not held"],
+ "signature": "let checkInvariantInternal: t<'a, 'b> => unit"
+ }
+ ]
+ },
+ "belt/set/string": {
+ "id": "Belt.Set.String",
+ "name": "String",
+ "docstrings": [
+ "Specialized when value type is `string`, more efficient than the generic type,\nits compare behavior is fixed using the built-in comparison",
+ "This module is [`Belt.Set`]() specialized with value type to be a primitive type.\n It is more efficient in general, the API is the same with [`Belt_Set`]() except its value type is fixed,\n and identity is not needed(using the built-in one)\n\n **See** [`Belt.Set`]()"
+ ],
+ "items": [
+ {
+ "id": "Belt.Set.String.value",
+ "kind": "type",
+ "name": "value",
+ "docstrings": ["The type of the set elements."],
+ "signature": "type value = string"
+ },
+ {
+ "id": "Belt.Set.String.t",
+ "kind": "type",
+ "name": "t",
+ "docstrings": ["The type of sets."],
+ "signature": "type t"
+ },
+ {
+ "id": "Belt.Set.String.empty",
+ "kind": "value",
+ "name": "empty",
+ "docstrings": [],
+ "signature": "let empty: t"
+ },
+ {
+ "id": "Belt.Set.String.fromArray",
+ "kind": "value",
+ "name": "fromArray",
+ "docstrings": [],
+ "signature": "let fromArray: array => t"
+ },
+ {
+ "id": "Belt.Set.String.fromSortedArrayUnsafe",
+ "kind": "value",
+ "name": "fromSortedArrayUnsafe",
+ "docstrings": [],
+ "signature": "let fromSortedArrayUnsafe: array => t"
+ },
+ {
+ "id": "Belt.Set.String.isEmpty",
+ "kind": "value",
+ "name": "isEmpty",
+ "docstrings": [],
+ "signature": "let isEmpty: t => bool"
+ },
+ {
+ "id": "Belt.Set.String.has",
+ "kind": "value",
+ "name": "has",
+ "docstrings": [],
+ "signature": "let has: (t, value) => bool"
+ },
+ {
+ "id": "Belt.Set.String.add",
+ "kind": "value",
+ "name": "add",
+ "docstrings": [
+ "`add(s, x)` If `x` was already in `s`, `s` is returned unchanged."
+ ],
+ "signature": "let add: (t, value) => t"
+ },
+ {
+ "id": "Belt.Set.String.mergeMany",
+ "kind": "value",
+ "name": "mergeMany",
+ "docstrings": [],
+ "signature": "let mergeMany: (t, array) => t"
+ },
+ {
+ "id": "Belt.Set.String.remove",
+ "kind": "value",
+ "name": "remove",
+ "docstrings": [
+ "`remove(m, x)` If `x` was not in `m`, `m` is returned reference unchanged."
+ ],
+ "signature": "let remove: (t, value) => t"
+ },
+ {
+ "id": "Belt.Set.String.removeMany",
+ "kind": "value",
+ "name": "removeMany",
+ "docstrings": [],
+ "signature": "let removeMany: (t, array) => t"
+ },
+ {
+ "id": "Belt.Set.String.union",
+ "kind": "value",
+ "name": "union",
+ "docstrings": [],
+ "signature": "let union: (t, t) => t"
+ },
+ {
+ "id": "Belt.Set.String.intersect",
+ "kind": "value",
+ "name": "intersect",
+ "docstrings": [],
+ "signature": "let intersect: (t, t) => t"
+ },
+ {
+ "id": "Belt.Set.String.diff",
+ "kind": "value",
+ "name": "diff",
+ "docstrings": [],
+ "signature": "let diff: (t, t) => t"
+ },
+ {
+ "id": "Belt.Set.String.subset",
+ "kind": "value",
+ "name": "subset",
+ "docstrings": [
+ "`subset(s1, s2)` tests whether the set `s1` is a subset of the set `s2`."
+ ],
+ "signature": "let subset: (t, t) => bool"
+ },
+ {
+ "id": "Belt.Set.String.cmp",
+ "kind": "value",
+ "name": "cmp",
+ "docstrings": [
+ "Total ordering between sets. Can be used as the ordering function for doing sets\nof sets."
+ ],
+ "signature": "let cmp: (t, t) => int"
+ },
+ {
+ "id": "Belt.Set.String.eq",
+ "kind": "value",
+ "name": "eq",
+ "docstrings": [
+ "`eq(s1, s2)` tests whether the sets `s1` and `s2` are equal, that is, contain\nequal elements."
+ ],
+ "signature": "let eq: (t, t) => bool"
+ },
+ {
+ "id": "Belt.Set.String.forEachU",
+ "kind": "value",
+ "name": "forEachU",
+ "docstrings": [],
+ "signature": "let forEachU: (t, value => unit) => unit"
+ },
+ {
+ "id": "Belt.Set.String.forEach",
+ "kind": "value",
+ "name": "forEach",
+ "docstrings": [
+ "`forEach(s, f)` applies `f` in turn to all elements of `s`. In increasing order"
+ ],
+ "signature": "let forEach: (t, value => unit) => unit"
+ },
+ {
+ "id": "Belt.Set.String.reduceU",
+ "kind": "value",
+ "name": "reduceU",
+ "docstrings": [],
+ "signature": "let reduceU: (t, 'a, ('a, value) => 'a) => 'a"
+ },
+ {
+ "id": "Belt.Set.String.reduce",
+ "kind": "value",
+ "name": "reduce",
+ "docstrings": ["Iterate in increasing order."],
+ "signature": "let reduce: (t, 'a, ('a, value) => 'a) => 'a"
+ },
+ {
+ "id": "Belt.Set.String.everyU",
+ "kind": "value",
+ "name": "everyU",
+ "docstrings": [],
+ "signature": "let everyU: (t, value => bool) => bool"
+ },
+ {
+ "id": "Belt.Set.String.every",
+ "kind": "value",
+ "name": "every",
+ "docstrings": [
+ "`every(p, s)` checks if all elements of the set satisfy the predicate `p`. Order\nunspecified."
+ ],
+ "signature": "let every: (t, value => bool) => bool"
+ },
+ {
+ "id": "Belt.Set.String.someU",
+ "kind": "value",
+ "name": "someU",
+ "docstrings": [],
+ "signature": "let someU: (t, value => bool) => bool"
+ },
+ {
+ "id": "Belt.Set.String.some",
+ "kind": "value",
+ "name": "some",
+ "docstrings": [
+ "`some(p, s)` checks if at least one element of the set satisfies the predicate\n`p`. Oder unspecified."
+ ],
+ "signature": "let some: (t, value => bool) => bool"
+ },
+ {
+ "id": "Belt.Set.String.keepU",
+ "kind": "value",
+ "name": "keepU",
+ "docstrings": [],
+ "signature": "let keepU: (t, value => bool) => t"
+ },
+ {
+ "id": "Belt.Set.String.keep",
+ "kind": "value",
+ "name": "keep",
+ "docstrings": [
+ "`keep(p, s)` returns the set of all elements in `s` that satisfy predicate `p`."
+ ],
+ "signature": "let keep: (t, value => bool) => t"
+ },
+ {
+ "id": "Belt.Set.String.partitionU",
+ "kind": "value",
+ "name": "partitionU",
+ "docstrings": [],
+ "signature": "let partitionU: (t, value => bool) => (t, t)"
+ },
+ {
+ "id": "Belt.Set.String.partition",
+ "kind": "value",
+ "name": "partition",
+ "docstrings": [
+ "`partition(p, s)` returns a pair of sets `(s1, s2)`, where `s1` is the set of\nall the elements of `s` that satisfy the predicate `p`, and `s2` is the set of\nall the elements of `s` that do not satisfy `p`."
+ ],
+ "signature": "let partition: (t, value => bool) => (t, t)"
+ },
+ {
+ "id": "Belt.Set.String.size",
+ "kind": "value",
+ "name": "size",
+ "docstrings": [],
+ "signature": "let size: t => int"
+ },
+ {
+ "id": "Belt.Set.String.toList",
+ "kind": "value",
+ "name": "toList",
+ "docstrings": ["In increasing order"],
+ "signature": "let toList: t => list"
+ },
+ {
+ "id": "Belt.Set.String.toArray",
+ "kind": "value",
+ "name": "toArray",
+ "docstrings": [],
+ "signature": "let toArray: t => array"
+ },
+ {
+ "id": "Belt.Set.String.minimum",
+ "kind": "value",
+ "name": "minimum",
+ "docstrings": [],
+ "signature": "let minimum: t => option"
+ },
+ {
+ "id": "Belt.Set.String.minUndefined",
+ "kind": "value",
+ "name": "minUndefined",
+ "docstrings": [],
+ "signature": "let minUndefined: t => Js.undefined"
+ },
+ {
+ "id": "Belt.Set.String.maximum",
+ "kind": "value",
+ "name": "maximum",
+ "docstrings": [],
+ "signature": "let maximum: t => option"
+ },
+ {
+ "id": "Belt.Set.String.maxUndefined",
+ "kind": "value",
+ "name": "maxUndefined",
+ "docstrings": [],
+ "signature": "let maxUndefined: t => Js.undefined"
+ },
+ {
+ "id": "Belt.Set.String.get",
+ "kind": "value",
+ "name": "get",
+ "docstrings": [],
+ "signature": "let get: (t, value) => option"
+ },
+ {
+ "id": "Belt.Set.String.getUndefined",
+ "kind": "value",
+ "name": "getUndefined",
+ "docstrings": [],
+ "signature": "let getUndefined: (t, value) => Js.undefined"
+ },
+ {
+ "id": "Belt.Set.String.getExn",
+ "kind": "value",
+ "name": "getExn",
+ "docstrings": [],
+ "signature": "let getExn: (t, value) => value"
+ },
+ {
+ "id": "Belt.Set.String.split",
+ "kind": "value",
+ "name": "split",
+ "docstrings": [
+ "`split(x, s)` returns a triple `(l, present, r)`, where `l` is the set of\nelements of `s` that are strictly less than `x`;`r` is the set of elements of\n`s` that are strictly greater than `x`; `present` is `false` if `s` contains no\nelement equal to `x`, or `true` if `s` contains an element equal to `x`."
+ ],
+ "signature": "let split: (t, value) => ((t, t), bool)"
+ },
+ {
+ "id": "Belt.Set.String.checkInvariantInternal",
+ "kind": "value",
+ "name": "checkInvariantInternal",
+ "docstrings": ["**raise** when invariant is not held"],
+ "signature": "let checkInvariantInternal: t => unit"
+ }
+ ]
+ },
+ "belt/set/int": {
+ "id": "Belt.Set.Int",
+ "name": "Int",
+ "docstrings": [
+ "Specialized when value type is `int`, more efficient than the generic type, its\ncompare behavior is fixed using the built-in comparison",
+ "This module is [`Belt.Set`]() specialized with value type to be a primitive type.\n It is more efficient in general, the API is the same with [`Belt_Set`]() except its value type is fixed,\n and identity is not needed(using the built-in one)\n\n **See** [`Belt.Set`]()"
+ ],
+ "items": [
+ {
+ "id": "Belt.Set.Int.value",
+ "kind": "type",
+ "name": "value",
+ "docstrings": ["The type of the set elements."],
+ "signature": "type value = int"
+ },
+ {
+ "id": "Belt.Set.Int.t",
+ "kind": "type",
+ "name": "t",
+ "docstrings": ["The type of sets."],
+ "signature": "type t"
+ },
+ {
+ "id": "Belt.Set.Int.empty",
+ "kind": "value",
+ "name": "empty",
+ "docstrings": [],
+ "signature": "let empty: t"
+ },
+ {
+ "id": "Belt.Set.Int.fromArray",
+ "kind": "value",
+ "name": "fromArray",
+ "docstrings": [],
+ "signature": "let fromArray: array => t"
+ },
+ {
+ "id": "Belt.Set.Int.fromSortedArrayUnsafe",
+ "kind": "value",
+ "name": "fromSortedArrayUnsafe",
+ "docstrings": [],
+ "signature": "let fromSortedArrayUnsafe: array => t"
+ },
+ {
+ "id": "Belt.Set.Int.isEmpty",
+ "kind": "value",
+ "name": "isEmpty",
+ "docstrings": [],
+ "signature": "let isEmpty: t => bool"
+ },
+ {
+ "id": "Belt.Set.Int.has",
+ "kind": "value",
+ "name": "has",
+ "docstrings": [],
+ "signature": "let has: (t, value) => bool"
+ },
+ {
+ "id": "Belt.Set.Int.add",
+ "kind": "value",
+ "name": "add",
+ "docstrings": [
+ "`add(s, x)` If `x` was already in `s`, `s` is returned unchanged."
+ ],
+ "signature": "let add: (t, value) => t"
+ },
+ {
+ "id": "Belt.Set.Int.mergeMany",
+ "kind": "value",
+ "name": "mergeMany",
+ "docstrings": [],
+ "signature": "let mergeMany: (t, array) => t"
+ },
+ {
+ "id": "Belt.Set.Int.remove",
+ "kind": "value",
+ "name": "remove",
+ "docstrings": [
+ "`remove(m, x)` If `x` was not in `m`, `m` is returned reference unchanged."
+ ],
+ "signature": "let remove: (t, value) => t"
+ },
+ {
+ "id": "Belt.Set.Int.removeMany",
+ "kind": "value",
+ "name": "removeMany",
+ "docstrings": [],
+ "signature": "let removeMany: (t, array) => t"
+ },
+ {
+ "id": "Belt.Set.Int.union",
+ "kind": "value",
+ "name": "union",
+ "docstrings": [],
+ "signature": "let union: (t, t) => t"
+ },
+ {
+ "id": "Belt.Set.Int.intersect",
+ "kind": "value",
+ "name": "intersect",
+ "docstrings": [],
+ "signature": "let intersect: (t, t) => t"
+ },
+ {
+ "id": "Belt.Set.Int.diff",
+ "kind": "value",
+ "name": "diff",
+ "docstrings": [],
+ "signature": "let diff: (t, t) => t"
+ },
+ {
+ "id": "Belt.Set.Int.subset",
+ "kind": "value",
+ "name": "subset",
+ "docstrings": [
+ "`subset(s1, s2)` tests whether the set `s1` is a subset of the set `s2`."
+ ],
+ "signature": "let subset: (t, t) => bool"
+ },
+ {
+ "id": "Belt.Set.Int.cmp",
+ "kind": "value",
+ "name": "cmp",
+ "docstrings": [
+ "Total ordering between sets. Can be used as the ordering function for doing sets\nof sets."
+ ],
+ "signature": "let cmp: (t, t) => int"
+ },
+ {
+ "id": "Belt.Set.Int.eq",
+ "kind": "value",
+ "name": "eq",
+ "docstrings": [
+ "`eq(s1, s2)` tests whether the sets `s1` and `s2` are equal, that is, contain\nequal elements."
+ ],
+ "signature": "let eq: (t, t) => bool"
+ },
+ {
+ "id": "Belt.Set.Int.forEachU",
+ "kind": "value",
+ "name": "forEachU",
+ "docstrings": [],
+ "signature": "let forEachU: (t, value => unit) => unit"
+ },
+ {
+ "id": "Belt.Set.Int.forEach",
+ "kind": "value",
+ "name": "forEach",
+ "docstrings": [
+ "`forEach(s, f)` applies `f` in turn to all elements of `s`. In increasing order"
+ ],
+ "signature": "let forEach: (t, value => unit) => unit"
+ },
+ {
+ "id": "Belt.Set.Int.reduceU",
+ "kind": "value",
+ "name": "reduceU",
+ "docstrings": [],
+ "signature": "let reduceU: (t, 'a, ('a, value) => 'a) => 'a"
+ },
+ {
+ "id": "Belt.Set.Int.reduce",
+ "kind": "value",
+ "name": "reduce",
+ "docstrings": ["Iterate in increasing order."],
+ "signature": "let reduce: (t, 'a, ('a, value) => 'a) => 'a"
+ },
+ {
+ "id": "Belt.Set.Int.everyU",
+ "kind": "value",
+ "name": "everyU",
+ "docstrings": [],
+ "signature": "let everyU: (t, value => bool) => bool"
+ },
+ {
+ "id": "Belt.Set.Int.every",
+ "kind": "value",
+ "name": "every",
+ "docstrings": [
+ "`every(p, s)` checks if all elements of the set satisfy the predicate `p`. Order\nunspecified."
+ ],
+ "signature": "let every: (t, value => bool) => bool"
+ },
+ {
+ "id": "Belt.Set.Int.someU",
+ "kind": "value",
+ "name": "someU",
+ "docstrings": [],
+ "signature": "let someU: (t, value => bool) => bool"
+ },
+ {
+ "id": "Belt.Set.Int.some",
+ "kind": "value",
+ "name": "some",
+ "docstrings": [
+ "`some(p, s)` checks if at least one element of the set satisfies the predicate\n`p`. Oder unspecified."
+ ],
+ "signature": "let some: (t, value => bool) => bool"
+ },
+ {
+ "id": "Belt.Set.Int.keepU",
+ "kind": "value",
+ "name": "keepU",
+ "docstrings": [],
+ "signature": "let keepU: (t, value => bool) => t"
+ },
+ {
+ "id": "Belt.Set.Int.keep",
+ "kind": "value",
+ "name": "keep",
+ "docstrings": [
+ "`keep(p, s)` returns the set of all elements in `s` that satisfy predicate `p`."
+ ],
+ "signature": "let keep: (t, value => bool) => t"
+ },
+ {
+ "id": "Belt.Set.Int.partitionU",
+ "kind": "value",
+ "name": "partitionU",
+ "docstrings": [],
+ "signature": "let partitionU: (t, value => bool) => (t, t)"
+ },
+ {
+ "id": "Belt.Set.Int.partition",
+ "kind": "value",
+ "name": "partition",
+ "docstrings": [
+ "`partition(p, s)` returns a pair of sets `(s1, s2)`, where `s1` is the set of\nall the elements of `s` that satisfy the predicate `p`, and `s2` is the set of\nall the elements of `s` that do not satisfy `p`."
+ ],
+ "signature": "let partition: (t, value => bool) => (t, t)"
+ },
+ {
+ "id": "Belt.Set.Int.size",
+ "kind": "value",
+ "name": "size",
+ "docstrings": [],
+ "signature": "let size: t => int"
+ },
+ {
+ "id": "Belt.Set.Int.toList",
+ "kind": "value",
+ "name": "toList",
+ "docstrings": ["In increasing order"],
+ "signature": "let toList: t => list"
+ },
+ {
+ "id": "Belt.Set.Int.toArray",
+ "kind": "value",
+ "name": "toArray",
+ "docstrings": [],
+ "signature": "let toArray: t => array"
+ },
+ {
+ "id": "Belt.Set.Int.minimum",
+ "kind": "value",
+ "name": "minimum",
+ "docstrings": [],
+ "signature": "let minimum: t => option"
+ },
+ {
+ "id": "Belt.Set.Int.minUndefined",
+ "kind": "value",
+ "name": "minUndefined",
+ "docstrings": [],
+ "signature": "let minUndefined: t => Js.undefined"
+ },
+ {
+ "id": "Belt.Set.Int.maximum",
+ "kind": "value",
+ "name": "maximum",
+ "docstrings": [],
+ "signature": "let maximum: t => option"
+ },
+ {
+ "id": "Belt.Set.Int.maxUndefined",
+ "kind": "value",
+ "name": "maxUndefined",
+ "docstrings": [],
+ "signature": "let maxUndefined: t => Js.undefined"
+ },
+ {
+ "id": "Belt.Set.Int.get",
+ "kind": "value",
+ "name": "get",
+ "docstrings": [],
+ "signature": "let get: (t, value) => option"
+ },
+ {
+ "id": "Belt.Set.Int.getUndefined",
+ "kind": "value",
+ "name": "getUndefined",
+ "docstrings": [],
+ "signature": "let getUndefined: (t, value) => Js.undefined"
+ },
+ {
+ "id": "Belt.Set.Int.getExn",
+ "kind": "value",
+ "name": "getExn",
+ "docstrings": [],
+ "signature": "let getExn: (t, value) => value"
+ },
+ {
+ "id": "Belt.Set.Int.split",
+ "kind": "value",
+ "name": "split",
+ "docstrings": [
+ "`split(x, s)` returns a triple `(l, present, r)`, where `l` is the set of\nelements of `s` that are strictly less than `x`;`r` is the set of elements of\n`s` that are strictly greater than `x`; `present` is `false` if `s` contains no\nelement equal to `x`, or `true` if `s` contains an element equal to `x`."
+ ],
+ "signature": "let split: (t, value) => ((t, t), bool)"
+ },
+ {
+ "id": "Belt.Set.Int.checkInvariantInternal",
+ "kind": "value",
+ "name": "checkInvariantInternal",
+ "docstrings": ["**raise** when invariant is not held"],
+ "signature": "let checkInvariantInternal: t => unit"
+ }
+ ]
+ },
+ "belt/sortarray/string": {
+ "id": "Belt.SortArray.String",
+ "name": "String",
+ "docstrings": [
+ "Specalized when key type is `string`, more efficient than the generic type",
+ "This is a specialized module for [`Belt_SortArray`](), the docs in that module also\napplies here, except the comparator is fixed and inlined"
+ ],
+ "items": [
+ {
+ "id": "Belt.SortArray.String.element",
+ "kind": "type",
+ "name": "element",
+ "docstrings": [],
+ "signature": "type element = string"
+ },
+ {
+ "id": "Belt.SortArray.String.strictlySortedLength",
+ "kind": "value",
+ "name": "strictlySortedLength",
+ "docstrings": [
+ "The same as [`Belt_SortArray.strictlySortedLength`]() except the comparator is fixed\n\n**return** `+n` means increasing order `-n` means negative order"
+ ],
+ "signature": "let strictlySortedLength: array => int"
+ },
+ {
+ "id": "Belt.SortArray.String.isSorted",
+ "kind": "value",
+ "name": "isSorted",
+ "docstrings": [
+ "`sorted(xs)` return true if `xs` is in non strict increasing order"
+ ],
+ "signature": "let isSorted: array => bool"
+ },
+ {
+ "id": "Belt.SortArray.String.stableSortInPlace",
+ "kind": "value",
+ "name": "stableSortInPlace",
+ "docstrings": [
+ "The same as [`Belt_SortArray.stableSortInPlaceBy`]() except the comparator is fixed"
+ ],
+ "signature": "let stableSortInPlace: array => unit"
+ },
+ {
+ "id": "Belt.SortArray.String.stableSort",
+ "kind": "value",
+ "name": "stableSort",
+ "docstrings": [
+ "The same as [`Belt_SortArray.stableSortBy`]() except the comparator is fixed"
+ ],
+ "signature": "let stableSort: array => array"
+ },
+ {
+ "id": "Belt.SortArray.String.binarySearch",
+ "kind": "value",
+ "name": "binarySearch",
+ "docstrings": [
+ "If value is not found and value is less than one or more elements in array,\nthe negative number returned is the bitwise complement of the index of the first element\nthat is larger than value.\n\nIf value is not found and value is greater than all elements in array,\nthe negative number returned is the bitwise complement of\n(the index of the last element plus 1)\n\nfor example, if `key` is smaller than all elements return `-1` since `lnot (-1) = 0`\nif `key` is larger than all elements return `- (len + 1)` since `lnot (-(len+1)) = len`"
+ ],
+ "signature": "let binarySearch: (array, element) => int"
+ },
+ {
+ "id": "Belt.SortArray.String.union",
+ "kind": "value",
+ "name": "union",
+ "docstrings": [
+ "`union(src, src1ofs, src1len, src2, src2ofs, src2len, dst, dstofs, cmp)` assume\n`src` and `src2` is strictly sorted. for equivalent elements, it is picked from\n`src` also assume that `dst` is large enough to store all elements"
+ ],
+ "signature": "let union: (\n array,\n int,\n int,\n array,\n int,\n int,\n array,\n int,\n) => int"
+ },
+ {
+ "id": "Belt.SortArray.String.intersect",
+ "kind": "value",
+ "name": "intersect",
+ "docstrings": [],
+ "signature": "let intersect: (\n array,\n int,\n int,\n array,\n int,\n int,\n array,\n int,\n) => int"
+ },
+ {
+ "id": "Belt.SortArray.String.diff",
+ "kind": "value",
+ "name": "diff",
+ "docstrings": [],
+ "signature": "let diff: (\n array,\n int,\n int,\n array,\n int,\n int,\n array,\n int,\n) => int"
+ }
+ ]
+ },
+ "belt/sortarray/int": {
+ "id": "Belt.SortArray.Int",
+ "name": "Int",
+ "docstrings": [
+ "Specalized when key type is `int`, more efficient than the generic type",
+ "This is a specialized module for [`Belt_SortArray`](), the docs in that module also\napplies here, except the comparator is fixed and inlined"
+ ],
+ "items": [
+ {
+ "id": "Belt.SortArray.Int.element",
+ "kind": "type",
+ "name": "element",
+ "docstrings": [],
+ "signature": "type element = int"
+ },
+ {
+ "id": "Belt.SortArray.Int.strictlySortedLength",
+ "kind": "value",
+ "name": "strictlySortedLength",
+ "docstrings": [
+ "The same as [`Belt_SortArray.strictlySortedLength`]() except the comparator is fixed\n\n**return** `+n` means increasing order `-n` means negative order"
+ ],
+ "signature": "let strictlySortedLength: array => int"
+ },
+ {
+ "id": "Belt.SortArray.Int.isSorted",
+ "kind": "value",
+ "name": "isSorted",
+ "docstrings": [
+ "`sorted(xs)` return true if `xs` is in non strict increasing order"
+ ],
+ "signature": "let isSorted: array => bool"
+ },
+ {
+ "id": "Belt.SortArray.Int.stableSortInPlace",
+ "kind": "value",
+ "name": "stableSortInPlace",
+ "docstrings": [
+ "The same as [`Belt_SortArray.stableSortInPlaceBy`]() except the comparator is fixed"
+ ],
+ "signature": "let stableSortInPlace: array => unit"
+ },
+ {
+ "id": "Belt.SortArray.Int.stableSort",
+ "kind": "value",
+ "name": "stableSort",
+ "docstrings": [
+ "The same as [`Belt_SortArray.stableSortBy`]() except the comparator is fixed"
+ ],
+ "signature": "let stableSort: array => array"
+ },
+ {
+ "id": "Belt.SortArray.Int.binarySearch",
+ "kind": "value",
+ "name": "binarySearch",
+ "docstrings": [
+ "If value is not found and value is less than one or more elements in array,\nthe negative number returned is the bitwise complement of the index of the first element\nthat is larger than value.\n\nIf value is not found and value is greater than all elements in array,\nthe negative number returned is the bitwise complement of\n(the index of the last element plus 1)\n\nfor example, if `key` is smaller than all elements return `-1` since `lnot (-1) = 0`\nif `key` is larger than all elements return `- (len + 1)` since `lnot (-(len+1)) = len`"
+ ],
+ "signature": "let binarySearch: (array, element) => int"
+ },
+ {
+ "id": "Belt.SortArray.Int.union",
+ "kind": "value",
+ "name": "union",
+ "docstrings": [
+ "`union(src, src1ofs, src1len, src2, src2ofs, src2len, dst, dstofs, cmp)` assume\n`src` and `src2` is strictly sorted. for equivalent elements, it is picked from\n`src` also assume that `dst` is large enough to store all elements"
+ ],
+ "signature": "let union: (\n array,\n int,\n int,\n array,\n int,\n int,\n array,\n int,\n) => int"
+ },
+ {
+ "id": "Belt.SortArray.Int.intersect",
+ "kind": "value",
+ "name": "intersect",
+ "docstrings": [],
+ "signature": "let intersect: (\n array,\n int,\n int,\n array,\n int,\n int,\n array,\n int,\n) => int"
+ },
+ {
+ "id": "Belt.SortArray.Int.diff",
+ "kind": "value",
+ "name": "diff",
+ "docstrings": [],
+ "signature": "let diff: (\n array,\n int,\n int,\n array,\n int,\n int,\n array,\n int,\n) => int"
+ }
+ ]
+ },
+ "belt/id/makehashable": {
+ "id": "Belt.Id.MakeHashable",
+ "name": "MakeHashable",
+ "docstrings": [],
+ "items": [
+ {
+ "id": "Belt.Id.MakeHashable.identity",
+ "kind": "type",
+ "name": "identity",
+ "docstrings": [],
+ "signature": "type identity"
+ },
+ {
+ "id": "Belt.Id.MakeHashable.t",
+ "kind": "type",
+ "name": "t",
+ "docstrings": [],
+ "signature": "type t = M.t"
+ },
+ {
+ "id": "Belt.Id.MakeHashable.hash",
+ "kind": "value",
+ "name": "hash",
+ "docstrings": [],
+ "signature": "let hash: hash"
+ },
+ {
+ "id": "Belt.Id.MakeHashable.eq",
+ "kind": "value",
+ "name": "eq",
+ "docstrings": [],
+ "signature": "let eq: eq"
+ }
+ ]
+ },
+ "belt/id/makehashableu": {
+ "id": "Belt.Id.MakeHashableU",
+ "name": "MakeHashableU",
+ "docstrings": [],
+ "items": [
+ {
+ "id": "Belt.Id.MakeHashableU.identity",
+ "kind": "type",
+ "name": "identity",
+ "docstrings": [],
+ "signature": "type identity"
+ },
+ {
+ "id": "Belt.Id.MakeHashableU.t",
+ "kind": "type",
+ "name": "t",
+ "docstrings": [],
+ "signature": "type t = M.t"
+ },
+ {
+ "id": "Belt.Id.MakeHashableU.hash",
+ "kind": "value",
+ "name": "hash",
+ "docstrings": [],
+ "signature": "let hash: hash"
+ },
+ {
+ "id": "Belt.Id.MakeHashableU.eq",
+ "kind": "value",
+ "name": "eq",
+ "docstrings": [],
+ "signature": "let eq: eq"
+ }
+ ]
+ },
+ "belt/id/makecomparable": {
+ "id": "Belt.Id.MakeComparable",
+ "name": "MakeComparable",
+ "docstrings": [],
+ "items": [
+ {
+ "id": "Belt.Id.MakeComparable.identity",
+ "kind": "type",
+ "name": "identity",
+ "docstrings": [],
+ "signature": "type identity"
+ },
+ {
+ "id": "Belt.Id.MakeComparable.t",
+ "kind": "type",
+ "name": "t",
+ "docstrings": [],
+ "signature": "type t = M.t"
+ },
+ {
+ "id": "Belt.Id.MakeComparable.cmp",
+ "kind": "value",
+ "name": "cmp",
+ "docstrings": [],
+ "signature": "let cmp: cmp"
+ }
+ ]
+ },
+ "belt/id/makecomparableu": {
+ "id": "Belt.Id.MakeComparableU",
+ "name": "MakeComparableU",
+ "docstrings": [],
+ "items": [
+ {
+ "id": "Belt.Id.MakeComparableU.identity",
+ "kind": "type",
+ "name": "identity",
+ "docstrings": [],
+ "signature": "type identity"
+ },
+ {
+ "id": "Belt.Id.MakeComparableU.t",
+ "kind": "type",
+ "name": "t",
+ "docstrings": [],
+ "signature": "type t = M.t"
+ },
+ {
+ "id": "Belt.Id.MakeComparableU.cmp",
+ "kind": "value",
+ "name": "cmp",
+ "docstrings": [],
+ "signature": "let cmp: cmp"
+ }
+ ]
+ },
+ "belt/float": {
+ "id": "Belt.Float",
+ "name": "Float",
+ "docstrings": [
+ "[`Belt.Float`]()\n\n Utilities for Float.",
+ "This module includes convenience methods for handling `float` types."
+ ],
+ "items": [
+ {
+ "id": "Belt.Float.toInt",
+ "kind": "value",
+ "name": "toInt",
+ "docstrings": [
+ "Converts a given `float` to an `int`.\n\n## Examples\n\n```rescript\nJs.log(Belt.Float.toInt(1.0) === 1) /* true */\n```"
+ ],
+ "signature": "let toInt: float => int"
+ },
+ {
+ "id": "Belt.Float.fromInt",
+ "kind": "value",
+ "name": "fromInt",
+ "docstrings": [
+ "Converts a given `int` to a `float`.\n\n## Examples\n\n```rescript\nJs.log(Belt.Float.fromInt(1) === 1.0) /* true */\n```"
+ ],
+ "signature": "let fromInt: int => float"
+ },
+ {
+ "id": "Belt.Float.fromString",
+ "kind": "value",
+ "name": "fromString",
+ "docstrings": [
+ "Converts a given `string` to a `float`. Returns `Some(float)` when the input is a number, `None` otherwise.\n\n## Examples\n\n```rescript\nJs.log(Belt.Float.fromString(\"1.0\") === Some(1.0)) /* true */\n```"
+ ],
+ "signature": "let fromString: string => option"
+ },
+ {
+ "id": "Belt.Float.toString",
+ "kind": "value",
+ "name": "toString",
+ "docstrings": [
+ "Converts a given `float` to a `string`. Uses the JavaScript `String` constructor under the hood.\n\n## Examples\n\n```rescript\nJs.log(Belt.Float.toString(1.0) === \"1.0\") /* true */\n```"
+ ],
+ "signature": "let toString: float => string"
+ },
+ {
+ "id": "Belt.Float.+",
+ "kind": "value",
+ "name": "+",
+ "docstrings": [
+ "Addition of two `float` values.\nCan be opened in a module to avoid dot-notation (`+.`), however this yields a shadow warning (Warning number 44) in the default configuration.\n\n## Examples\n\n```rescript\nopen Belt.Float\nJs.log(2.0 + 2.0 === 4.0) /* true */\n```"
+ ],
+ "signature": "let +: (float, float) => float"
+ },
+ {
+ "id": "Belt.Float.-",
+ "kind": "value",
+ "name": "-",
+ "docstrings": [
+ "Subtraction of two `float` values.\nCan be opened in a module to avoid dot-notation (`-.`), however this yields a shadow warning (Warning number 44) in the default configuration.\n\n## Examples\n\n```rescript\nopen Belt.Float\nJs.log(2.0 - 1.0 === 1.0) /* true */\n```"
+ ],
+ "signature": "let -: (float, float) => float"
+ },
+ {
+ "id": "Belt.Float.*",
+ "kind": "value",
+ "name": "*",
+ "docstrings": [
+ "Multiplication of two `float` values.\nCan be opened in a module to avoid dot-notation (`*.`), however this yields a shadow warning (Warning number 44) in the default configuration.\n\n## Examples\n\n```rescript\nopen Belt.Float\nJs.log(2.0 * 2.0 === 4.0) /* true */\n```"
+ ],
+ "signature": "let *: (float, float) => float"
+ },
+ {
+ "id": "Belt.Float./",
+ "kind": "value",
+ "name": "/",
+ "docstrings": [
+ "Division of two `float` values.\nCan be opened in a module to avoid dot-notation (`/.`), however this yields a shadow warning (Warning number 44) in the default configuration.\n\n## Examples\n\n```rescript\nopen Belt.Float\nJs.log(4.0 / 2.0 === 2.0) /* true */\n```"
+ ],
+ "signature": "let /: (float, float) => float"
+ }
+ ]
+ },
+ "belt/int": {
+ "id": "Belt.Int",
+ "name": "Int",
+ "docstrings": [
+ "[`Belt.Int`]()\n\n Utilities for Int.",
+ "This module includes convenience methods for handling `int` types."
+ ],
+ "items": [
+ {
+ "id": "Belt.Int.toFloat",
+ "kind": "value",
+ "name": "toFloat",
+ "docstrings": [
+ "Converts a given `int` to a `float`.\n\n## Examples\n\n```rescript\nJs.log(Belt.Int.toFloat(1) === 1.0) /* true */\n```"
+ ],
+ "signature": "let toFloat: int => float"
+ },
+ {
+ "id": "Belt.Int.fromFloat",
+ "kind": "value",
+ "name": "fromFloat",
+ "docstrings": [
+ "Converts a given `float` to an `int`.\n\n## Examples\n\n```rescript\nJs.log(Belt.Int.fromFloat(1.0) === 1) /* true */\n```"
+ ],
+ "signature": "let fromFloat: float => int"
+ },
+ {
+ "id": "Belt.Int.fromString",
+ "kind": "value",
+ "name": "fromString",
+ "docstrings": [
+ "Converts a given `string` to an `int`. Returns `Some(int)` when the input is a number, `None` otherwise.\n\n## Examples\n\n```rescript\nJs.log(Belt.Int.fromString(\"1\") === Some(1)) /* true */\n```"
+ ],
+ "signature": "let fromString: string => option"
+ },
+ {
+ "id": "Belt.Int.toString",
+ "kind": "value",
+ "name": "toString",
+ "docstrings": [
+ "Converts a given `int` to a `string`. Uses the JavaScript `String` constructor under the hood.\n\n## Examples\n\n```rescript\nJs.log(Belt.Int.toString(1) === \"1\") /* true */\n```"
+ ],
+ "signature": "let toString: int => string"
+ },
+ {
+ "id": "Belt.Int.+",
+ "kind": "value",
+ "name": "+",
+ "docstrings": [
+ "Addition of two `int` values. Same as the addition from `Pervasives`.\n\n## Examples\n\n```rescript\nopen Belt.Int\nJs.log(2 + 2 === 4) /* true */\n```"
+ ],
+ "signature": "let +: (int, int) => int"
+ },
+ {
+ "id": "Belt.Int.-",
+ "kind": "value",
+ "name": "-",
+ "docstrings": [
+ "Subtraction of two `int` values. Same as the subtraction from `Pervasives`.\n\n## Examples\n\n```rescript\nopen Belt.Int\nJs.log(2 - 1 === 1) /* true */\n```"
+ ],
+ "signature": "let -: (int, int) => int"
+ },
+ {
+ "id": "Belt.Int.*",
+ "kind": "value",
+ "name": "*",
+ "docstrings": [
+ "Multiplication of two `int` values. Same as the multiplication from `Pervasives`.\n\n## Examples\n\n```rescript\nopen Belt.Int\nJs.log(2 * 2 === 4) /* true */\n```"
+ ],
+ "signature": "let *: (int, int) => int"
+ },
+ {
+ "id": "Belt.Int./",
+ "kind": "value",
+ "name": "/",
+ "docstrings": [
+ "Division of two `int` values. Same as the division from `Pervasives`.\n\n## Examples\n\n```rescript\nopen Belt.Int\nJs.log(4 / 2 === 2); /* true */\n```"
+ ],
+ "signature": "let /: (int, int) => int"
+ }
+ ]
+ },
+ "belt/result": {
+ "id": "Belt.Result",
+ "name": "Result",
+ "docstrings": [
+ "[`Belt.Result`]()\n\n Utilities for result data type.",
+ "Result types are really useful to describe the result of a certain operation\nwithout relying on exceptions or `option` types.\n\nThis module gives you useful utilities to create and combine `Result` data."
+ ],
+ "items": [
+ {
+ "id": "Belt.Result.t",
+ "kind": "type",
+ "name": "t",
+ "docstrings": [],
+ "signature": "type t<'a, 'b> = result<'a, 'b> = Ok('a) | Error('b)"
+ },
+ {
+ "id": "Belt.Result.getExn",
+ "kind": "value",
+ "name": "getExn",
+ "docstrings": [
+ "`getExn(res)`: when `res` is `Ok(n)`, returns `n` when `res` is `Error(m)`, raise an exception\n\n## Examples\n\n```rescript\nBelt.Result.getExn(Belt.Result.Ok(42)) == 42\n\nBelt.Result.getExn(Belt.Result.Error(\"Invalid data\")) /* raises exception */\n```"
+ ],
+ "signature": "let getExn: t<'a, 'b> => 'a"
+ },
+ {
+ "id": "Belt.Result.mapWithDefaultU",
+ "kind": "value",
+ "name": "mapWithDefaultU",
+ "docstrings": [],
+ "signature": "let mapWithDefaultU: (t<'a, 'c>, 'b, 'a => 'b) => 'b"
+ },
+ {
+ "id": "Belt.Result.mapWithDefault",
+ "kind": "value",
+ "name": "mapWithDefault",
+ "docstrings": [
+ "`mapWithDefault(res, default, f)`: When res is `Ok(n)`, returns `f(n)`,\notherwise `default`.\n\n## Examples\n\n```rescript\nlet ok = Belt.Result.Ok(42)\nBelt.Result.mapWithDefault(ok, 0, (x) => x / 2) == 21\n\nlet error = Belt.Result.Error(\"Invalid data\")\nBelt.Result.mapWithDefault(error, 0, (x) => x / 2) == 0\n```"
+ ],
+ "signature": "let mapWithDefault: (t<'a, 'c>, 'b, 'a => 'b) => 'b"
+ },
+ {
+ "id": "Belt.Result.mapU",
+ "kind": "value",
+ "name": "mapU",
+ "docstrings": [],
+ "signature": "let mapU: (t<'a, 'c>, 'a => 'b) => t<'b, 'c>"
+ },
+ {
+ "id": "Belt.Result.map",
+ "kind": "value",
+ "name": "map",
+ "docstrings": [
+ "`map(res, f)`: When res is `Ok(n)`, returns `Ok(f(n))`. Otherwise returns res\nunchanged. Function `f` takes a value of the same type as `n` and returns an\nordinary value.\n\n## Examples\n\n```rescript\nlet f = (x) => sqrt(Belt.Int.toFloat(x))\n\nBelt.Result.map(Ok(64), f) == Ok(8.0)\n\nBelt.Result.map(Error(\"Invalid data\"), f) == Error(\"Invalid data\")\n```"
+ ],
+ "signature": "let map: (t<'a, 'c>, 'a => 'b) => t<'b, 'c>"
+ },
+ {
+ "id": "Belt.Result.flatMapU",
+ "kind": "value",
+ "name": "flatMapU",
+ "docstrings": [],
+ "signature": "let flatMapU: (t<'a, 'c>, 'a => t<'b, 'c>) => t<'b, 'c>"
+ },
+ {
+ "id": "Belt.Result.flatMap",
+ "kind": "value",
+ "name": "flatMap",
+ "docstrings": [
+ "`flatMap(res, f)`: When res is `Ok(n)`, returns `f(n)`. Otherwise, returns res\nunchanged. Function `f` takes a value of the same type as `n` and returns a\n`Belt.Result`.\n\n## Examples\n\n```rescript\nlet recip = (x) =>\n if (x !== 0.0) {\n Belt.Result.Ok(1.0 /. x)\n } else {\n Belt.Result.Error(\"Divide by zero\")\n }\n\nBelt.Result.flatMap(Ok(2.0), recip) == Ok(0.5)\n\nBelt.Result.flatMap(Ok(0.0), recip) == Error(\"Divide by zero\")\n\nBelt.Result.flatMap(Error(\"Already bad\"), recip) == Error(\"Already bad\")\n```"
+ ],
+ "signature": "let flatMap: (t<'a, 'c>, 'a => t<'b, 'c>) => t<'b, 'c>"
+ },
+ {
+ "id": "Belt.Result.getWithDefault",
+ "kind": "value",
+ "name": "getWithDefault",
+ "docstrings": [
+ "`getWithDefault(res, defaultValue)`: If `res` is `Ok(n)`, returns `n`,\notherwise `default`\n\n## Examples\n\n```rescript\nBelt.Result.getWithDefault(Ok(42), 0) == 42\n\nBelt.Result.getWithDefault(Error(\"Invalid Data\"), 0) == 0\n```"
+ ],
+ "signature": "let getWithDefault: (t<'a, 'b>, 'a) => 'a"
+ },
+ {
+ "id": "Belt.Result.isOk",
+ "kind": "value",
+ "name": "isOk",
+ "docstrings": [
+ "`isOk(res)`: Returns `true` if `res` is of the form `Ok(n)`, `false` if it is\nthe `Error(e)` variant."
+ ],
+ "signature": "let isOk: t<'a, 'b> => bool"
+ },
+ {
+ "id": "Belt.Result.isError",
+ "kind": "value",
+ "name": "isError",
+ "docstrings": [
+ "`isError(res)`: Returns `true` if `res` is of the form `Error(e)`, `false` if\nit is the `Ok(n)` variant."
+ ],
+ "signature": "let isError: t<'a, 'b> => bool"
+ },
+ {
+ "id": "Belt.Result.eqU",
+ "kind": "value",
+ "name": "eqU",
+ "docstrings": [],
+ "signature": "let eqU: (t<'a, 'c>, t<'b, 'd>, ('a, 'b) => bool) => bool"
+ },
+ {
+ "id": "Belt.Result.eq",
+ "kind": "value",
+ "name": "eq",
+ "docstrings": [
+ "`eq(res1, res2, f)`: Determine if two `Belt.Result` variables are equal with\nrespect to an equality function. If `res1` and `res2` are of the form `Ok(n)`\nand `Ok(m)`, return the result of `f(n, m)`. If one of `res1` and `res2` are of\nthe form `Error(e)`, return false If both `res1` and `res2` are of the form\n`Error(e)`, return true\n\n## Examples\n\n```rescript\nlet good1 = Belt.Result.Ok(42)\n\nlet good2 = Belt.Result.Ok(32)\n\nlet bad1 = Belt.Result.Error(\"invalid\")\n\nlet bad2 = Belt.Result.Error(\"really invalid\")\n\nlet mod10equal = (a, b) => mod(a, 10) === mod(b, 10)\n\nBelt.Result.eq(good1, good2, mod10equal) == true\n\nBelt.Result.eq(good1, bad1, mod10equal) == false\n\nBelt.Result.eq(bad2, good2, mod10equal) == false\n\nBelt.Result.eq(bad1, bad2, mod10equal) == true\n```"
+ ],
+ "signature": "let eq: (t<'a, 'c>, t<'b, 'd>, ('a, 'b) => bool) => bool"
+ },
+ {
+ "id": "Belt.Result.cmpU",
+ "kind": "value",
+ "name": "cmpU",
+ "docstrings": [],
+ "signature": "let cmpU: (t<'a, 'c>, t<'b, 'd>, ('a, 'b) => int) => int"
+ },
+ {
+ "id": "Belt.Result.cmp",
+ "kind": "value",
+ "name": "cmp",
+ "docstrings": [
+ "`cmp(res1, res2, f)`: Compare two `Belt.Result` variables with respect to a\ncomparison function. The comparison function returns -1 if the first variable\nis \"less than\" the second, 0 if the two variables are equal, and 1 if the first\nis \"greater than\" the second.\n\nIf `res1` and `res2` are of the form `Ok(n)` and `Ok(m)`, return the result of\n`f(n, m)`. If `res1` is of the form `Error(e)` and `res2` of the form `Ok(n)`,\nreturn -1 (nothing is less than something) If `res1` is of the form `Ok(n)` and\n`res2` of the form `Error(e)`, return 1 (something is greater than nothing) If\nboth `res1` and `res2` are of the form `Error(e)`, return 0 (equal)\n\n## Examples\n\n```rescript\nlet good1 = Belt.Result.Ok(59)\n\nlet good2 = Belt.Result.Ok(37)\n\nlet bad1 = Belt.Result.Error(\"invalid\")\n\nlet bad2 = Belt.Result.Error(\"really invalid\")\n\nlet mod10cmp = (a, b) => Pervasives.compare(mod(a, 10), mod(b, 10))\n\nBelt.Result.cmp(Ok(39), Ok(57), mod10cmp) == 1\n\nBelt.Result.cmp(Ok(57), Ok(39), mod10cmp) == (-1)\n\nBelt.Result.cmp(Ok(39), Error(\"y\"), mod10cmp) == 1\n\nBelt.Result.cmp(Error(\"x\"), Ok(57), mod10cmp) == (-1)\n\nBelt.Result.cmp(Error(\"x\"), Error(\"y\"), mod10cmp) == 0\n```"
+ ],
+ "signature": "let cmp: (t<'a, 'c>, t<'b, 'd>, ('a, 'b) => int) => int"
+ }
+ ]
+ },
+ "belt/option": {
+ "id": "Belt.Option",
+ "name": "Option",
+ "docstrings": [
+ "[`Belt.Option`]()\n\n Utilities for option data type.",
+ "In Belt we represent the existence and nonexistence of a value by wrapping it\nwith the `option` type. In order to make it a bit more convenient to work with\noption-types, Belt provides utility-functions for it.\n\nThe `option` type is a part of the ReScript standard library which is defined like this:\n\n## Examples\n\n```rescript\ntype option<'a> = None | Some('a)\n```\n\n```rescript\nlet someString: option = Some(\"hello\")\n```"
+ ],
+ "items": [
+ {
+ "id": "Belt.Option.keepU",
+ "kind": "value",
+ "name": "keepU",
+ "docstrings": ["Uncurried version of `keep`"],
+ "signature": "let keepU: (option<'a>, 'a => bool) => option<'a>"
+ },
+ {
+ "id": "Belt.Option.keep",
+ "kind": "value",
+ "name": "keep",
+ "docstrings": [
+ "If `optionValue` is `Some(value)` and `p(value) = true`, it returns `Some(value)`; otherwise returns `None`\n\n## Examples\n\n```rescript\nBelt.Option.keep(Some(10), x => x > 5) /* returns `Some(10)` */\nBelt.Option.keep(Some(4), x => x > 5) /* returns `None` */\nBelt.Option.keep(None, x => x > 5) /* returns `None` */\n```"
+ ],
+ "signature": "let keep: (option<'a>, 'a => bool) => option<'a>"
+ },
+ {
+ "id": "Belt.Option.forEachU",
+ "kind": "value",
+ "name": "forEachU",
+ "docstrings": ["Uncurried version of `forEach`"],
+ "signature": "let forEachU: (option<'a>, 'a => unit) => unit"
+ },
+ {
+ "id": "Belt.Option.forEach",
+ "kind": "value",
+ "name": "forEach",
+ "docstrings": [
+ "If `optionValue` is `Some(value`), it calls `f(value)`; otherwise returns `()`\n\n## Examples\n\n```rescript\nBelt.Option.forEach(Some(\"thing\"), x => Js.log(x)) /* logs \"thing\" */\nBelt.Option.forEach(None, x => Js.log(x)) /* returns () */\n```"
+ ],
+ "signature": "let forEach: (option<'a>, 'a => unit) => unit"
+ },
+ {
+ "id": "Belt.Option.getExn",
+ "kind": "value",
+ "name": "getExn",
+ "docstrings": [
+ "Raises an Error in case `None` is provided. Use with care.\n\n## Examples\n\n```rescript\nBelt.Option.getExn(Some(3)) /* 3 */\n\nBelt.Option.getExn(None) /* Raises an Error */\n```"
+ ],
+ "signature": "let getExn: option<'a> => 'a"
+ },
+ {
+ "id": "Belt.Option.getUnsafe",
+ "kind": "value",
+ "name": "getUnsafe",
+ "docstrings": [
+ "`getUnsafe(x)` returns `x`\n\nThis is an unsafe operation, it assumes `x` is neither `None`\nnor `Some(None(...)))`"
+ ],
+ "signature": "let getUnsafe: option<'a> => 'a"
+ },
+ {
+ "id": "Belt.Option.mapWithDefaultU",
+ "kind": "value",
+ "name": "mapWithDefaultU",
+ "docstrings": ["Uncurried version of `mapWithDefault`"],
+ "signature": "let mapWithDefaultU: (option<'a>, 'b, 'a => 'b) => 'b"
+ },
+ {
+ "id": "Belt.Option.mapWithDefault",
+ "kind": "value",
+ "name": "mapWithDefault",
+ "docstrings": [
+ "If `optionValue` is of `Some(value)`,\nthis function returns that value applied with `f`, in other words `f(value)`.\n\nIf `optionValue` is `None`, the default is returned.\n\n## Examples\n\n```rescript\nlet someValue = Some(3)\nsomeValue->Belt.Option.mapWithDefault(0, x => x + 5) /* 8 */\n\nlet noneValue = None\nnoneValue->Belt.Option.mapWithDefault(0, x => x + 5) /* 0 */\n```"
+ ],
+ "signature": "let mapWithDefault: (option<'a>, 'b, 'a => 'b) => 'b"
+ },
+ {
+ "id": "Belt.Option.mapU",
+ "kind": "value",
+ "name": "mapU",
+ "docstrings": ["Uncurried version of `map`"],
+ "signature": "let mapU: (option<'a>, 'a => 'b) => option<'b>"
+ },
+ {
+ "id": "Belt.Option.map",
+ "kind": "value",
+ "name": "map",
+ "docstrings": [
+ "If `optionValue` is `Some(value)` this returns `f(value)`, otherwise it returns `None`.\n\n## Examples\n\n```rescript\nBelt.Option.map(Some(3), x => x * x) /* Some(9) */\n\nBelt.Option.map(None, x => x * x) /* None */\n```"
+ ],
+ "signature": "let map: (option<'a>, 'a => 'b) => option<'b>"
+ },
+ {
+ "id": "Belt.Option.flatMapU",
+ "kind": "value",
+ "name": "flatMapU",
+ "docstrings": ["Uncurried version of `flatMap`"],
+ "signature": "let flatMapU: (option<'a>, 'a => option<'b>) => option<'b>"
+ },
+ {
+ "id": "Belt.Option.flatMap",
+ "kind": "value",
+ "name": "flatMap",
+ "docstrings": [
+ "If `optionValue` is `Some(value)`, returns `f(value)`, otherwise returns\n`None`. \nThe function `f` must have a return type of `option<'b>`.\n\n## Examples\n\n```rescript\nlet addIfAboveOne = value =>\n if (value > 1) {\n Some(value + 1)\n } else {\n None\n }\n\nBelt.Option.flatMap(Some(2), addIfAboveOne) /* Some(3) */\n\nBelt.Option.flatMap(Some(-4), addIfAboveOne) /* None */\n\nBelt.Option.flatMap(None, addIfAboveOne) /* None */\n```"
+ ],
+ "signature": "let flatMap: (option<'a>, 'a => option<'b>) => option<'b>"
+ },
+ {
+ "id": "Belt.Option.getWithDefault",
+ "kind": "value",
+ "name": "getWithDefault",
+ "docstrings": [
+ "If `optionalValue` is `Some(value)`, returns `value`, otherwise default.\n\n## Examples\n\n```rescript\nBelt.Option.getWithDefault(None, \"Banana\") /* Banana */\n\nBelt.Option.getWithDefault(Some(\"Apple\"), \"Banana\") /* Apple */\n```\n\n```rescript\nlet greet = (firstName: option) =>\n \"Greetings \" ++ firstName->Belt.Option.getWithDefault(\"Anonymous\")\n\nSome(\"Jane\")->greet /* \"Greetings Jane\" */\n\nNone->greet /* \"Greetings Anonymous\" */\n```"
+ ],
+ "signature": "let getWithDefault: (option<'a>, 'a) => 'a"
+ },
+ {
+ "id": "Belt.Option.orElse",
+ "kind": "value",
+ "name": "orElse",
+ "docstrings": [
+ "`orElse(optionalValue, otherOptional)` if `optionalValue` is `Some(value)`,\nreturns `Some(value)`, otherwise `otherOptional`\n\n## Examples\n\n```rescript\nBelt.Option.orElse(Some(1812), Some(1066)) == Some(1812)\nBelt.Option.orElse(None, Some(1066)) == Some(1066)\nBelt.Option.orElse(None, None) == None\n```"
+ ],
+ "signature": "let orElse: (option<'a>, option<'a>) => option<'a>"
+ },
+ {
+ "id": "Belt.Option.isSome",
+ "kind": "value",
+ "name": "isSome",
+ "docstrings": [
+ "Returns `true` if the argument is `Some(value)`, `false` otherwise.\n\n## Examples\n\n```rescript\nBelt.Option.isSome(None) /* false */\n\nBelt.Option.isSome(Some(1)) /* true */\n```"
+ ],
+ "signature": "let isSome: option<'a> => bool"
+ },
+ {
+ "id": "Belt.Option.isNone",
+ "kind": "value",
+ "name": "isNone",
+ "docstrings": [
+ "Returns `true` if the argument is `None`, `false` otherwise.\n\n## Examples\n\n```rescript\nBelt.Option.isNone(None) /* true */\n\nBelt.Option.isNone(Some(1)) /* false */\n```"
+ ],
+ "signature": "let isNone: option<'a> => bool"
+ },
+ {
+ "id": "Belt.Option.eqU",
+ "kind": "value",
+ "name": "eqU",
+ "docstrings": ["Uncurried version of `eq`"],
+ "signature": "let eqU: (option<'a>, option<'b>, ('a, 'b) => bool) => bool"
+ },
+ {
+ "id": "Belt.Option.eq",
+ "kind": "value",
+ "name": "eq",
+ "docstrings": [
+ "Evaluates two optional values for equality with respect to a predicate\nfunction. If both `optValue1` and `optValue2` are `None`, returns `true`.\nIf one of the arguments is `Some(value)` and the other is `None`, returns\n`false`.\n\nIf arguments are `Some(value1)` and `Some(value2)`, returns the result of\n`predicate(value1, value2)`; the predicate function must return a bool.\n\n## Examples\n\n```rescript\nlet clockEqual = (a, b) => mod(a, 12) == mod(b, 12)\n\nopen Belt.Option\n\neq(Some(3), Some(15), clockEqual) /* true */\n\neq(Some(3), None, clockEqual) /* false */\n\neq(None, Some(3), clockEqual) /* false */\n\neq(None, None, clockEqual) /* true */\n```"
+ ],
+ "signature": "let eq: (option<'a>, option<'b>, ('a, 'b) => bool) => bool"
+ },
+ {
+ "id": "Belt.Option.cmpU",
+ "kind": "value",
+ "name": "cmpU",
+ "docstrings": ["Uncurried version of `cmp`"],
+ "signature": "let cmpU: (option<'a>, option<'b>, ('a, 'b) => int) => int"
+ },
+ {
+ "id": "Belt.Option.cmp",
+ "kind": "value",
+ "name": "cmp",
+ "docstrings": [
+ "`cmp(optValue1, optValue2, comparisonFunction)` compares two optional values\nwith respect to given `comparisonFunction`.\n\nIf both `optValue1` and `optValue2` are `None`, it returns `0`.\n\nIf the first argument is `Some(value1)` and the second is `None`, returns `1`\n(something is greater than nothing).\n\nIf the first argument is `None` and the second is `Some(value2)`, returns `-1`\n(nothing is less than something).\n\nIf the arguments are `Some(value1)` and `Some(value2)`, returns the result of\n`comparisonFunction(value1, value2)`; comparisonFunction takes two arguments\nand returns `-1` if the first argument is less than the second, `0` if the\narguments are equal, and `1` if the first argument is greater than the second.\n\n## Examples\n\n```rescript\nlet clockCompare = (a, b) => compare(mod(a, 12), mod(b, 12))\n\nopen Belt.Option\n\ncmp(Some(3), Some(15), clockCompare) /* 0 */\n\ncmp(Some(3), Some(14), clockCompare) /* 1 */\n\ncmp(Some(2), Some(15), clockCompare) /* (-1) */\n\ncmp(None, Some(15), clockCompare) /* (-1) */\n\ncmp(Some(14), None, clockCompare) /* 1 */\n\ncmp(None, None, clockCompare) /* 0 */\n```"
+ ],
+ "signature": "let cmp: (option<'a>, option<'b>, ('a, 'b) => int) => int"
+ }
+ ]
+ },
+ "belt/hashmap": {
+ "id": "Belt.HashMap",
+ "name": "HashMap",
+ "docstrings": [
+ "[`Belt.HashMap`]()\n\n The top level provides generic **mutable** hash map operations.\n\n It also has two specialized inner modules\n [`Belt.HashMap.Int`]() and [`Belt.HashMap.String`]()",
+ "A **mutable** Hash map which allows customized [`hash`]() behavior.\n\nAll data are parameterized by not its only type but also a unique identity in\nthe time of initialization, so that two _HashMaps of ints_ initialized with different\n_hash_ functions will have different type.\n\n## Examples\n\n```rescript\ntype t = int\nmodule I0 = unpack(Belt.Id.hashableU(~hash=(. a: t) => \"&\"(a, 0xff_ff), ~eq=(. a, b) => a == b))\nlet s0: t<_, string, _> = make(~hintSize=40, ~id=module(I0))\n\nmodule I1 = unpack(Belt.Id.hashableU(~hash=(. a: t) => \"&\"(a, 0xff), ~eq=(. a, b) => a == b))\nlet s1: t<_, string, _> = make(~hintSize=40, ~id=module(I1))\n```\n\nThe invariant must be held: for two elements who are _equal_,\ntheir hashed value should be the same\n\nHere the compiler would infer `s0` and `s1` having different type so that\nit would not mix.\n\n## Examples\n\n```rescript\nlet s0: t\nlet s1: t\n```\n\nWe can add elements to the collection:\n\n## Examples\n\n```rescript\nlet () = {\n add(s1, 0, \"3\")\n add(s1, 1, \"3\")\n}\n```\n\nSince this is an mutable data strucure, `s1` will contain two pairs."
+ ],
+ "items": [
+ {
+ "id": "Belt.HashMap.t",
+ "kind": "type",
+ "name": "t",
+ "docstrings": [
+ "The type of hash tables from type `'key` to type `'value`."
+ ],
+ "signature": "type t<'key, 'value, 'id>"
+ },
+ {
+ "id": "Belt.HashMap.id",
+ "kind": "type",
+ "name": "id",
+ "docstrings": ["The identity needed for making an empty hash map."],
+ "signature": "type id<'a, 'id> = Belt_Id.hashable<'a, 'id>"
+ },
+ {
+ "id": "Belt.HashMap.make",
+ "kind": "value",
+ "name": "make",
+ "docstrings": [
+ "`make(~hintSize=10, ~id)` creates a new map by taking in the comparator and `hintSize`.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet hMap = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\n\nBelt.HashMap.set(hMap, 0, \"a\")\n```"
+ ],
+ "signature": "let make: (~hintSize: int, ~id: id<'key, 'id>) => t<'key, 'value, 'id>"
+ },
+ {
+ "id": "Belt.HashMap.clear",
+ "kind": "value",
+ "name": "clear",
+ "docstrings": [
+ "Clears a hash table.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet hMap = Belt.HashMap.fromArray([(1, \"1\")], ~id=module(IntHash))\nBelt.HashMap.clear(hMap)\nBelt.HashMap.isEmpty(hMap) == true\n```"
+ ],
+ "signature": "let clear: t<'key, 'value, 'id> => unit"
+ },
+ {
+ "id": "Belt.HashMap.isEmpty",
+ "kind": "value",
+ "name": "isEmpty",
+ "docstrings": [
+ "`isEmpty(m)` checks whether a hash map is empty.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nBelt.HashMap.isEmpty(Belt.HashMap.fromArray([(1, \"1\")], ~id=module(IntHash))) == false\n```"
+ ],
+ "signature": "let isEmpty: t<'a, 'b, 'c> => bool"
+ },
+ {
+ "id": "Belt.HashMap.set",
+ "kind": "value",
+ "name": "set",
+ "docstrings": [
+ "`set(hMap, k, v)` if `k` does not exist, add the binding `k,v`, otherwise, update the old value with the new `v`.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.fromArray([(2, \"2\"), (1, \"1\"), (3, \"3\")], ~id=module(IntHash))\n\nBelt.HashMap.set(s0, 2, \"3\")\n\nBelt.HashMap.valuesToArray(s0) == [\"1\", \"3\", \"3\"]\n```"
+ ],
+ "signature": "let set: (t<'key, 'value, 'id>, 'key, 'value) => unit"
+ },
+ {
+ "id": "Belt.HashMap.copy",
+ "kind": "value",
+ "name": "copy",
+ "docstrings": [
+ "Creates copy of a hash map.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.fromArray([(2, \"2\"), (1, \"1\"), (3, \"3\")], ~id=module(IntHash))\nlet s1 = Belt.HashMap.copy(s0)\n\nBelt.HashMap.set(s0, 2, \"3\")\n\nBelt.HashMap.get(s0, 2) != Belt.HashMap.get(s1, 2)\n```"
+ ],
+ "signature": "let copy: t<'key, 'value, 'id> => t<'key, 'value, 'id>"
+ },
+ {
+ "id": "Belt.HashMap.get",
+ "kind": "value",
+ "name": "get",
+ "docstrings": [
+ "Returns value bound under specific key. If values not exist returns `None`.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\nBelt.HashMap.set(s0, 1, \"value1\")\n\nBelt.HashMap.get(s0, 1) == Some(\"value1\")\nBelt.HashMap.get(s0, 2) == None\n```"
+ ],
+ "signature": "let get: (t<'key, 'value, 'id>, 'key) => option<'value>"
+ },
+ {
+ "id": "Belt.HashMap.has",
+ "kind": "value",
+ "name": "has",
+ "docstrings": [
+ "Checks if `x` is bound in `tbl`.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\nBelt.HashMap.set(s0, 1, \"value1\")\n\nBelt.HashMap.has(s0, 1) == true\nBelt.HashMap.has(s0, 2) == false\n```"
+ ],
+ "signature": "let has: (t<'key, 'value, 'id>, 'key) => bool"
+ },
+ {
+ "id": "Belt.HashMap.remove",
+ "kind": "value",
+ "name": "remove",
+ "docstrings": [
+ "If bound exists, removes it from the hash map.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\nBelt.HashMap.set(s0, 1, \"value1\")\nBelt.HashMap.remove(s0, 1)\nBelt.HashMap.has(s0, 1) == false\n```"
+ ],
+ "signature": "let remove: (t<'key, 'value, 'id>, 'key) => unit"
+ },
+ {
+ "id": "Belt.HashMap.forEachU",
+ "kind": "value",
+ "name": "forEachU",
+ "docstrings": [
+ "Same as [forEach](#forEach) but takes uncurried function."
+ ],
+ "signature": "let forEachU: (t<'key, 'value, 'id>, ('key, 'value) => unit) => unit"
+ },
+ {
+ "id": "Belt.HashMap.forEach",
+ "kind": "value",
+ "name": "forEach",
+ "docstrings": [
+ "`forEach(tbl, f)` applies `f` to all bindings in table `tbl`. `f` receives the key as first argument, and the associated value as second argument. Each binding is presented exactly once to `f`.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\nBelt.HashMap.set(s0, 1, \"value1\")\nBelt.HashMap.forEach(s0, (key, value) => Js.log2(key, value))\n// prints (1, \"value1\")\n```"
+ ],
+ "signature": "let forEach: (t<'key, 'value, 'id>, ('key, 'value) => unit) => unit"
+ },
+ {
+ "id": "Belt.HashMap.reduceU",
+ "kind": "value",
+ "name": "reduceU",
+ "docstrings": [],
+ "signature": "let reduceU: (t<'key, 'value, 'id>, 'c, ('c, 'key, 'value) => 'c) => 'c"
+ },
+ {
+ "id": "Belt.HashMap.reduce",
+ "kind": "value",
+ "name": "reduce",
+ "docstrings": [
+ "`reduce(tbl, init, f)` computes `(f(kN, dN) ... (f(k1, d1, init))...)`, where `k1 ... kN` are the keys of all bindings in `tbl`, and `d1 ... dN` are the associated values. Each binding is presented exactly once to `f`.\n\nThe order in which the bindings are passed to `f` is unspecified. However, if the table contains several bindings for the same key, they are passed to `f` in reverse order of introduction, that is, the most recent binding is passed first.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\nBelt.HashMap.set(s0, 1, \"value1\")\nBelt.HashMap.set(s0, 2, \"value2\")\n\nBelt.HashMap.reduce(s0, \"\", (acc, key, value) => acc ++ (\", \" ++ value)) == \"value1, value2\"\n```"
+ ],
+ "signature": "let reduce: (t<'key, 'value, 'id>, 'c, ('c, 'key, 'value) => 'c) => 'c"
+ },
+ {
+ "id": "Belt.HashMap.keepMapInPlaceU",
+ "kind": "value",
+ "name": "keepMapInPlaceU",
+ "docstrings": [
+ "Same as [keepMapInPlace](#keepMapInPlace) but takes uncurried function."
+ ],
+ "signature": "let keepMapInPlaceU: (\n t<'key, 'value, 'id>,\n ('key, 'value) => option<'value>,\n) => unit"
+ },
+ {
+ "id": "Belt.HashMap.keepMapInPlace",
+ "kind": "value",
+ "name": "keepMapInPlace",
+ "docstrings": [
+ "Filters out values for which function `f` returned `None`.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\nBelt.HashMap.set(s0, 1, \"value1\")\nBelt.HashMap.set(s0, 2, \"value2\")\n\nBelt.HashMap.keepMapInPlace(s0, (key, value) => key == 1 ? None : Some(value))\n```"
+ ],
+ "signature": "let keepMapInPlace: (\n t<'key, 'value, 'id>,\n ('key, 'value) => option<'value>,\n) => unit"
+ },
+ {
+ "id": "Belt.HashMap.size",
+ "kind": "value",
+ "name": "size",
+ "docstrings": [
+ "`size(tbl)` returns the number of bindings in `tbl`. It takes constant time.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\nBelt.HashMap.set(s0, 1, \"value1\")\nBelt.HashMap.set(s0, 2, \"value2\")\n\nBelt.HashMap.size(s0) == 2\n```"
+ ],
+ "signature": "let size: t<'a, 'b, 'c> => int"
+ },
+ {
+ "id": "Belt.HashMap.toArray",
+ "kind": "value",
+ "name": "toArray",
+ "docstrings": [
+ "Returns array of key value pairs.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\nBelt.HashMap.set(s0, 1, \"value1\")\nBelt.HashMap.set(s0, 2, \"value2\")\n\nBelt.HashMap.toArray(s0) == [(1, \"value1\"), (2, \"value2\")]\n```"
+ ],
+ "signature": "let toArray: t<'key, 'value, 'id> => array<('key, 'value)>"
+ },
+ {
+ "id": "Belt.HashMap.keysToArray",
+ "kind": "value",
+ "name": "keysToArray",
+ "docstrings": [
+ "Returns array of keys.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\nBelt.HashMap.set(s0, 1, \"value1\")\nBelt.HashMap.set(s0, 2, \"value2\")\n\nBelt.HashMap.keysToArray(s0) == [1, 2]\n```"
+ ],
+ "signature": "let keysToArray: t<'key, 'a, 'b> => array<'key>"
+ },
+ {
+ "id": "Belt.HashMap.valuesToArray",
+ "kind": "value",
+ "name": "valuesToArray",
+ "docstrings": [
+ "Returns array of values.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\nBelt.HashMap.set(s0, 1, \"value1\")\nBelt.HashMap.set(s0, 2, \"value2\")\n\nBelt.HashMap.valuesToArray(s0) == [\"value1\", \"value2\"]\n```"
+ ],
+ "signature": "let valuesToArray: t<'a, 'value, 'b> => array<'value>"
+ },
+ {
+ "id": "Belt.HashMap.fromArray",
+ "kind": "value",
+ "name": "fromArray",
+ "docstrings": [
+ "Creates new hash map from array of pairs.\n\nReturns array of values.\n\n## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet s0 = Belt.HashMap.fromArray([(1, \"value1\"), (2, \"value2\")], ~id=module(IntHash))\nBelt.HashMap.toArray(s0) == [(1, \"value1\"), (2, \"value2\")]\n```"
+ ],
+ "signature": "let fromArray: (\n array<('key, 'value)>,\n ~id: id<'key, 'id>,\n) => t<'key, 'value, 'id>"
+ },
+ {
+ "id": "Belt.HashMap.mergeMany",
+ "kind": "value",
+ "name": "mergeMany",
+ "docstrings": [
+ "## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\n\nlet hMap = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\nBelt.HashMap.mergeMany(hMap, [(1, \"1\"), (2, \"2\")])\n```"
+ ],
+ "signature": "let mergeMany: (t<'key, 'value, 'id>, array<('key, 'value)>) => unit"
+ },
+ {
+ "id": "Belt.HashMap.getBucketHistogram",
+ "kind": "value",
+ "name": "getBucketHistogram",
+ "docstrings": [
+ "## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\nlet hMap = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\nBelt.HashMap.set(hMap, 1, \"1\")\n\nBelt.HashMap.getBucketHistogram(hMap)\n```"
+ ],
+ "signature": "let getBucketHistogram: t<'a, 'b, 'c> => array"
+ },
+ {
+ "id": "Belt.HashMap.logStats",
+ "kind": "value",
+ "name": "logStats",
+ "docstrings": [
+ "## Examples\n\n```rescript\nmodule IntHash = Belt.Id.MakeHashable({\n type t = int\n let hash = a => a\n let eq = (a, b) => a == b\n})\nlet hMap = Belt.HashMap.make(~hintSize=10, ~id=module(IntHash))\nBelt.HashMap.set(hMap, 1, \"1\")\n\nBelt.HashMap.logStats(hMap)\n```"
+ ],
+ "signature": "let logStats: t<'a, 'b, 'c> => unit"
+ }
+ ]
+ },
+ "belt/hashset": {
+ "id": "Belt.HashSet",
+ "name": "HashSet",
+ "docstrings": [
+ "[`Belt.HashSet`]()\n\n The top level provides generic **mutable** hash set operations.\n\n It also has two specialized inner modules\n [`Belt.HashSet.Int`]() and [`Belt.HashSet.String`]()",
+ "A **mutable** Hash set which allows customized `hash` behavior.\n\nAll data are parameterized by not its only type but also a unique identity in\nthe time of initialization, so that two _HashSets of ints_ initialized with\ndifferent _hash_ functions will have different type.\n\n## Examples\n\n```rescript\nmodule I0 = unpack(\n Belt.Id.hashableU(\n ~hash=(. a: int) => land(a, 65535),\n ~eq=(. a, b) => a == b,\n )\n)\n\nlet s0 = Belt.HashSet.make(~id=module(I0), ~hintSize=40)\n\nmodule I1 = unpack(\n Belt.Id.hashableU(\n ~hash=(. a: int) => land(a, 255),\n ~eq=(. a, b) => a == b,\n )\n)\n\nlet s1 = Belt.HashSet.make(~id=module(I1), ~hintSize=40)\n\nBelt.HashSet.add(s1, 0)\nBelt.HashSet.add(s1, 1)\n```\n\nThe invariant must be held: for two elements who are equal, their hashed\nvalue should be the same.\n\nHere the compiler would infer `s0` and `s1` having different type so that it\nwould not mix.\n\n## Examples\n\n```rescript\nlet s0: Belt.HashSet.t\nlet s1: Belt.HashSet.t\n```\n\nWe can add elements to the collection (see last two lines in the example\nabove). Since this is an mutable data structure, `s1` will contain two pairs."
+ ],
+ "items": [
+ {
+ "id": "Belt.HashSet.t",
+ "kind": "type",
+ "name": "t",
+ "docstrings": [],
+ "signature": "type t<'a, 'id>"
+ },
+ {
+ "id": "Belt.HashSet.id",
+ "kind": "type",
+ "name": "id",
+ "docstrings": ["The type of hash tables from type `'a` to type `'b`."],
+ "signature": "type id<'a, 'id> = Belt_Id.hashable<'a, 'id>"
+ },
+ {
+ "id": "Belt.HashSet.make",
+ "kind": "value",
+ "name": "make",
+ "docstrings": [],
+ "signature": "let make: (~hintSize: int, ~id: id<'a, 'id>) => t<'a, 'id>"
+ },
+ {
+ "id": "Belt.HashSet.clear",
+ "kind": "value",
+ "name": "clear",
+ "docstrings": [],
+ "signature": "let clear: t<'a, 'id> => unit"
+ },
+ {
+ "id": "Belt.HashSet.isEmpty",
+ "kind": "value",
+ "name": "isEmpty",
+ "docstrings": [],
+ "signature": "let isEmpty: t<'a, 'b> => bool"
+ },
+ {
+ "id": "Belt.HashSet.add",
+ "kind": "value",
+ "name": "add",
+ "docstrings": [],
+ "signature": "let add: (t<'a, 'id>, 'a) => unit"
+ },
+ {
+ "id": "Belt.HashSet.copy",
+ "kind": "value",
+ "name": "copy",
+ "docstrings": [],
+ "signature": "let copy: t<'a, 'id> => t<'a, 'id>"
+ },
+ {
+ "id": "Belt.HashSet.has",
+ "kind": "value",
+ "name": "has",
+ "docstrings": [],
+ "signature": "let has: (t<'a, 'id>, 'a) => bool"
+ },
+ {
+ "id": "Belt.HashSet.remove",
+ "kind": "value",
+ "name": "remove",
+ "docstrings": [],
+ "signature": "let remove: (t<'a, 'id>, 'a) => unit"
+ },
+ {
+ "id": "Belt.HashSet.forEachU",
+ "kind": "value",
+ "name": "forEachU",
+ "docstrings": [],
+ "signature": "let forEachU: (t<'a, 'id>, 'a => unit) => unit"
+ },
+ {
+ "id": "Belt.HashSet.forEach",
+ "kind": "value",
+ "name": "forEach",
+ "docstrings": ["Order unspecified."],
+ "signature": "let forEach: (t<'a, 'id>, 'a => unit) => unit"
+ },
+ {
+ "id": "Belt.HashSet.reduceU",
+ "kind": "value",
+ "name": "reduceU",
+ "docstrings": [],
+ "signature": "let reduceU: (t<'a, 'id>, 'c, ('c, 'a) => 'c) => 'c"
+ },
+ {
+ "id": "Belt.HashSet.reduce",
+ "kind": "value",
+ "name": "reduce",
+ "docstrings": ["Order unspecified."],
+ "signature": "let reduce: (t<'a, 'id>, 'c, ('c, 'a) => 'c) => 'c"
+ },
+ {
+ "id": "Belt.HashSet.size",
+ "kind": "value",
+ "name": "size",
+ "docstrings": [],
+ "signature": "let size: t<'a, 'id> => int"
+ },
+ {
+ "id": "Belt.HashSet.logStats",
+ "kind": "value",
+ "name": "logStats",
+ "docstrings": [],
+ "signature": "let logStats: t<'a, 'b> => unit"
+ },
+ {
+ "id": "Belt.HashSet.toArray",
+ "kind": "value",
+ "name": "toArray",
+ "docstrings": [],
+ "signature": "let toArray: t<'a, 'id> => array<'a>"
+ },
+ {
+ "id": "Belt.HashSet.fromArray",
+ "kind": "value",
+ "name": "fromArray",
+ "docstrings": [],
+ "signature": "let fromArray: (array<'a>, ~id: id<'a, 'id>) => t<'a, 'id>"
+ },
+ {
+ "id": "Belt.HashSet.mergeMany",
+ "kind": "value",
+ "name": "mergeMany",
+ "docstrings": [],
+ "signature": "let mergeMany: (t<'a, 'id>, array<'a>) => unit"
+ },
+ {
+ "id": "Belt.HashSet.getBucketHistogram",
+ "kind": "value",
+ "name": "getBucketHistogram",
+ "docstrings": [],
+ "signature": "let getBucketHistogram: t<'a, 'b> => array"
+ }
+ ]
+ },
+ "belt/mutablemap": {
+ "id": "Belt.MutableMap",
+ "name": "MutableMap",
+ "docstrings": [
+ "[`Belt.MutableMap`]()\n\n The top level provides generic **mutable** map operations.\n\n It also has two specialized inner modules\n [`Belt.MutableMap.Int`]() and [`Belt.MutableMap.String`]()"
+ ],
+ "items": [
+ {
+ "id": "Belt.MutableMap.t",
+ "kind": "type",
+ "name": "t",
+ "docstrings": [],
+ "signature": "type t<'k, 'v, 'id>"
+ },
+ {
+ "id": "Belt.MutableMap.id",
+ "kind": "type",
+ "name": "id",
+ "docstrings": [],
+ "signature": "type id<'key, 'id> = Belt_Id.comparable<'key, 'id>"
+ },
+ {
+ "id": "Belt.MutableMap.make",
+ "kind": "value",
+ "name": "make",
+ "docstrings": [],
+ "signature": "let make: (~id: id<'k, 'id>) => t<'k, 'a, 'id>"
+ },
+ {
+ "id": "Belt.MutableMap.clear",
+ "kind": "value",
+ "name": "clear",
+ "docstrings": [],
+ "signature": "let clear: t<'a, 'b, 'c> => unit"
+ },
+ {
+ "id": "Belt.MutableMap.isEmpty",
+ "kind": "value",
+ "name": "isEmpty",
+ "docstrings": [],
+ "signature": "let isEmpty: t<'a, 'b, 'c> => bool"
+ },
+ {
+ "id": "Belt.MutableMap.has",
+ "kind": "value",
+ "name": "has",
+ "docstrings": [],
+ "signature": "let has: (t<'k, 'a, 'b>, 'k) => bool"
+ },
+ {
+ "id": "Belt.MutableMap.cmpU",
+ "kind": "value",
+ "name": "cmpU",
+ "docstrings": [],
+ "signature": "let cmpU: (t<'k, 'a, 'id>, t<'k, 'a, 'id>, ('a, 'a) => int) => int"
+ },
+ {
+ "id": "Belt.MutableMap.cmp",
+ "kind": "value",
+ "name": "cmp",
+ "docstrings": [
+ "`cmp(m1, m2, cmp)` First compare by size, if size is the same, compare by\nkey, value pair."
+ ],
+ "signature": "let cmp: (t<'k, 'a, 'id>, t<'k, 'a, 'id>, ('a, 'a) => int) => int"
+ },
+ {
+ "id": "Belt.MutableMap.eqU",
+ "kind": "value",
+ "name": "eqU",
+ "docstrings": [],
+ "signature": "let eqU: (t<'k, 'a, 'id>, t<'k, 'a, 'id>, ('a, 'a) => bool) => bool"
+ },
+ {
+ "id": "Belt.MutableMap.eq",
+ "kind": "value",
+ "name": "eq",
+ "docstrings": [
+ "`eq(m1, m2, eqf)` tests whether the maps `m1` and `m2` are equal, that is,\ncontain equal keys and associate them with equal data. `eqf` is the\nequality predicate used to compare the data associated with the keys."
+ ],
+ "signature": "let eq: (t<'k, 'a, 'id>, t<'k, 'a, 'id>, ('a, 'a) => bool) => bool"
+ },
+ {
+ "id": "Belt.MutableMap.forEachU",
+ "kind": "value",
+ "name": "forEachU",
+ "docstrings": [],
+ "signature": "let forEachU: (t<'k, 'a, 'id>, ('k, 'a) => unit) => unit"
+ },
+ {
+ "id": "Belt.MutableMap.forEach",
+ "kind": "value",
+ "name": "forEach",
+ "docstrings": [
+ "`forEach(m, f)` applies f to all bindings in map `m`. `f` receives the `'k`\nas first argument, and the associated value as second argument. The\nbindings are passed to `f` in increasing order with respect to the ordering\nover the type of the keys."
+ ],
+ "signature": "let forEach: (t<'k, 'a, 'id>, ('k, 'a) => unit) => unit"
+ },
+ {
+ "id": "Belt.MutableMap.reduceU",
+ "kind": "value",
+ "name": "reduceU",
+ "docstrings": [],
+ "signature": "let reduceU: (t<'k, 'a, 'id>, 'b, ('b, 'k, 'a) => 'b) => 'b"
+ },
+ {
+ "id": "Belt.MutableMap.reduce",
+ "kind": "value",
+ "name": "reduce",
+ "docstrings": [
+ "`reduce(m, a, f), computes`(f(kN, dN) ... (f(k1, d1, a))...)`, where`k1 ...\nkN`are the keys of all bindings in`m`(in increasing order), and`d1 ... dN`\nare the associated data."
+ ],
+ "signature": "let reduce: (t<'k, 'a, 'id>, 'b, ('b, 'k, 'a) => 'b) => 'b"
+ },
+ {
+ "id": "Belt.MutableMap.everyU",
+ "kind": "value",
+ "name": "everyU",
+ "docstrings": [],
+ "signature": "let everyU: (t<'k, 'a, 'id>, ('k, 'a) => bool) => bool"
+ },
+ {
+ "id": "Belt.MutableMap.every",
+ "kind": "value",
+ "name": "every",
+ "docstrings": [
+ "`every(m, p)` checks if all the bindings of the map satisfy the predicate `p`."
+ ],
+ "signature": "let every: (t<'k, 'a, 'id>, ('k, 'a) => bool) => bool"
+ },
+ {
+ "id": "Belt.MutableMap.someU",
+ "kind": "value",
+ "name": "someU",
+ "docstrings": [],
+ "signature": "let someU: (t<'k, 'a, 'id>, ('k, 'a) => bool) => bool"
+ },
+ {
+ "id": "Belt.MutableMap.some",
+ "kind": "value",
+ "name": "some",
+ "docstrings": [
+ "`some(m, p)` checks if at least one binding of the map satisfy the predicate `p`."
+ ],
+ "signature": "let some: (t<'k, 'a, 'id>, ('k, 'a) => bool) => bool"
+ },
+ {
+ "id": "Belt.MutableMap.size",
+ "kind": "value",
+ "name": "size",
+ "docstrings": [],
+ "signature": "let size: t<'k, 'a, 'id> => int"
+ },
+ {
+ "id": "Belt.MutableMap.toList",
+ "kind": "value",
+ "name": "toList",
+ "docstrings": ["In increasing order."],
+ "signature": "let toList: t<'k, 'a, 'id> => list<('k, 'a)>"
+ },
+ {
+ "id": "Belt.MutableMap.toArray",
+ "kind": "value",
+ "name": "toArray",
+ "docstrings": [],
+ "signature": "let toArray: t<'k, 'a, 'id> => array<('k, 'a)>"
+ },
+ {
+ "id": "Belt.MutableMap.fromArray",
+ "kind": "value",
+ "name": "fromArray",
+ "docstrings": [],
+ "signature": "let fromArray: (array<('k, 'a)>, ~id: id<'k, 'id>) => t<'k, 'a, 'id>"
+ },
+ {
+ "id": "Belt.MutableMap.keysToArray",
+ "kind": "value",
+ "name": "keysToArray",
+ "docstrings": [],
+ "signature": "let keysToArray: t<'k, 'a, 'b> => array<'k>"
+ },
+ {
+ "id": "Belt.MutableMap.valuesToArray",
+ "kind": "value",
+ "name": "valuesToArray",
+ "docstrings": [],
+ "signature": "let valuesToArray: t<'b, 'a, 'c> => array<'a>"
+ },
+ {
+ "id": "Belt.MutableMap.minKey",
+ "kind": "value",
+ "name": "minKey",
+ "docstrings": [],
+ "signature": "let minKey: t<'k, 'a, 'b> => option<'k>"
+ },
+ {
+ "id": "Belt.MutableMap.minKeyUndefined",
+ "kind": "value",
+ "name": "minKeyUndefined",
+ "docstrings": [],
+ "signature": "let minKeyUndefined: t<'k, 'a, 'b> => Js.undefined<'k>"
+ },
+ {
+ "id": "Belt.MutableMap.maxKey",
+ "kind": "value",
+ "name": "maxKey",
+ "docstrings": [],
+ "signature": "let maxKey: t<'k, 'a, 'b> => option<'k>"
+ },
+ {
+ "id": "Belt.MutableMap.maxKeyUndefined",
+ "kind": "value",
+ "name": "maxKeyUndefined",
+ "docstrings": [],
+ "signature": "let maxKeyUndefined: t<'k, 'a, 'b> => Js.undefined<'k>"
+ },
+ {
+ "id": "Belt.MutableMap.minimum",
+ "kind": "value",
+ "name": "minimum",
+ "docstrings": [],
+ "signature": "let minimum: t<'k, 'a, 'b> => option<('k, 'a)>"
+ },
+ {
+ "id": "Belt.MutableMap.minUndefined",
+ "kind": "value",
+ "name": "minUndefined",
+ "docstrings": [],
+ "signature": "let minUndefined: t<'k, 'a, 'b> => Js.undefined<('k, 'a)>"
+ },
+ {
+ "id": "Belt.MutableMap.maximum",
+ "kind": "value",
+ "name": "maximum",
+ "docstrings": [],
+ "signature": "let maximum: t<'k, 'a, 'b> => option<('k, 'a)>"
+ },
+ {
+ "id": "Belt.MutableMap.maxUndefined",
+ "kind": "value",
+ "name": "maxUndefined",
+ "docstrings": [],
+ "signature": "let maxUndefined: t<'k, 'a, 'b> => Js.undefined<('k, 'a)>"
+ },
+ {
+ "id": "Belt.MutableMap.get",
+ "kind": "value",
+ "name": "get",
+ "docstrings": [],
+ "signature": "let get: (t<'k, 'a, 'id>, 'k) => option<'a>"
+ },
+ {
+ "id": "Belt.MutableMap.getUndefined",
+ "kind": "value",
+ "name": "getUndefined",
+ "docstrings": [],
+ "signature": "let getUndefined: (t<'k, 'a, 'id>, 'k) => Js.undefined<'a>"
+ },
+ {
+ "id": "Belt.MutableMap.getWithDefault",
+ "kind": "value",
+ "name": "getWithDefault",
+ "docstrings": [],
+ "signature": "let getWithDefault: (t<'k, 'a, 'id>, 'k, 'a) => 'a"
+ },
+ {
+ "id": "Belt.MutableMap.getExn",
+ "kind": "value",
+ "name": "getExn",
+ "docstrings": [],
+ "signature": "let getExn: (t<'k, 'a, 'id>, 'k) => 'a"
+ },
+ {
+ "id": "Belt.MutableMap.checkInvariantInternal",
+ "kind": "value",
+ "name": "checkInvariantInternal",
+ "docstrings": ["Raise when invariant is not held."],
+ "signature": "let checkInvariantInternal: t<'a, 'b, 'c> => unit"
+ },
+ {
+ "id": "Belt.MutableMap.remove",
+ "kind": "value",
+ "name": "remove",
+ "docstrings": ["`remove(m, x)` do the in-place modification."],
+ "signature": "let remove: (t<'k, 'a, 'id>, 'k) => unit"
+ },
+ {
+ "id": "Belt.MutableMap.removeMany",
+ "kind": "value",
+ "name": "removeMany",
+ "docstrings": [],
+ "signature": "let removeMany: (t<'k, 'a, 'id>, array<'k>) => unit"
+ },
+ {
+ "id": "Belt.MutableMap.set",
+ "kind": "value",
+ "name": "set",
+ "docstrings": ["`set(m, x, y)` do the in-place modification"],
+ "signature": "let set: (t<'k, 'a, 'id>, 'k, 'a) => unit"
+ },
+ {
+ "id": "Belt.MutableMap.updateU",
+ "kind": "value",
+ "name": "updateU",
+ "docstrings": [],
+ "signature": "let updateU: (t<'k, 'a, 'id>, 'k, option<'a> => option<'a>) => unit"
+ },
+ {
+ "id": "Belt.MutableMap.update",
+ "kind": "value",
+ "name": "update",
+ "docstrings": [],
+ "signature": "let update: (t<'k, 'a, 'id>, 'k, option<'a> => option<'a>) => unit"
+ },
+ {
+ "id": "Belt.MutableMap.mergeMany",
+ "kind": "value",
+ "name": "mergeMany",
+ "docstrings": [],
+ "signature": "let mergeMany: (t<'k, 'a, 'id>, array<('k, 'a)>) => unit"
+ },
+ {
+ "id": "Belt.MutableMap.mapU",
+ "kind": "value",
+ "name": "mapU",
+ "docstrings": [],
+ "signature": "let mapU: (t<'k, 'a, 'id>, 'a => 'b) => t<'k, 'b, 'id>"
+ },
+ {
+ "id": "Belt.MutableMap.map",
+ "kind": "value",
+ "name": "map",
+ "docstrings": [
+ "`map(m, f)` returns a map with same domain as `m`, where the associated\nvalue a of all bindings of `m` has been replaced by the result of the\napplication of `f` to `a`. The bindings are passed to `f` in increasing\norder with respect to the ordering over the type of the keys."
+ ],
+ "signature": "let map: (t<'k, 'a, 'id>, 'a => 'b) => t<'k, 'b, 'id>"
+ },
+ {
+ "id": "Belt.MutableMap.mapWithKeyU",
+ "kind": "value",
+ "name": "mapWithKeyU",
+ "docstrings": [],
+ "signature": "let mapWithKeyU: (t<'k, 'a, 'id>, ('k, 'a) => 'b) => t<'k, 'b, 'id>"
+ },
+ {
+ "id": "Belt.MutableMap.mapWithKey",
+ "kind": "value",
+ "name": "mapWithKey",
+ "docstrings": [],
+ "signature": "let mapWithKey: (t<'k, 'a, 'id>, ('k, 'a) => 'b) => t<'k, 'b, 'id>"
+ }
+ ]
+ },
+ "belt/mutableset": {
+ "id": "Belt.MutableSet",
+ "name": "MutableSet",
+ "docstrings": [
+ "[`Belt.MutableSet`]()\n\n The top level provides generic **mutable** set operations.\n\n It also has two specialized inner modules\n [`Belt.MutableSet.Int`]() and [`Belt.MutableSet.String`]()",
+ "A **mutable** sorted set module which allows customized compare behavior.\nThe implementation uses balanced binary trees, and therefore searching and insertion take time logarithmic in the size of the map.\n\nIt also has two specialized inner modules [Belt.MutableSet.Int](mutable-set-int) and [Belt.MutableSet.String](mutable-set-string) - This module separates data from function which is more verbose but slightly more efficient\n\n## Examples\n\n```rescript\nmodule PairComparator = Belt.Id.MakeComparable({\n type t = (int, int)\n let cmp = ((a0, a1), (b0, b1)) =>\n switch Pervasives.compare(a0, b0) {\n | 0 => Pervasives.compare(a1, b1)\n | c => c\n }\n})\n\nlet mySet = Belt.MutableSet.make(~id=module(PairComparator))\nmySet->Belt.MutableSet.add((1, 2))\n```"
+ ],
+ "items": [
+ {
+ "id": "Belt.MutableSet.t",
+ "kind": "type",
+ "name": "t",
+ "docstrings": [
+ "`'value` is the element type\n\n`'identity` the identity of the collection"
+ ],
+ "signature": "type t<'value, 'identity>"
+ },
+ {
+ "id": "Belt.MutableSet.id",
+ "kind": "type",
+ "name": "id",
+ "docstrings": ["The identity needed for making a set from scratch"],
+ "signature": "type id<'value, 'id> = Belt_Id.comparable<'value, 'id>"
+ },
+ {
+ "id": "Belt.MutableSet.make",
+ "kind": "value",
+ "name": "make",
+ "docstrings": ["Creates a new set by taking in the comparator"],
+ "signature": "let make: (~id: id<'value, 'id>) => t<'value, 'id>"
+ },
+ {
+ "id": "Belt.MutableSet.fromArray",
+ "kind": "value",
+ "name": "fromArray",
+ "docstrings": [
+ "Creates new set from array of elements.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([1, 3, 2, 4], ~id=module(IntCmp))\n\ns0->Belt.MutableSet.toArray /* [1, 2, 3, 4] */\n```"
+ ],
+ "signature": "let fromArray: (array<'value>, ~id: id<'value, 'id>) => t<'value, 'id>"
+ },
+ {
+ "id": "Belt.MutableSet.fromSortedArrayUnsafe",
+ "kind": "value",
+ "name": "fromSortedArrayUnsafe",
+ "docstrings": [
+ "The same as [fromArray][#fromarray] except it is after assuming the input array is already sorted."
+ ],
+ "signature": "let fromSortedArrayUnsafe: (array<'value>, ~id: id<'value, 'id>) => t<'value, 'id>"
+ },
+ {
+ "id": "Belt.MutableSet.copy",
+ "kind": "value",
+ "name": "copy",
+ "docstrings": [
+ "Returns copy of a set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([1, 3, 2, 4], ~id=module(IntCmp))\n\nlet copied = s0->Belt.MutableSet.copy\ncopied->Belt.MutableSet.toArray /* [1, 2, 3, 4] */\n```"
+ ],
+ "signature": "let copy: t<'value, 'id> => t<'value, 'id>"
+ },
+ {
+ "id": "Belt.MutableSet.isEmpty",
+ "kind": "value",
+ "name": "isEmpty",
+ "docstrings": [
+ "Checks if set is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet empty = Belt.MutableSet.fromArray([], ~id=module(IntCmp))\nlet notEmpty = Belt.MutableSet.fromArray([1], ~id=module(IntCmp))\n\nBelt.MutableSet.isEmpty(empty) /* true */\nBelt.MutableSet.isEmpty(notEmpty) /* false */\n```"
+ ],
+ "signature": "let isEmpty: t<'a, 'b> => bool"
+ },
+ {
+ "id": "Belt.MutableSet.has",
+ "kind": "value",
+ "name": "has",
+ "docstrings": [
+ "Checks if element exists in set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet set = Belt.MutableSet.fromArray([1, 4, 2, 5], ~id=module(IntCmp))\n\nset->Belt.MutableSet.has(3) /* false */\nset->Belt.MutableSet.has(1) /* true */\n```"
+ ],
+ "signature": "let has: (t<'value, 'id>, 'value) => bool"
+ },
+ {
+ "id": "Belt.MutableSet.add",
+ "kind": "value",
+ "name": "add",
+ "docstrings": [
+ "Adds element to set. If element existed in set, value is unchanged.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.make(~id=module(IntCmp))\ns0->Belt.MutableSet.add(1)\ns0->Belt.MutableSet.add(2)\ns0->Belt.MutableSet.add(2)\n\ns0->Belt.MutableSet.toArray /* [1, 2] */\n```"
+ ],
+ "signature": "let add: (t<'value, 'id>, 'value) => unit"
+ },
+ {
+ "id": "Belt.MutableSet.addCheck",
+ "kind": "value",
+ "name": "addCheck",
+ "docstrings": [],
+ "signature": "let addCheck: (t<'value, 'id>, 'value) => bool"
+ },
+ {
+ "id": "Belt.MutableSet.mergeMany",
+ "kind": "value",
+ "name": "mergeMany",
+ "docstrings": [
+ "Adds each element of array to set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet set = Belt.MutableSet.make(~id=module(IntCmp))\n\nset->Belt.MutableSet.mergeMany([5, 4, 3, 2, 1])\nset->Belt.MutableSet.toArray /* [1, 2, 3, 4, 5] */\n```"
+ ],
+ "signature": "let mergeMany: (t<'value, 'id>, array<'value>) => unit"
+ },
+ {
+ "id": "Belt.MutableSet.remove",
+ "kind": "value",
+ "name": "remove",
+ "docstrings": [
+ "Removes element from set. If element did not exist in set, value is unchanged.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([2, 3, 1, 4, 5], ~id=module(IntCmp))\ns0->Belt.MutableSet.remove(1)\ns0->Belt.MutableSet.remove(3)\ns0->Belt.MutableSet.remove(3)\n\ns0->Belt.MutableSet.toArray /* [2,4,5] */\n```"
+ ],
+ "signature": "let remove: (t<'value, 'id>, 'value) => unit"
+ },
+ {
+ "id": "Belt.MutableSet.removeCheck",
+ "kind": "value",
+ "name": "removeCheck",
+ "docstrings": [],
+ "signature": "let removeCheck: (t<'value, 'id>, 'value) => bool"
+ },
+ {
+ "id": "Belt.MutableSet.removeMany",
+ "kind": "value",
+ "name": "removeMany",
+ "docstrings": [
+ "Removes each element of array from set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet set = Belt.MutableSet.fromArray([1, 2, 3, 4], ~id=module(IntCmp))\n\nset->Belt.MutableSet.removeMany([5, 4, 3, 2, 1])\nset->Belt.MutableSet.toArray /* [] */\n```"
+ ],
+ "signature": "let removeMany: (t<'value, 'id>, array<'value>) => unit"
+ },
+ {
+ "id": "Belt.MutableSet.union",
+ "kind": "value",
+ "name": "union",
+ "docstrings": [
+ "Returns union of two sets.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([5, 2, 3, 5, 6], ~id=module(IntCmp))\nlet s1 = Belt.MutableSet.fromArray([5, 2, 3, 1, 5, 4], ~id=module(IntCmp))\nlet union = Belt.MutableSet.union(s0, s1)\nunion->Belt.MutableSet.toArray /* [1,2,3,4,5,6] */\n```"
+ ],
+ "signature": "let union: (t<'value, 'id>, t<'value, 'id>) => t<'value, 'id>"
+ },
+ {
+ "id": "Belt.MutableSet.intersect",
+ "kind": "value",
+ "name": "intersect",
+ "docstrings": [
+ "Returns intersection of two sets.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([5, 2, 3, 5, 6], ~id=module(IntCmp))\nlet s1 = Belt.MutableSet.fromArray([5, 2, 3, 1, 5, 4], ~id=module(IntCmp))\nlet intersect = Belt.MutableSet.intersect(s0, s1)\nintersect->Belt.MutableSet.toArray /* [2,3,5] */\n```"
+ ],
+ "signature": "let intersect: (t<'value, 'id>, t<'value, 'id>) => t<'value, 'id>"
+ },
+ {
+ "id": "Belt.MutableSet.diff",
+ "kind": "value",
+ "name": "diff",
+ "docstrings": [
+ "Returns elements from first set, not existing in second set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([5, 2, 3, 5, 6], ~id=module(IntCmp))\nlet s1 = Belt.MutableSet.fromArray([5, 2, 3, 1, 5, 4], ~id=module(IntCmp))\nBelt.MutableSet.toArray(Belt.MutableSet.diff(s0, s1)) /* [6] */\nBelt.MutableSet.toArray(Belt.MutableSet.diff(s1, s0)) /* [1,4] */\n```"
+ ],
+ "signature": "let diff: (t<'value, 'id>, t<'value, 'id>) => t<'value, 'id>"
+ },
+ {
+ "id": "Belt.MutableSet.subset",
+ "kind": "value",
+ "name": "subset",
+ "docstrings": [
+ "Checks if second set is subset of first set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([5, 2, 3, 5, 6], ~id=module(IntCmp))\nlet s1 = Belt.MutableSet.fromArray([5, 2, 3, 1, 5, 4], ~id=module(IntCmp))\nlet s2 = Belt.MutableSet.intersect(s0, s1)\nBelt.MutableSet.subset(s2, s0) /* true */\nBelt.MutableSet.subset(s2, s1) /* true */\nBelt.MutableSet.subset(s1, s0) /* false */\n```"
+ ],
+ "signature": "let subset: (t<'value, 'id>, t<'value, 'id>) => bool"
+ },
+ {
+ "id": "Belt.MutableSet.cmp",
+ "kind": "value",
+ "name": "cmp",
+ "docstrings": [
+ "Total ordering between sets. Can be used as the ordering function for doing sets of sets.\nIt compares size first and then iterates over each element following the order of elements."
+ ],
+ "signature": "let cmp: (t<'value, 'id>, t<'value, 'id>) => int"
+ },
+ {
+ "id": "Belt.MutableSet.eq",
+ "kind": "value",
+ "name": "eq",
+ "docstrings": [
+ "Checks if two sets are equal.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([5, 2, 3], ~id=module(IntCmp))\nlet s1 = Belt.MutableSet.fromArray([3, 2, 5], ~id=module(IntCmp))\n\nBelt.MutableSet.eq(s0, s1) /* true */\n```"
+ ],
+ "signature": "let eq: (t<'value, 'id>, t<'value, 'id>) => bool"
+ },
+ {
+ "id": "Belt.MutableSet.forEachU",
+ "kind": "value",
+ "name": "forEachU",
+ "docstrings": [
+ "Same as `Belt.MutableSet.forEach` but takes uncurried functon."
+ ],
+ "signature": "let forEachU: (t<'value, 'id>, 'value => unit) => unit"
+ },
+ {
+ "id": "Belt.MutableSet.forEach",
+ "kind": "value",
+ "name": "forEach",
+ "docstrings": [
+ "Applies function `f` in turn to all elements of set in increasing order.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([5, 2, 3, 5, 6], ~id=module(IntCmp))\nlet acc = ref(list{})\ns0->Belt.MutableSet.forEach(x => acc := Belt.List.add(acc.contents, x))\nacc /* [6,5,3,2] */\n```"
+ ],
+ "signature": "let forEach: (t<'value, 'id>, 'value => unit) => unit"
+ },
+ {
+ "id": "Belt.MutableSet.reduceU",
+ "kind": "value",
+ "name": "reduceU",
+ "docstrings": [],
+ "signature": "let reduceU: (t<'value, 'id>, 'a, ('a, 'value) => 'a) => 'a"
+ },
+ {
+ "id": "Belt.MutableSet.reduce",
+ "kind": "value",
+ "name": "reduce",
+ "docstrings": [
+ "Applies function `f` to each element of set in increasing order. Function `f` has two parameters: the item from the set and an “accumulator”, which starts with a value of `initialValue`. `reduce` returns the final value of the accumulator.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([5, 2, 3, 5, 6], ~id=module(IntCmp))\ns0->Belt.MutableSet.reduce(list{}, (acc, element) => acc->Belt.List.add(element)) /* [6,5,3,2] */\n```"
+ ],
+ "signature": "let reduce: (t<'value, 'id>, 'a, ('a, 'value) => 'a) => 'a"
+ },
+ {
+ "id": "Belt.MutableSet.everyU",
+ "kind": "value",
+ "name": "everyU",
+ "docstrings": [],
+ "signature": "let everyU: (t<'value, 'id>, 'value => bool) => bool"
+ },
+ {
+ "id": "Belt.MutableSet.every",
+ "kind": "value",
+ "name": "every",
+ "docstrings": [
+ "Checks if all elements of the set satisfy the predicate. Order unspecified.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet isEven = x => mod(x, 2) == 0\n\nlet s0 = Belt.MutableSet.fromArray([2, 4, 6, 8], ~id=module(IntCmp))\ns0->Belt.MutableSet.every(isEven) /* true */\n```"
+ ],
+ "signature": "let every: (t<'value, 'id>, 'value => bool) => bool"
+ },
+ {
+ "id": "Belt.MutableSet.someU",
+ "kind": "value",
+ "name": "someU",
+ "docstrings": [],
+ "signature": "let someU: (t<'value, 'id>, 'value => bool) => bool"
+ },
+ {
+ "id": "Belt.MutableSet.some",
+ "kind": "value",
+ "name": "some",
+ "docstrings": [
+ "Checks if at least one element of the set satisfies the predicate.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet isOdd = x => mod(x, 2) != 0\n\nlet s0 = Belt.MutableSet.fromArray([1, 2, 4, 6, 8], ~id=module(IntCmp))\ns0->Belt.MutableSet.some(isOdd) /* true */\n```"
+ ],
+ "signature": "let some: (t<'value, 'id>, 'value => bool) => bool"
+ },
+ {
+ "id": "Belt.MutableSet.keepU",
+ "kind": "value",
+ "name": "keepU",
+ "docstrings": [],
+ "signature": "let keepU: (t<'value, 'id>, 'value => bool) => t<'value, 'id>"
+ },
+ {
+ "id": "Belt.MutableSet.keep",
+ "kind": "value",
+ "name": "keep",
+ "docstrings": [
+ "Returns the set of all elements that satisfy the predicate.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet isEven = x => mod(x, 2) == 0\n\nlet s0 = Belt.MutableSet.fromArray([1, 2, 3, 4, 5], ~id=module(IntCmp))\nlet s1 = s0->Belt.MutableSet.keep(isEven)\n\ns1->Belt.MutableSet.toArray /* [2, 4] */\n```"
+ ],
+ "signature": "let keep: (t<'value, 'id>, 'value => bool) => t<'value, 'id>"
+ },
+ {
+ "id": "Belt.MutableSet.partitionU",
+ "kind": "value",
+ "name": "partitionU",
+ "docstrings": [],
+ "signature": "let partitionU: (\n t<'value, 'id>,\n 'value => bool,\n) => (t<'value, 'id>, t<'value, 'id>)"
+ },
+ {
+ "id": "Belt.MutableSet.partition",
+ "kind": "value",
+ "name": "partition",
+ "docstrings": [
+ "## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet isOdd = x => mod(x, 2) != 0\n\nlet s0 = Belt.MutableSet.fromArray([1, 2, 3, 4, 5], ~id=module(IntCmp))\nlet (s1, s2) = s0->Belt.MutableSet.partition(isOdd)\n\ns1->Belt.MutableSet.toArray /* [1,3,5] */\ns2->Belt.MutableSet.toArray /* [2,4] */\n```"
+ ],
+ "signature": "let partition: (\n t<'value, 'id>,\n 'value => bool,\n) => (t<'value, 'id>, t<'value, 'id>)"
+ },
+ {
+ "id": "Belt.MutableSet.size",
+ "kind": "value",
+ "name": "size",
+ "docstrings": [
+ "Returns size of the set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([1, 2, 3, 4], ~id=module(IntCmp))\n\ns0->Belt.MutableSet.size /* 4 */\n```"
+ ],
+ "signature": "let size: t<'value, 'id> => int"
+ },
+ {
+ "id": "Belt.MutableSet.toList",
+ "kind": "value",
+ "name": "toList",
+ "docstrings": [
+ "Returns list of ordered set elements.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([3, 2, 1, 5], ~id=module(IntCmp))\n\ns0->Belt.MutableSet.toList /* [1,2,3,5] */\n```"
+ ],
+ "signature": "let toList: t<'value, 'id> => list<'value>"
+ },
+ {
+ "id": "Belt.MutableSet.toArray",
+ "kind": "value",
+ "name": "toArray",
+ "docstrings": [
+ "Returns array of ordered set elements.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([3, 2, 1, 5], ~id=module(IntCmp))\n\ns0->Belt.MutableSet.toArray /* [1,2,3,5] */\n```"
+ ],
+ "signature": "let toArray: t<'value, 'id> => array<'value>"
+ },
+ {
+ "id": "Belt.MutableSet.minimum",
+ "kind": "value",
+ "name": "minimum",
+ "docstrings": [
+ "Returns minimum value of the collection. `None` if collection is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.make(~id=module(IntCmp))\nlet s1 = Belt.MutableSet.fromArray([3, 2, 1, 5], ~id=module(IntCmp))\n\ns0->Belt.MutableSet.minimum /* None */\ns1->Belt.MutableSet.minimum /* Some(1) */\n```"
+ ],
+ "signature": "let minimum: t<'value, 'id> => option<'value>"
+ },
+ {
+ "id": "Belt.MutableSet.minUndefined",
+ "kind": "value",
+ "name": "minUndefined",
+ "docstrings": [
+ "Returns minimum value of the collection. `undefined` if collection is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.make(~id=module(IntCmp))\nlet s1 = Belt.MutableSet.fromArray([3, 2, 1, 5], ~id=module(IntCmp))\n\ns0->Belt.MutableSet.minUndefined /* undefined */\ns1->Belt.MutableSet.minUndefined /* 1 */\n```"
+ ],
+ "signature": "let minUndefined: t<'value, 'id> => Js.undefined<'value>"
+ },
+ {
+ "id": "Belt.MutableSet.maximum",
+ "kind": "value",
+ "name": "maximum",
+ "docstrings": [
+ "Returns maximum value of the collection. `None` if collection is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.make(~id=module(IntCmp))\nlet s1 = Belt.MutableSet.fromArray([3, 2, 1, 5], ~id=module(IntCmp))\n\ns0->Belt.MutableSet.maximum /* None */\ns1->Belt.MutableSet.maximum /* Some(5) */\n```"
+ ],
+ "signature": "let maximum: t<'value, 'id> => option<'value>"
+ },
+ {
+ "id": "Belt.MutableSet.maxUndefined",
+ "kind": "value",
+ "name": "maxUndefined",
+ "docstrings": [
+ "Returns maximum value of the collection. `undefined` if collection is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.make(~id=module(IntCmp))\nlet s1 = Belt.MutableSet.fromArray([3, 2, 1, 5], ~id=module(IntCmp))\n\ns0->Belt.MutableSet.maxUndefined /* undefined */\ns1->Belt.MutableSet.maxUndefined /* 5 */\n```"
+ ],
+ "signature": "let maxUndefined: t<'value, 'id> => Js.undefined<'value>"
+ },
+ {
+ "id": "Belt.MutableSet.get",
+ "kind": "value",
+ "name": "get",
+ "docstrings": [
+ "Returns the reference of the value which is equivalent to value using the comparator specifiecd by this collection. Returns `None` if element does not exist.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([1, 2, 3, 4, 5], ~id=module(IntCmp))\n\ns0->Belt.MutableSet.get(3) /* Some(3) */\ns0->Belt.MutableSet.get(20) /* None */\n```"
+ ],
+ "signature": "let get: (t<'value, 'id>, 'value) => option<'value>"
+ },
+ {
+ "id": "Belt.MutableSet.getUndefined",
+ "kind": "value",
+ "name": "getUndefined",
+ "docstrings": [
+ "Same as `Belt.MutableSet.get` but returns `undefined` when element does not exist."
+ ],
+ "signature": "let getUndefined: (t<'value, 'id>, 'value) => Js.undefined<'value>"
+ },
+ {
+ "id": "Belt.MutableSet.getExn",
+ "kind": "value",
+ "name": "getExn",
+ "docstrings": [
+ "Same as `Belt.MutableSet.get` but raise when element does not exist."
+ ],
+ "signature": "let getExn: (t<'value, 'id>, 'value) => 'value"
+ },
+ {
+ "id": "Belt.MutableSet.split",
+ "kind": "value",
+ "name": "split",
+ "docstrings": [
+ "Returns a tuple `((smaller, larger), present)`, `present` is true when element exist in set.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet s0 = Belt.MutableSet.fromArray([1, 2, 3, 4, 5], ~id=module(IntCmp))\n\nlet ((smaller, larger), present) = s0->Belt.MutableSet.split(3)\n\npresent /* true */\nsmaller->Belt.MutableSet.toArray /* [1,2] */\nlarger->Belt.MutableSet.toArray /* [4,5] */\n```"
+ ],
+ "signature": "let split: (\n t<'value, 'id>,\n 'value,\n) => ((t<'value, 'id>, t<'value, 'id>), bool)"
+ },
+ {
+ "id": "Belt.MutableSet.checkInvariantInternal",
+ "kind": "value",
+ "name": "checkInvariantInternal",
+ "docstrings": ["**raise** when invariant is not held"],
+ "signature": "let checkInvariantInternal: t<'a, 'b> => unit"
+ }
+ ]
+ },
+ "belt/map": {
+ "id": "Belt.Map",
+ "name": "Map",
+ "docstrings": [
+ "[`Belt.Map`](),\n\n The top level provides generic **immutable** map operations.\n\n It also has three specialized inner modules\n [`Belt.Map.Int`](), [`Belt.Map.String`]() and\n\n [`Belt.Map.Dict`](): This module separates data from function\n which is more verbose but slightly more efficient",
+ "The top level provides generic immutable map operations.\n\nIt also has three specialized inner modules `Belt.Map.Int`, `Belt.Map.String`\nand `Belt.Map.Dict`."
+ ],
+ "items": [
+ {
+ "id": "Belt.Map.t",
+ "kind": "type",
+ "name": "t",
+ "docstrings": [
+ "`'key` is the field type\n\n`'value` is the element type\n\n`'identity` the identity of the collection"
+ ],
+ "signature": "type t<'key, 'value, 'identity>"
+ },
+ {
+ "id": "Belt.Map.id",
+ "kind": "type",
+ "name": "id",
+ "docstrings": ["The identity needed for making an empty map."],
+ "signature": "type id<'key, 'id> = Belt_Id.comparable<'key, 'id>"
+ },
+ {
+ "id": "Belt.Map.make",
+ "kind": "value",
+ "name": "make",
+ "docstrings": [
+ "`make(~id)` creates a new map by taking in the comparator.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nlet m = Belt.Map.make(~id=module(IntCmp))\n\nBelt.Map.set(m, 0, \"a\")\n```"
+ ],
+ "signature": "let make: (~id: id<'k, 'id>) => t<'k, 'v, 'id>"
+ },
+ {
+ "id": "Belt.Map.isEmpty",
+ "kind": "value",
+ "name": "isEmpty",
+ "docstrings": [
+ "`isEmpty(m)` checks whether a map m is empty.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nBelt.Map.isEmpty(Belt.Map.fromArray([(1, \"1\")], ~id=module(IntCmp))) == false\n```"
+ ],
+ "signature": "let isEmpty: t<'a, 'b, 'c> => bool"
+ },
+ {
+ "id": "Belt.Map.has",
+ "kind": "value",
+ "name": "has",
+ "docstrings": [
+ "`has(m, k)` checks whether `m` has the key `k`.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nBelt.Map.has(Belt.Map.fromArray([(1, \"1\")], ~id=module(IntCmp)), 1) == true\n```"
+ ],
+ "signature": "let has: (t<'k, 'v, 'id>, 'k) => bool"
+ },
+ {
+ "id": "Belt.Map.cmpU",
+ "kind": "value",
+ "name": "cmpU",
+ "docstrings": [],
+ "signature": "let cmpU: (t<'k, 'v, 'id>, t<'k, 'v, 'id>, ('v, 'v) => int) => int"
+ },
+ {
+ "id": "Belt.Map.cmp",
+ "kind": "value",
+ "name": "cmp",
+ "docstrings": [
+ "`cmp(m0, m1, vcmp);`\n\nTotal ordering of map given total ordering of value function.\n\nIt will compare size first and each element following the order one by one."
+ ],
+ "signature": "let cmp: (t<'k, 'v, 'id>, t<'k, 'v, 'id>, ('v, 'v) => int) => int"
+ },
+ {
+ "id": "Belt.Map.eqU",
+ "kind": "value",
+ "name": "eqU",
+ "docstrings": [],
+ "signature": "let eqU: (t<'k, 'v, 'id>, t<'k, 'v, 'id>, ('v, 'v) => bool) => bool"
+ },
+ {
+ "id": "Belt.Map.eq",
+ "kind": "value",
+ "name": "eq",
+ "docstrings": [
+ "eq(m1, m2, veq)` tests whether the maps `m1` and `m2` are equal, that is,\ncontain equal keys and associate them with equal data. `veq` is the\nequality predicate used to compare the data associated with the keys."
+ ],
+ "signature": "let eq: (t<'k, 'v, 'id>, t<'k, 'v, 'id>, ('v, 'v) => bool) => bool"
+ },
+ {
+ "id": "Belt.Map.findFirstByU",
+ "kind": "value",
+ "name": "findFirstByU",
+ "docstrings": [],
+ "signature": "let findFirstByU: (t<'k, 'v, 'id>, ('k, 'v) => bool) => option<('k, 'v)>"
+ },
+ {
+ "id": "Belt.Map.findFirstBy",
+ "kind": "value",
+ "name": "findFirstBy",
+ "docstrings": [
+ "`\nfindFirstBy(m, p)` uses function `f` to find the first key value pair to match predicate `p`.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nlet s0 = Belt.Map.fromArray(~id=module(IntCmp), [(4, \"4\"), (1, \"1\"), (2, \"2\"), (3, \"\")])\n\nBelt.Map.findFirstBy(s0, (k, v) => k == 4) /* (4, \"4\") */\n```"
+ ],
+ "signature": "let findFirstBy: (t<'k, 'v, 'id>, ('k, 'v) => bool) => option<('k, 'v)>"
+ },
+ {
+ "id": "Belt.Map.forEachU",
+ "kind": "value",
+ "name": "forEachU",
+ "docstrings": [],
+ "signature": "let forEachU: (t<'k, 'v, 'id>, ('k, 'v) => unit) => unit"
+ },
+ {
+ "id": "Belt.Map.forEach",
+ "kind": "value",
+ "name": "forEach",
+ "docstrings": [
+ "`forEach(m, f)` applies `f` to all bindings in map `m`. `f` receives the\n`'k` as first argument, and the associated value as second argument. The\nbindings are passed to `f` in increasing order with respect to the ordering\nover the type of the keys.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nlet s0 = Belt.Map.fromArray(~id=module(IntCmp), [(4, \"4\"), (1, \"1\"), (2, \"2\"), (3, \"\")])\n\nlet acc = ref(list{})\n\nBelt.Map.forEach(s0, (k, v) => acc := list{(k, v), ...acc.contents})\n\nacc.contents == list{(4, \"4\"), (3, \"3\"), (2, \"2\"), (1, \"1\")}\n```"
+ ],
+ "signature": "let forEach: (t<'k, 'v, 'id>, ('k, 'v) => unit) => unit"
+ },
+ {
+ "id": "Belt.Map.reduceU",
+ "kind": "value",
+ "name": "reduceU",
+ "docstrings": [],
+ "signature": "let reduceU: (t<'k, 'v, 'id>, 'acc, ('acc, 'k, 'v) => 'acc) => 'acc"
+ },
+ {
+ "id": "Belt.Map.reduce",
+ "kind": "value",
+ "name": "reduce",
+ "docstrings": [
+ "`reduce(m, a, f)` computes `(f(kN, dN) ... (f(k1, d1, a))...)`, where `k1\n... kN` are the keys of all bindings in m (in increasing order), and `d1\n... dN` are the associated data.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nlet s0 = Belt.Map.fromArray(~id=module(IntCmp), [(4, \"4\"), (1, \"1\"), (2, \"2\"), (3, \"3\")])\n\nBelt.Map.reduce(s0, list{}, (acc, k, v) => list{\n (k, v),\n ...acc,\n}) /* [(4, \"4\"), (3, \"3\"), (2, \"2\"), (1, \"1\"), 0] */\n```"
+ ],
+ "signature": "let reduce: (t<'k, 'v, 'id>, 'acc, ('acc, 'k, 'v) => 'acc) => 'acc"
+ },
+ {
+ "id": "Belt.Map.everyU",
+ "kind": "value",
+ "name": "everyU",
+ "docstrings": [],
+ "signature": "let everyU: (t<'k, 'v, 'id>, ('k, 'v) => bool) => bool"
+ },
+ {
+ "id": "Belt.Map.every",
+ "kind": "value",
+ "name": "every",
+ "docstrings": [
+ "`every(m, p)` checks if all the bindings of the map satisfy the predicate\n`p`. Order unspecified"
+ ],
+ "signature": "let every: (t<'k, 'v, 'id>, ('k, 'v) => bool) => bool"
+ },
+ {
+ "id": "Belt.Map.someU",
+ "kind": "value",
+ "name": "someU",
+ "docstrings": [],
+ "signature": "let someU: (t<'k, 'v, 'id>, ('k, 'v) => bool) => bool"
+ },
+ {
+ "id": "Belt.Map.some",
+ "kind": "value",
+ "name": "some",
+ "docstrings": [
+ "`some(m, p)` checks if at least one binding of the map satisfy the predicate \n`p`. Order unspecified"
+ ],
+ "signature": "let some: (t<'k, 'v, 'id>, ('k, 'v) => bool) => bool"
+ },
+ {
+ "id": "Belt.Map.size",
+ "kind": "value",
+ "name": "size",
+ "docstrings": [
+ "`size(s)`\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nBelt.Map.size(Belt.Map.fromArray([(2, \"2\"), (2, \"1\"), (3, \"3\")], ~id=module(IntCmp))) == 2\n```"
+ ],
+ "signature": "let size: t<'k, 'v, 'id> => int"
+ },
+ {
+ "id": "Belt.Map.toArray",
+ "kind": "value",
+ "name": "toArray",
+ "docstrings": [
+ "`toArray(s)`\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nBelt.Map.toArray(Belt.Map.fromArray([(2, \"2\"), (1, \"1\"), (3, \"3\")], ~id=module(IntCmp))) == [\n (1, \"1\"),\n (2, \"2\"),\n (3, \"3\"),\n ]\n```"
+ ],
+ "signature": "let toArray: t<'k, 'v, 'id> => array<('k, 'v)>"
+ },
+ {
+ "id": "Belt.Map.toList",
+ "kind": "value",
+ "name": "toList",
+ "docstrings": ["In increasing order. See `Belt.Map.toArray`"],
+ "signature": "let toList: t<'k, 'v, 'id> => list<('k, 'v)>"
+ },
+ {
+ "id": "Belt.Map.fromArray",
+ "kind": "value",
+ "name": "fromArray",
+ "docstrings": [
+ "`fromArray(kvs, ~id);`\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nBelt.Map.toArray(Belt.Map.fromArray([(2, \"2\"), (1, \"1\"), (3, \"3\")], ~id=module(IntCmp))) == [\n (1, \"1\"),\n (2, \"2\"),\n (3, \"3\"),\n ]\n```"
+ ],
+ "signature": "let fromArray: (array<('k, 'v)>, ~id: id<'k, 'id>) => t<'k, 'v, 'id>"
+ },
+ {
+ "id": "Belt.Map.keysToArray",
+ "kind": "value",
+ "name": "keysToArray",
+ "docstrings": [
+ "`keysToArray(s);`\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nBelt.Map.keysToArray(Belt.Map.fromArray([(2, \"2\"), (1, \"1\"), (3, \"3\")], ~id=module(IntCmp))) == [\n 1,\n 2,\n 3,\n ]\n```"
+ ],
+ "signature": "let keysToArray: t<'k, 'v, 'id> => array<'k>"
+ },
+ {
+ "id": "Belt.Map.valuesToArray",
+ "kind": "value",
+ "name": "valuesToArray",
+ "docstrings": [
+ "`valuesToArray(s);`\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nBelt.Map.valuesToArray(\n Belt.Map.fromArray([(2, \"2\"), (1, \"1\"), (3, \"3\")], ~id=module(IntCmp)),\n) == [\"1\", \"2\", \"3\"]\n```"
+ ],
+ "signature": "let valuesToArray: t<'k, 'v, 'id> => array<'v>"
+ },
+ {
+ "id": "Belt.Map.minKey",
+ "kind": "value",
+ "name": "minKey",
+ "docstrings": [
+ "`minKey(s)` returns the minimum key, None if not exist."
+ ],
+ "signature": "let minKey: t<'k, 'a, 'b> => option<'k>"
+ },
+ {
+ "id": "Belt.Map.minKeyUndefined",
+ "kind": "value",
+ "name": "minKeyUndefined",
+ "docstrings": ["See `Belt.Map.minKey`"],
+ "signature": "let minKeyUndefined: t<'k, 'a, 'b> => Js.undefined<'k>"
+ },
+ {
+ "id": "Belt.Map.maxKey",
+ "kind": "value",
+ "name": "maxKey",
+ "docstrings": [
+ "`maxKey(s)` returns the maximum key, None if not exist."
+ ],
+ "signature": "let maxKey: t<'k, 'a, 'b> => option<'k>"
+ },
+ {
+ "id": "Belt.Map.maxKeyUndefined",
+ "kind": "value",
+ "name": "maxKeyUndefined",
+ "docstrings": ["See `Belt.Map.maxKey`"],
+ "signature": "let maxKeyUndefined: t<'k, 'a, 'b> => Js.undefined<'k>"
+ },
+ {
+ "id": "Belt.Map.minimum",
+ "kind": "value",
+ "name": "minimum",
+ "docstrings": [
+ "`minimum(s)` returns the minimum key value pair, None if not exist."
+ ],
+ "signature": "let minimum: t<'k, 'v, 'a> => option<('k, 'v)>"
+ },
+ {
+ "id": "Belt.Map.minUndefined",
+ "kind": "value",
+ "name": "minUndefined",
+ "docstrings": ["See `Belt.Map.minimum`"],
+ "signature": "let minUndefined: t<'k, 'v, 'a> => Js.undefined<('k, 'v)>"
+ },
+ {
+ "id": "Belt.Map.maximum",
+ "kind": "value",
+ "name": "maximum",
+ "docstrings": [
+ "`maximum(s)` returns the maximum key value pair, None if not exist."
+ ],
+ "signature": "let maximum: t<'k, 'v, 'a> => option<('k, 'v)>"
+ },
+ {
+ "id": "Belt.Map.maxUndefined",
+ "kind": "value",
+ "name": "maxUndefined",
+ "docstrings": ["See `Belt.Map.maximum`"],
+ "signature": "let maxUndefined: t<'k, 'v, 'a> => Js.undefined<('k, 'v)>"
+ },
+ {
+ "id": "Belt.Map.get",
+ "kind": "value",
+ "name": "get",
+ "docstrings": [
+ "`get(s, k)`\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nBelt.Map.get(Belt.Map.fromArray([(2, \"2\"), (1, \"1\"), (3, \"3\")], ~id=module(IntCmp)), 2) ==\n Some(\"2\")\n\nBelt.Map.get(Belt.Map.fromArray([(2, \"2\"), (1, \"1\"), (3, \"3\")], ~id=module(IntCmp)), 2) == None\n```"
+ ],
+ "signature": "let get: (t<'k, 'v, 'id>, 'k) => option<'v>"
+ },
+ {
+ "id": "Belt.Map.getUndefined",
+ "kind": "value",
+ "name": "getUndefined",
+ "docstrings": [
+ "See `Belt.Map.get`. Returns `undefined` when not found"
+ ],
+ "signature": "let getUndefined: (t<'k, 'v, 'id>, 'k) => Js.undefined<'v>"
+ },
+ {
+ "id": "Belt.Map.getWithDefault",
+ "kind": "value",
+ "name": "getWithDefault",
+ "docstrings": [
+ "`getWithDefault(s, k, default)`\n\nSee `Belt.Map.get`\n\nReturns default when `k` is not found."
+ ],
+ "signature": "let getWithDefault: (t<'k, 'v, 'id>, 'k, 'v) => 'v"
+ },
+ {
+ "id": "Belt.Map.getExn",
+ "kind": "value",
+ "name": "getExn",
+ "docstrings": [
+ "`getExn(s, k)`\n\nSee `Belt.Map.getExn`\n\nraise when `k` not exist"
+ ],
+ "signature": "let getExn: (t<'k, 'v, 'id>, 'k) => 'v"
+ },
+ {
+ "id": "Belt.Map.remove",
+ "kind": "value",
+ "name": "remove",
+ "docstrings": [
+ "`remove(m, x)` when `x` is not in `m`, `m` is returned reference unchanged.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nlet s0 = Belt.Map.fromArray([(2, \"2\"), (1, \"1\"), (3, \"3\")], ~id=module(IntCmp))\n\nlet s1 = Belt.Map.remove(s0, 1)\n\nlet s2 = Belt.Map.remove(s1, 1)\n\ns1 === s2\n\nBelt.Map.keysToArray(s1) == [2, 3]\n```"
+ ],
+ "signature": "let remove: (t<'k, 'v, 'id>, 'k) => t<'k, 'v, 'id>"
+ },
+ {
+ "id": "Belt.Map.removeMany",
+ "kind": "value",
+ "name": "removeMany",
+ "docstrings": [
+ "`removeMany(s, xs)`\n\nRemoving each of `xs` to `s`, note unlike `Belt.Map.remove`, the reference\nof return value might be changed even if none in `xs` exists `s`."
+ ],
+ "signature": "let removeMany: (t<'k, 'v, 'id>, array<'k>) => t<'k, 'v, 'id>"
+ },
+ {
+ "id": "Belt.Map.set",
+ "kind": "value",
+ "name": "set",
+ "docstrings": [
+ "`set(m, x, y)` returns a map containing the same bindings as `m`, with a\nnew binding of `x` to `y`. If `x` was already bound in `m`, its previous\nbinding disappears.\n\n## Examples\n\n```rescript\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = (a, b) => Pervasives.compare(a, b)\n})\n\nlet s0 = Belt.Map.fromArray([(2, \"2\"), (1, \"1\"), (3, \"3\")], ~id=module(IntCmp))\n\nlet s1 = Belt.Map.set(s0, 2, \"3\")\n\nBelt.Map.valuesToArray(s1) == [\"1\", \"3\", \"3\"]\n```"
+ ],
+ "signature": "let set: (t<'k, 'v, 'id>, 'k, 'v) => t<'k, 'v, 'id>"
+ },
+ {
+ "id": "Belt.Map.updateU",
+ "kind": "value",
+ "name": "updateU",
+ "docstrings": [],
+ "signature": "let updateU: (\n t<'k, 'v, 'id>,\n 'k,\n option<'v> => option<'v>,\n) => t<'k, 'v, 'id>"
+ },
+ {
+ "id": "Belt.Map.update",
+ "kind": "value",
+ "name": "update",
+ "docstrings": [
+ "`update(m, x, f)` returns a map containing the same bindings as `m`, except\nfor the binding of `x`. Depending on the value of `y` where `y` is\n`f(get(m, x))`, the binding of `x` is added, removed or updated. If `y` is\n`None`, the binding is removed if it exists; otherwise, if `y` is `Some(z)`\nthen `x` is associated to `z` in the resulting map."
+ ],
+ "signature": "let update: (\n t<'k, 'v, 'id>,\n 'k,\n option<'v> => option<'v>,\n) => t<'k, 'v, 'id>"
+ },
+ {
+ "id": "Belt.Map.mergeMany",
+ "kind": "value",
+ "name": "mergeMany",
+ "docstrings": [
+ "`mergeMany(s, xs)`\n\nAdding each of `xs` to `s`, note unlike `add`, the reference of return\nvalue might be changed even if all values in `xs` exist `s`."
+ ],
+ "signature": "let mergeMany: (t<'k, 'v, 'id>, array<('k, 'v)>) => t<'k, 'v, 'id>"
+ },
+ {
+ "id": "Belt.Map.mergeU",
+ "kind": "value",
+ "name": "mergeU",
+ "docstrings": [],
+ "signature": "let mergeU: (\n t<'k, 'v, 'id>,\n t<'k, 'v2, 'id>,\n ('k, option<'v>, option<'v2>) => option<'v3>,\n) => t<'k, 'v3, 'id>"
+ },
+ {
+ "id": "Belt.Map.merge",
+ "kind": "value",
+ "name": "merge",
+ "docstrings": [
+ "`merge(m1, m2, f)` computes a map whose keys is a subset of keys of `m1`\nand of `m2`. The presence of each such binding, and the corresponding\nvalue, is determined with the function `f`."
+ ],
+ "signature": "let merge: (\n t<'k, 'v, 'id>,\n t<'k, 'v2, 'id>,\n ('k, option<'v>, option<'v2>) => option<'v3>,\n) => t<'k, 'v3, 'id>"
+ },
+ {
+ "id": "Belt.Map.keepU",
+ "kind": "value",
+ "name": "keepU",
+ "docstrings": [],
+ "signature": "let keepU: (t<'k, 'v, 'id>, ('k, 'v) => bool) => t<'k, 'v, 'id>"
+ },
+ {
+ "id": "Belt.Map.keep",
+ "kind": "value",
+ "name": "keep",
+ "docstrings": [
+ "`keep(m, p)` returns the map with all the bindings in m that satisfy\npredicate `p`."
+ ],
+ "signature": "let keep: (t<'k, 'v, 'id>, ('k, 'v) => bool) => t<'k, 'v, 'id>"
+ },
+ {
+ "id": "Belt.Map.partitionU",
+ "kind": "value",
+ "name": "partitionU",
+ "docstrings": [],
+ "signature": "let partitionU: (\n t<'k, 'v, 'id>,\n ('k, 'v) => bool,\n) => (t<'k, 'v, 'id>, t<'k, 'v, 'id>)"
+ },
+ {
+ "id": "Belt.Map.partition",
+ "kind": "value",
+ "name": "partition",
+ "docstrings": [
+ "`partition(m, p)` returns a pair of maps `(m1, m2)`, where `m1` contains\nall the bindings of `s` that satisfy the predicate `p`, and `m2` is the map\nwith all the bindings of `s` that do not satisfy `p`."
+ ],
+ "signature": "let partition: (\n t<'k, 'v, 'id>,\n ('k, 'v) => bool,\n) => (t<'k, 'v, 'id>, t<'k, 'v, 'id>)"
+ },
+ {
+ "id": "Belt.Map.split",
+ "kind": "value",
+ "name": "split",
+ "docstrings": [
+ "`split(x, m)` returns a tuple `(l, r)`, data, where `l` is the map with all\nthe bindings of `m` whose 'k is strictly less than `x`; `r` is the map with\nall the bindings of m whose 'k is strictly greater than `x`; `data` is\n`None` if `m` contains no binding for `x`, or `Some(v)` if `m` binds `v` to\n`x`."
+ ],
+ "signature": "let split: (\n t<'k, 'v, 'id>,\n 'k,\n) => ((t<'k, 'v, 'id>, t<'k, 'v, 'id>), option<'v>)"
+ },
+ {
+ "id": "Belt.Map.mapU",
+ "kind": "value",
+ "name": "mapU",
+ "docstrings": [],
+ "signature": "let mapU: (t<'k, 'v, 'id>, 'v => 'v2) => t<'k, 'v2, 'id>"
+ },
+ {
+ "id": "Belt.Map.map",
+ "kind": "value",
+ "name": "map",
+ "docstrings": [
+ "`map(m, f) returns a map with same domain as`m`, where the associated\nvalue`a`of all bindings of`m`has been replaced by the result of the\napplication of`f`to`a`. The bindings are passed to`f` in increasing order\nwith respect to the ordering over the type of the keys."
+ ],
+ "signature": "let map: (t<'k, 'v, 'id>, 'v => 'v2) => t<'k, 'v2, 'id>"
+ },
+ {
+ "id": "Belt.Map.mapWithKeyU",
+ "kind": "value",
+ "name": "mapWithKeyU",
+ "docstrings": [],
+ "signature": "let mapWithKeyU: (t<'k, 'v, 'id>, ('k, 'v) => 'v2) => t<'k, 'v2, 'id>"
+ },
+ {
+ "id": "Belt.Map.mapWithKey",
+ "kind": "value",
+ "name": "mapWithKey",
+ "docstrings": [
+ "`mapWithKey(m, f)`\n\nThe same as `Belt.Map.map` except that `f` is supplied with one more\nargument: the key."
+ ],
+ "signature": "let mapWithKey: (t<'k, 'v, 'id>, ('k, 'v) => 'v2) => t<'k, 'v2, 'id>"
+ },
+ {
+ "id": "Belt.Map.getData",
+ "kind": "value",
+ "name": "getData",
+ "docstrings": [
+ "`getData(s0)`\n\nAdvanced usage only\n\nReturns the raw data (detached from comparator), but its type is still\nmanifested, so that user can pass identity directly without boxing."
+ ],
+ "signature": "let getData: t<'k, 'v, 'id> => Belt_MapDict.t<'k, 'v, 'id>"
+ },
+ {
+ "id": "Belt.Map.getId",
+ "kind": "value",
+ "name": "getId",
+ "docstrings": ["Advanced usage only. Returns the identity of s0."],
+ "signature": "let getId: t<'k, 'v, 'id> => id<'k, 'id>"
+ },
+ {
+ "id": "Belt.Map.packIdData",
+ "kind": "value",
+ "name": "packIdData",
+ "docstrings": [
+ "`packIdData(~id, ~data)`\n\nAdvanced usage only\n\nReturns the packed collection."
+ ],
+ "signature": "let packIdData: (\n ~id: id<'k, 'id>,\n ~data: Belt_MapDict.t<'k, 'v, 'id>,\n) => t<'k, 'v, 'id>"
+ },
+ {
+ "id": "Belt.Map.checkInvariantInternal",
+ "kind": "value",
+ "name": "checkInvariantInternal",
+ "docstrings": ["**raise** when invariant is not held"],
+ "signature": "let checkInvariantInternal: t<'a, 'b, 'c> => unit"
+ }
+ ]
+ },
+ "belt/set": {
+ "id": "Belt.Set",
+ "name": "Set",
+ "docstrings": [
+ "[`Belt.Set`]()\n\n The top level provides generic **immutable** set operations.\n\n It also has three specialized inner modules\n [`Belt.Set.Int`](), [`Belt.Set.String`]() and\n\n [`Belt.Set.Dict`](): This module separates data from function\n which is more verbose but slightly more efficient",
+ "An _immutable_ sorted set module which allows customized _compare_ behavior.\n\nThe implementation uses balanced binary trees, and therefore searching\nand insertion take time logarithmic in the size of the map.\n\nFor more info on this module's usage of identity, `make` and others, please see\nthe top level documentation of Belt, **A special encoding for collection safety**.\n\n## Examples\n\n```rescript\nmodule PairComparator =\n Belt.Id.MakeComparable({\n type t = (int, int)\n let cmp = ((a0, a1), (b0, b1)) =>\n switch (Pervasives.compare(a0, b0)) {\n | 0 => Pervasives.compare(a1, b1)\n | c => c\n }\n })\n\nlet mySet = Belt.Set.make(~id=module(PairComparator))\nlet mySet2 = Belt.Set.add(mySet, (1, 2))\n```\n\n**Note:** This module's examples will assume a predeclared module for integers\ncalled `IntCmp`. It is declared like this:\n\n```rescript\nmodule IntCmp =\n Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n })\n```"
+ ],
+ "items": [
+ {
+ "id": "Belt.Set.t",
+ "kind": "type",
+ "name": "t",
+ "docstrings": [
+ "`'value` is the element type\n\n`'identity` the identity of the collection"
+ ],
+ "signature": "type t<'value, 'identity>"
+ },
+ {
+ "id": "Belt.Set.id",
+ "kind": "type",
+ "name": "id",
+ "docstrings": ["The identity needed for making a set from scratch"],
+ "signature": "type id<'value, 'id> = Belt_Id.comparable<'value, 'id>"
+ },
+ {
+ "id": "Belt.Set.make",
+ "kind": "value",
+ "name": "make",
+ "docstrings": [
+ "Creates a new set by taking in the comparator\n\n## Examples\n\n```rescript\nlet set = Belt.Set.make(~id=module(IntCmp))\n```"
+ ],
+ "signature": "let make: (~id: id<'value, 'id>) => t<'value, 'id>"
+ },
+ {
+ "id": "Belt.Set.fromArray",
+ "kind": "value",
+ "name": "fromArray",
+ "docstrings": [
+ "Creates new set from array of elements.\n\n## Examples\n\n```rescript\nlet s0 = Belt.Set.fromArray([1, 3, 2, 4], ~id=module(IntCmp))\n\ns0->Belt.Set.toArray /* [1, 2, 3, 4] */\n```"
+ ],
+ "signature": "let fromArray: (array<'value>, ~id: id<'value, 'id>) => t<'value, 'id>"
+ },
+ {
+ "id": "Belt.Set.fromSortedArrayUnsafe",
+ "kind": "value",
+ "name": "fromSortedArrayUnsafe",
+ "docstrings": [
+ "The same as [fromArray][#fromarray] except it is after assuming the input array\nis already sorted."
+ ],
+ "signature": "let fromSortedArrayUnsafe: (array<'value>, ~id: id<'value, 'id>) => t<'value, 'id>"
+ },
+ {
+ "id": "Belt.Set.isEmpty",
+ "kind": "value",
+ "name": "isEmpty",
+ "docstrings": [
+ "Checks if set is empty.\n\n## Examples\n\n```rescript\nlet empty = Belt.Set.fromArray([], ~id=module(IntCmp))\nlet notEmpty = Belt.Set.fromArray([1],~id=module(IntCmp))\n\nBelt.Set.isEmpty(empty) /* true */\nBelt.Set.isEmpty(notEmpty) /* false */\n```"
+ ],
+ "signature": "let isEmpty: t<'a, 'b> => bool"
+ },
+ {
+ "id": "Belt.Set.has",
+ "kind": "value",
+ "name": "has",
+ "docstrings": [
+ "Checks if element exists in set.\n\n## Examples\n\n```rescript\nlet set = Belt.Set.fromArray([1, 4, 2, 5], ~id=module(IntCmp))\n\nset->Belt.Set.has(3) /* false */\nset->Belt.Set.has(1) /* true */\n```"
+ ],
+ "signature": "let has: (t<'value, 'id>, 'value) => bool"
+ },
+ {
+ "id": "Belt.Set.add",
+ "kind": "value",
+ "name": "add",
+ "docstrings": [
+ "Adds element to set. If element existed in set, value is unchanged.\n\n## Examples\n\n```rescript\nlet s0 = Belt.Set.make(~id=module(IntCmp))\nlet s1 = s0->Belt.Set.add(1)\nlet s2 = s1->Belt.Set.add(2)\nlet s3 = s2->Belt.Set.add(2)\ns0->Belt.Set.toArray /* [] */\ns1->Belt.Set.toArray /* [1] */\ns2->Belt.Set.toArray /* [1, 2] */\ns3->Belt.Set.toArray /* [1,2 ] */\ns2 == s3 /* true */\n```"
+ ],
+ "signature": "let add: (t<'value, 'id>, 'value) => t<'value, 'id>"
+ },
+ {
+ "id": "Belt.Set.mergeMany",
+ "kind": "value",
+ "name": "mergeMany",
+ "docstrings": [
+ "Adds each element of array to set. Unlike `Belt.Set.add`](#add), the reference of return value might be changed even if all values in array already exist in set\n\n## Examples\n\n```rescript\nlet set = Belt.Set.make(~id=module(IntCmp))\n\nlet newSet = set->Belt.Set.mergeMany([5, 4, 3, 2, 1])\nnewSet->Belt.Set.toArray /* [1, 2, 3, 4, 5] */\n```"
+ ],
+ "signature": "let mergeMany: (t<'value, 'id>, array<'value>) => t<'value, 'id>"
+ },
+ {
+ "id": "Belt.Set.remove",
+ "kind": "value",
+ "name": "remove",
+ "docstrings": [
+ "Removes element from set. If element did not exist in set, value is unchanged.\n\n## Examples\n\n```rescript\nlet s0 = Belt.Set.fromArray([2,3,1,4,5], ~id=module(IntCmp))\nlet s1 = s0->Belt.Set.remove(1)\nlet s2 = s1->Belt.Set.remove(3)\nlet s3 = s2->Belt.Set.remove(3)\n\ns1->Belt.Set.toArray /* [2,3,4,5] */\ns2->Belt.Set.toArray /* [2,4,5] */\ns2 == s3 /* true */\n```"
+ ],
+ "signature": "let remove: (t<'value, 'id>, 'value) => t<'value, 'id>"
+ },
+ {
+ "id": "Belt.Set.removeMany",
+ "kind": "value",
+ "name": "removeMany",
+ "docstrings": [
+ "Removes each element of array from set. Unlike [remove](#remove), the reference of return value might be changed even if none of values in array existed in set.\n\n## Examples\n\n```rescript\nlet set = Belt.Set.fromArray([1, 2, 3, 4],~id=module(IntCmp))\n\nlet newSet = set->Belt.Set.removeMany([5, 4, 3, 2, 1])\nnewSet->Belt.Set.toArray /* [] */\n```"
+ ],
+ "signature": "let removeMany: (t<'value, 'id>, array<'value>) => t<'value, 'id>"
+ },
+ {
+ "id": "Belt.Set.union",
+ "kind": "value",
+ "name": "union",
+ "docstrings": [
+ "Returns union of two sets.\n\n## Examples\n\n```rescript\nlet s0 = Belt.Set.fromArray([5,2,3,5,6], ~id=module(IntCmp))\nlet s1 = Belt.Set.fromArray([5,2,3,1,5,4], ~id=module(IntCmp))\nlet union = Belt.Set.union(s0, s1)\nunion->Belt.Set.toArray /* [1,2,3,4,5,6] */\n```"
+ ],
+ "signature": "let union: (t<'value, 'id>, t<'value, 'id>) => t<'value, 'id>"
+ },
+ {
+ "id": "Belt.Set.intersect",
+ "kind": "value",
+ "name": "intersect",
+ "docstrings": [
+ "Returns intersection of two sets.\n\n## Examples\n\n```rescript\nlet s0 = Belt.Set.fromArray([5,2,3,5,6], ~id=module(IntCmp))\nlet s1 = Belt.Set.fromArray([5,2,3,1,5,4], ~id=module(IntCmp))\nlet intersect = Belt.Set.intersect(s0, s1)\nintersect->Belt.Set.toArray /* [2,3,5] */\n```"
+ ],
+ "signature": "let intersect: (t<'value, 'id>, t<'value, 'id>) => t<'value, 'id>"
+ },
+ {
+ "id": "Belt.Set.diff",
+ "kind": "value",
+ "name": "diff",
+ "docstrings": [
+ "Returns elements from first set, not existing in second set.\n\n## Examples\n\n```rescript\nlet s0 = Belt.Set.fromArray([5,2,3,5,6], ~id=module(IntCmp))\nlet s1 = Belt.Set.fromArray([5,2,3,1,5,4], ~id=module(IntCmp))\nBelt.Set.toArray(Belt.Set.diff(s0, s1)) /* [6] */\nBelt.Set.toArray(Belt.Set.diff(s1,s0)) /* [1,4] */\n```"
+ ],
+ "signature": "let diff: (t<'value, 'id>, t<'value, 'id>) => t<'value, 'id>"
+ },
+ {
+ "id": "Belt.Set.subset",
+ "kind": "value",
+ "name": "subset",
+ "docstrings": [
+ "Checks if second set is subset of first set.\n\n## Examples\n\n```rescript\nlet s0 = Belt.Set.fromArray([5,2,3,5,6], ~id=module(IntCmp))\nlet s1 = Belt.Set.fromArray([5,2,3,1,5,4], ~id=module(IntCmp))\nlet s2 = Belt.Set.intersect(s0, s1)\nBelt.Set.subset(s2, s0) /* true */\nBelt.Set.subset(s2, s1) /* true */\nBelt.Set.subset(s1, s0) /* false */\n```"
+ ],
+ "signature": "let subset: (t<'value, 'id>, t<'value, 'id>) => bool"
+ },
+ {
+ "id": "Belt.Set.cmp",
+ "kind": "value",
+ "name": "cmp",
+ "docstrings": [
+ "Total ordering between sets. Can be used as the ordering function for doing sets\nof sets. It compares size first and then iterates over each element following\nthe order of elements."
+ ],
+ "signature": "let cmp: (t<'value, 'id>, t<'value, 'id>) => int"
+ },
+ {
+ "id": "Belt.Set.eq",
+ "kind": "value",
+ "name": "eq",
+ "docstrings": [
+ "Checks if two sets are equal.\n\n## Examples\n\n```rescript\nlet s0 = Belt.Set.fromArray([5,2,3], ~id=module(IntCmp))\nlet s1 = Belt.Set.fromArray([3,2,5], ~id=module(IntCmp))\n\nBelt.Set.eq(s0, s1) /* true */\n```"
+ ],
+ "signature": "let eq: (t<'value, 'id>, t<'value, 'id>) => bool"
+ },
+ {
+ "id": "Belt.Set.forEachU",
+ "kind": "value",
+ "name": "forEachU",
+ "docstrings": [
+ "Same as [forEach](#forEach) but takes uncurried functon."
+ ],
+ "signature": "let forEachU: (t<'value, 'id>, 'value => unit) => unit"
+ },
+ {
+ "id": "Belt.Set.forEach",
+ "kind": "value",
+ "name": "forEach",
+ "docstrings": [
+ "Applies function `f` in turn to all elements of set in increasing order.\n\n## Examples\n\n```rescript\nlet s0 = Belt.Set.fromArray([5,2,3,5,6], ~id=module(IntCmp))\nlet acc = ref(list{})\ns0->Belt.Set.forEach(x => {\n acc := Belt.List.add(acc.contents, x)\n})\nacc /* [6,5,3,2] */\n```"
+ ],
+ "signature": "let forEach: (t<'value, 'id>, 'value => unit) => unit"
+ },
+ {
+ "id": "Belt.Set.reduceU",
+ "kind": "value",
+ "name": "reduceU",
+ "docstrings": [],
+ "signature": "let reduceU: (t<'value, 'id>, 'a, ('a, 'value) => 'a) => 'a"
+ },
+ {
+ "id": "Belt.Set.reduce",
+ "kind": "value",
+ "name": "reduce",
+ "docstrings": [
+ "Applies function `f` to each element of set in increasing order. Function `f` has two parameters: the item from the set and an “accumulator”, which starts with a value of `initialValue`. `reduce` returns the final value of the accumulator.\n\n## Examples\n\n```rescript\nlet s0 = Belt.Set.fromArray([5,2,3,5,6], ~id=module(IntCmp))\ns0->Belt.Set.reduce(list{}, (acc, element) =>\n acc->Belt.List.add(element)\n) /* [6,5,3,2] */\n```"
+ ],
+ "signature": "let reduce: (t<'value, 'id>, 'a, ('a, 'value) => 'a) => 'a"
+ },
+ {
+ "id": "Belt.Set.everyU",
+ "kind": "value",
+ "name": "everyU",
+ "docstrings": [],
+ "signature": "let everyU: (t<'value, 'id>, 'value => bool) => bool"
+ },
+ {
+ "id": "Belt.Set.every",
+ "kind": "value",
+ "name": "every",
+ "docstrings": [
+ "Checks if all elements of the set satisfy the predicate. Order unspecified.\n\n## Examples\n\n```rescript\nlet isEven = x => mod(x, 2) == 0\n\nlet s0 = Belt.Set.fromArray([2,4,6,8], ~id=module(IntCmp))\ns0->Belt.Set.every(isEven) /* true */\n```"
+ ],
+ "signature": "let every: (t<'value, 'id>, 'value => bool) => bool"
+ },
+ {
+ "id": "Belt.Set.someU",
+ "kind": "value",
+ "name": "someU",
+ "docstrings": [],
+ "signature": "let someU: (t<'value, 'id>, 'value => bool) => bool"
+ },
+ {
+ "id": "Belt.Set.some",
+ "kind": "value",
+ "name": "some",
+ "docstrings": [
+ "Checks if at least one element of the set satisfies the predicate.\n\n## Examples\n\n```rescript\nlet isOdd = x => mod(x, 2) != 0\n\nlet s0 = Belt.Set.fromArray([1,2,4,6,8], ~id=module(IntCmp))\ns0->Belt.Set.some(isOdd) /* true */\n```"
+ ],
+ "signature": "let some: (t<'value, 'id>, 'value => bool) => bool"
+ },
+ {
+ "id": "Belt.Set.keepU",
+ "kind": "value",
+ "name": "keepU",
+ "docstrings": [],
+ "signature": "let keepU: (t<'value, 'id>, 'value => bool) => t<'value, 'id>"
+ },
+ {
+ "id": "Belt.Set.keep",
+ "kind": "value",
+ "name": "keep",
+ "docstrings": [
+ "Returns the set of all elements that satisfy the predicate.\n\n## Examples\n\n```rescript\nlet isEven = x => mod(x, 2) == 0\n\nlet s0 = Belt.Set.fromArray([1,2,3,4,5], ~id=module(IntCmp))\nlet s1 = s0->Belt.Set.keep(isEven)\n\ns1->Belt.Set.toArray /* [2,4] */\n```"
+ ],
+ "signature": "let keep: (t<'value, 'id>, 'value => bool) => t<'value, 'id>"
+ },
+ {
+ "id": "Belt.Set.partitionU",
+ "kind": "value",
+ "name": "partitionU",
+ "docstrings": [],
+ "signature": "let partitionU: (\n t<'value, 'id>,\n 'value => bool,\n) => (t<'value, 'id>, t<'value, 'id>)"
+ },
+ {
+ "id": "Belt.Set.partition",
+ "kind": "value",
+ "name": "partition",
+ "docstrings": [
+ "Returns a pair of sets, where first is the set of all the elements of set that satisfy the predicate, and second is the set of all the elements of set that do not satisfy the predicate.\n\n## Examples\n\n```rescript\nlet isOdd = x => mod(x, 2) != 0\n\nlet s0 = Belt.Set.fromArray([1,2,3,4,5], ~id=module(IntCmp))\nlet (s1, s2) = s0->Belt.Set.partition(isOdd)\n\ns1->Belt.Set.toArray /* [1,3,5] */\ns2->Belt.Set.toArray /* [2,4] */\n```"
+ ],
+ "signature": "let partition: (\n t<'value, 'id>,\n 'value => bool,\n) => (t<'value, 'id>, t<'value, 'id>)"
+ },
+ {
+ "id": "Belt.Set.size",
+ "kind": "value",
+ "name": "size",
+ "docstrings": [
+ "Returns size of the set.\n\n## Examples\n\n```rescript\nlet s0 = Belt.Set.fromArray([1,2,3,4], ~id=module(IntCmp))\n\ns0->Belt.Set.size /* 4 */\n```"
+ ],
+ "signature": "let size: t<'value, 'id> => int"
+ },
+ {
+ "id": "Belt.Set.toArray",
+ "kind": "value",
+ "name": "toArray",
+ "docstrings": [
+ "Returns array of ordered set elements.\n\n## Examples\n\n```rescript\nlet s0 = Belt.Set.fromArray([3,2,1,5], ~id=module(IntCmp))\n\ns0->Belt.Set.toArray /* [1,2,3,5] */\n```"
+ ],
+ "signature": "let toArray: t<'value, 'id> => array<'value>"
+ },
+ {
+ "id": "Belt.Set.toList",
+ "kind": "value",
+ "name": "toList",
+ "docstrings": [
+ "Returns list of ordered set elements.\n\n## Examples\n\n```rescript\nlet s0 = Belt.Set.fromArray([3,2,1,5], ~id=module(IntCmp))\n\ns0->Belt.Set.toList /* [1,2,3,5] */\n```"
+ ],
+ "signature": "let toList: t<'value, 'id> => list<'value>"
+ },
+ {
+ "id": "Belt.Set.minimum",
+ "kind": "value",
+ "name": "minimum",
+ "docstrings": [
+ "Returns minimum value of the collection. `None` if collection is empty.\n\n## Examples\n\n```rescript\nlet s0 = Belt.Set.make(~id=module(IntCmp))\nlet s1 = Belt.Set.fromArray([3,2,1,5], ~id=module(IntCmp))\n\ns0->Belt.Set.minimum /* None */\ns1->Belt.Set.minimum /* Some(1) */\n```"
+ ],
+ "signature": "let minimum: t<'value, 'id> => option<'value>"
+ },
+ {
+ "id": "Belt.Set.minUndefined",
+ "kind": "value",
+ "name": "minUndefined",
+ "docstrings": [
+ "Returns minimum value of the collection. `undefined` if collection is empty.\n\n## Examples\n\n```rescript\nlet s0 = Belt.Set.make(~id=module(IntCmp))\nlet s1 = Belt.Set.fromArray([3,2,1,5], ~id=module(IntCmp))\n\ns0->Belt.Set.minUndefined /* undefined */\ns1->Belt.Set.minUndefined /* 1 */\n```"
+ ],
+ "signature": "let minUndefined: t<'value, 'id> => Js.undefined<'value>"
+ },
+ {
+ "id": "Belt.Set.maximum",
+ "kind": "value",
+ "name": "maximum",
+ "docstrings": [
+ "Returns maximum value of the collection. `None` if collection is empty.\n\n## Examples\n\n```rescript\nlet s0 = Belt.Set.make(~id=module(IntCmp))\nlet s1 = Belt.Set.fromArray([3,2,1,5], ~id=module(IntCmp))\n\ns0->Belt.Set.maximum /* None */\ns1->Belt.Set.maximum /* Some(5) */\n```"
+ ],
+ "signature": "let maximum: t<'value, 'id> => option<'value>"
+ },
+ {
+ "id": "Belt.Set.maxUndefined",
+ "kind": "value",
+ "name": "maxUndefined",
+ "docstrings": [
+ "Returns maximum value of the collection. `undefined` if collection is empty.\n\n## Examples\n\n```rescript\nlet s0 = Belt.Set.make(~id=module(IntCmp))\nlet s1 = Belt.Set.fromArray([3,2,1,5], ~id=module(IntCmp))\n\ns0->Belt.Set.maxUndefined /* undefined */\ns1->Belt.Set.maxUndefined /* 5 */\n```"
+ ],
+ "signature": "let maxUndefined: t<'value, 'id> => Js.undefined<'value>"
+ },
+ {
+ "id": "Belt.Set.get",
+ "kind": "value",
+ "name": "get",
+ "docstrings": [
+ "Returns the reference of the value which is equivalent to value using the comparator specifiecd by this collection. Returns `None` if element does not exist.\n\n## Examples\n\n```rescript\nlet s0 = Belt.Set.fromArray([1,2,3,4,5], ~id=module(IntCmp))\n\ns0->Belt.Set.get(3) /* Some(3) */\ns0->Belt.Set.get(20) /* None */\n```"
+ ],
+ "signature": "let get: (t<'value, 'id>, 'value) => option<'value>"
+ },
+ {
+ "id": "Belt.Set.getUndefined",
+ "kind": "value",
+ "name": "getUndefined",
+ "docstrings": [
+ "Same as [get](#get) but returns `undefined` when element does not exist."
+ ],
+ "signature": "let getUndefined: (t<'value, 'id>, 'value) => Js.undefined<'value>"
+ },
+ {
+ "id": "Belt.Set.getExn",
+ "kind": "value",
+ "name": "getExn",
+ "docstrings": [
+ "Same as [get](#get) but raise when element does not exist."
+ ],
+ "signature": "let getExn: (t<'value, 'id>, 'value) => 'value"
+ },
+ {
+ "id": "Belt.Set.split",
+ "kind": "value",
+ "name": "split",
+ "docstrings": [
+ "Returns a tuple `((smaller, larger), present)`, `present` is true when element exist in set.\n\n## Examples\n\n```rescript\nlet s0 = Belt.Set.fromArray([1,2,3,4,5], ~id=module(IntCmp))\n\nlet ((smaller, larger), present) = s0->Belt.Set.split(3)\n\npresent /* true */\nsmaller->Belt.Set.toArray /* [1,2] */\nlarger->Belt.Set.toArray /* [4,5] */\n\n```"
+ ],
+ "signature": "let split: (\n t<'value, 'id>,\n 'value,\n) => ((t<'value, 'id>, t<'value, 'id>), bool)"
+ },
+ {
+ "id": "Belt.Set.checkInvariantInternal",
+ "kind": "value",
+ "name": "checkInvariantInternal",
+ "docstrings": ["**raise** when invariant is not held"],
+ "signature": "let checkInvariantInternal: t<'a, 'b> => unit"
+ },
+ {
+ "id": "Belt.Set.getData",
+ "kind": "value",
+ "name": "getData",
+ "docstrings": [
+ "**Advanced usage only**\n\nReturns the raw data (detached from comparator), but its type is still manifested,\nso that user can pass identity directly without boxing."
+ ],
+ "signature": "let getData: t<'value, 'id> => Belt_SetDict.t<'value, 'id>"
+ },
+ {
+ "id": "Belt.Set.getId",
+ "kind": "value",
+ "name": "getId",
+ "docstrings": [
+ "**Advanced usage only**\n\nReturns the identity of set."
+ ],
+ "signature": "let getId: t<'value, 'id> => id<'value, 'id>"
+ },
+ {
+ "id": "Belt.Set.packIdData",
+ "kind": "value",
+ "name": "packIdData",
+ "docstrings": [
+ "**Advanced usage only**\n\nReturns the packed collection."
+ ],
+ "signature": "let packIdData: (\n ~id: id<'value, 'id>,\n ~data: Belt_SetDict.t<'value, 'id>,\n) => t<'value, 'id>"
+ }
+ ]
+ },
+ "belt/range": {
+ "id": "Belt.Range",
+ "name": "Range",
+ "docstrings": [
+ "[`Belt.Range`]()\n\n Utilities for a closed range `(from, start)`",
+ "A small utility module to provide inclusive range operations for `[start, finish]`.\nInternally it is relying on loops instead of creating new arrays, which makes it\npretty performant and memory friendly."
+ ],
+ "items": [
+ {
+ "id": "Belt.Range.forEachU",
+ "kind": "value",
+ "name": "forEachU",
+ "docstrings": [],
+ "signature": "let forEachU: (int, int, int => unit) => unit"
+ },
+ {
+ "id": "Belt.Range.forEach",
+ "kind": "value",
+ "name": "forEach",
+ "docstrings": [
+ "`forEach(start, finish, action)` equivalent to `Belt.Array.forEach(Belt.Array.range(start, finish), action))`\n\n## Examples\n\n```rescript\nBelt.Range.forEach(0, 4, (i) => Js.log(i))\n\n// Prints:\n// 0\n// 1\n// 2\n// 3\n// 4\n```"
+ ],
+ "signature": "let forEach: (int, int, int => unit) => unit"
+ },
+ {
+ "id": "Belt.Range.everyU",
+ "kind": "value",
+ "name": "everyU",
+ "docstrings": [],
+ "signature": "let everyU: (int, int, int => bool) => bool"
+ },
+ {
+ "id": "Belt.Range.every",
+ "kind": "value",
+ "name": "every",
+ "docstrings": [
+ "`every(start, finish, p)` equivalent to `Belt.Array.every(Belt.Array.range(start, finish), p)`\n## Examples\n\n```rescript\nBelt.Range.every(0, 4, (i) => i < 5) /* true */\n\nBelt.Range.every(0, 4, (i) => i < 4) /* false */\n```"
+ ],
+ "signature": "let every: (int, int, int => bool) => bool"
+ },
+ {
+ "id": "Belt.Range.everyByU",
+ "kind": "value",
+ "name": "everyByU",
+ "docstrings": [],
+ "signature": "let everyByU: (int, int, ~step: int, int => bool) => bool"
+ },
+ {
+ "id": "Belt.Range.everyBy",
+ "kind": "value",
+ "name": "everyBy",
+ "docstrings": [
+ "`everyBy(start, finish, ~step, p)`. See `Belt.Array.rangeBy`, equivalent to\n`Belt.Array.every(Belt.Array.rangeBy(start, finish, ~step), p)`\n\n## Examples\n\n```rescript\nBelt.Range.everyBy(0, 4, ~step=1, (i) => mod(i, 2) === 0) /* false */\n\nBelt.Range.everyBy(0, 4, ~step=2, (i) => mod(i, 2) === 0) /* true */\n```"
+ ],
+ "signature": "let everyBy: (int, int, ~step: int, int => bool) => bool"
+ },
+ {
+ "id": "Belt.Range.someU",
+ "kind": "value",
+ "name": "someU",
+ "docstrings": [],
+ "signature": "let someU: (int, int, int => bool) => bool"
+ },
+ {
+ "id": "Belt.Range.some",
+ "kind": "value",
+ "name": "some",
+ "docstrings": [
+ "`some(start, finish, p)` equivalent to `Belt.Array.some(Belt.Array.range(start, finish), p)`\n\n## Examples\n\n```rescript\nBelt.Range.some(0, 4, (i) => i > 5) /* false */\n\nBelt.Range.some(0, 4, (i) => i > 2) /* true */\n```"
+ ],
+ "signature": "let some: (int, int, int => bool) => bool"
+ },
+ {
+ "id": "Belt.Range.someByU",
+ "kind": "value",
+ "name": "someByU",
+ "docstrings": [],
+ "signature": "let someByU: (int, int, ~step: int, int => bool) => bool"
+ },
+ {
+ "id": "Belt.Range.someBy",
+ "kind": "value",
+ "name": "someBy",
+ "docstrings": [
+ "`someBy(start, finish, ~step, p)` See `Belt.Array.rangeBy`, equivalent to\n`Belt.Array.some(Belt.Array.rangeBy(start, finish, ~step), p)`\n\n## Examples\n\n```rescript\nBelt.Range.someBy(1, 5, ~step=2, (i) => mod(i, 2) === 0) /* false */\nBelt.Range.someBy(0, 4, ~step=2, (i) => mod(i, 2) === 0) /* true */\n```"
+ ],
+ "signature": "let someBy: (int, int, ~step: int, int => bool) => bool"
+ }
+ ]
+ },
+ "belt/list": {
+ "id": "Belt.List",
+ "name": "List",
+ "docstrings": [
+ "[`Belt.List`]()\n\n Utilities for List data type",
+ "Collection functions for manipulating the `list` data structures, a singly-linked list.\n\n**Prefer Array** if you need any of the following:\n\n- Random access of element\n- Better interop with JavaScript\n- Better memory usage & performance."
+ ],
+ "items": [
+ {
+ "id": "Belt.List.t",
+ "kind": "type",
+ "name": "t",
+ "docstrings": ["`'a t` is compatible with built-in `list` type"],
+ "signature": "type t<'a> = list<'a>"
+ },
+ {
+ "id": "Belt.List.length",
+ "kind": "value",
+ "name": "length",
+ "docstrings": [
+ "Returns the length of a list.\n\n## Examples\n\n```rescript\nBelt.List.length(list{1, 2, 3}) // 3\n```"
+ ],
+ "signature": "let length: t<'a> => int"
+ },
+ {
+ "id": "Belt.List.size",
+ "kind": "value",
+ "name": "size",
+ "docstrings": ["See `Belt.List.length`"],
+ "signature": "let size: t<'a> => int"
+ },
+ {
+ "id": "Belt.List.head",
+ "kind": "value",
+ "name": "head",
+ "docstrings": [
+ "Returns `Some(value)` where `value` is the first element in the list, or\n`None` if `someList` is an empty list.\n\n## Examples\n\n```rescript\nBelt.List.head(list{}) // None\nBelt.List.head(list{1, 2, 3}) // Some(1)\n```"
+ ],
+ "signature": "let head: t<'a> => option<'a>"
+ },
+ {
+ "id": "Belt.List.headExn",
+ "kind": "value",
+ "name": "headExn",
+ "docstrings": [
+ "Same as `Belt.List.head` but raises an exception if `someList` is empty. Use\nwith care.\n\n## Examples\n\n```rescript\nBelt.List.headExn(list{1, 2, 3}) // 1\n\nBelt.List.headExn(list{}) // Raises an Error\n```"
+ ],
+ "signature": "let headExn: t<'a> => 'a"
+ },
+ {
+ "id": "Belt.List.tail",
+ "kind": "value",
+ "name": "tail",
+ "docstrings": [
+ "Returns `None` if `someList` is empty, otherwise it returns `Some(tail)`\nwhere `tail` is everything except the first element of `someList`.\n\n## Examples\n\n```rescript\nBelt.List.tail(list{1, 2, 3}) // Some(list{2, 3})\n\nBelt.List.tail(list{}) // None\n```"
+ ],
+ "signature": "let tail: t<'a> => option>"
+ },
+ {
+ "id": "Belt.List.tailExn",
+ "kind": "value",
+ "name": "tailExn",
+ "docstrings": [
+ "Same as `Belt.List.tail` but raises an exception if `someList` is empty. Use\nwith care.\n\n## Examples\n\n```rescript\nBelt.List.tailExn(list{1, 2, 3}) // list{2, 3}\n\nBelt.List.tailExn(list{}) // Raises an Error\n```"
+ ],
+ "signature": "let tailExn: t<'a> => t<'a>"
+ },
+ {
+ "id": "Belt.List.add",
+ "kind": "value",
+ "name": "add",
+ "docstrings": [
+ "Adds `value` to the beginning of `someList`.\n\n## Examples\n\n```rescript\nBelt.List.add(list{2, 3}, 1) // list{1, 2, 3}\n\nBelt.List.add(list{\"World\", \"!\"}, \"Hello\") // list{\"Hello\", \"World\", \"!\"}\n```"
+ ],
+ "signature": "let add: (t<'a>, 'a) => t<'a>"
+ },
+ {
+ "id": "Belt.List.get",
+ "kind": "value",
+ "name": "get",
+ "docstrings": [
+ "Return the nth element in `someList`, or `None` if `index` is larger than the\nlength.\n\n## Examples\n\n```rescript\nlet abc = list{\"A\", \"B\", \"C\"}\n\nabc->Belt.List.get(1) // Some(\"B\")\n\nabc->Belt.List.get(4) // None\n```"
+ ],
+ "signature": "let get: (t<'a>, int) => option<'a>"
+ },
+ {
+ "id": "Belt.List.getExn",
+ "kind": "value",
+ "name": "getExn",
+ "docstrings": [
+ "Same as `Belt.List.get` but raises an exception if `index` is larger than the\nlength. Use with care.\n\n## Examples\n\n```rescript\nlet abc = list{\"A\", \"B\", \"C\"}\n\nabc->Belt.List.getExn(1) // \"B\"\n\nabc->Belt.List.getExn(4) // Raises an Error\n```"
+ ],
+ "signature": "let getExn: (t<'a>, int) => 'a"
+ },
+ {
+ "id": "Belt.List.make",
+ "kind": "value",
+ "name": "make",
+ "docstrings": [
+ "Returns a list of length `numItems` with each element filled with value `v`. Returns an empty list if `numItems` is negative.\n\n## Examples\n\n```rescript\nBelt.List.make(3, 1) // list{1, 1, 1}\n```"
+ ],
+ "signature": "let make: (int, 'a) => t<'a>"
+ },
+ {
+ "id": "Belt.List.makeByU",
+ "kind": "value",
+ "name": "makeByU",
+ "docstrings": ["Uncurried version of [makeBy](#makeBy)"],
+ "signature": "let makeByU: (int, int => 'a) => t<'a>"
+ },
+ {
+ "id": "Belt.List.makeBy",
+ "kind": "value",
+ "name": "makeBy",
+ "docstrings": [
+ "Return a list of length `numItems` with element `i` initialized with `f(i)`.\nReturns an empty list if `numItems` is negative.\n\n## Examples\n\n```rescript\nBelt.List.makeBy(5, i => i) // list{0, 1, 2, 3, 4}\n\nBelt.List.makeBy(5, i => i * i) // list{0, 1, 4, 9, 16}\n```"
+ ],
+ "signature": "let makeBy: (int, int => 'a) => t<'a>"
+ },
+ {
+ "id": "Belt.List.shuffle",
+ "kind": "value",
+ "name": "shuffle",
+ "docstrings": [
+ "Returns a new list in random order.\n\n## Examples\n\n```rescript\nBelt.List.shuffle(list{1, 2, 3}) // list{2, 1, 3}\n```"
+ ],
+ "signature": "let shuffle: t<'a> => t<'a>"
+ },
+ {
+ "id": "Belt.List.drop",
+ "kind": "value",
+ "name": "drop",
+ "docstrings": [
+ "Return a new list, dropping the first `n` elements. Returns `None` if `someList` has fewer than `n` elements.\n\n## Examples\n\n```rescript\nlist{1, 2, 3}->Belt.List.drop(2) // Some(list{3})\n\nlist{1, 2, 3}->Belt.List.drop(3) // Some(list{})\n\nlist{1, 2, 3}->Belt.List.drop(4) // None\n```"
+ ],
+ "signature": "let drop: (t<'a>, int) => option>"
+ },
+ {
+ "id": "Belt.List.take",
+ "kind": "value",
+ "name": "take",
+ "docstrings": [
+ "Returns a list with the first `n` elements from `someList`, or `None` if `someList` has fewer than `n` elements.\n\n## Examples\n\n```rescript\nlist{1, 2, 3}->Belt.List.take(1) // Some(list{1})\n\nlist{1, 2, 3}->Belt.List.take(2) // Some(list{1, 2})\n\nlist{1, 2, 3}->Belt.List.take(4) // None\n```"
+ ],
+ "signature": "let take: (t<'a>, int) => option>"
+ },
+ {
+ "id": "Belt.List.splitAt",
+ "kind": "value",
+ "name": "splitAt",
+ "docstrings": [
+ "Split the list `someList` at `index`. Returns `None` when the length of `someList` is less than `index`.\n\n## Examples\n\n```rescript\nlist{\"Hello\", \"World\"}->Belt.List.splitAt(1) // Some((list{\"Hello\"}, list{\"World\"}))\n\nlist{0, 1, 2, 3, 4}->Belt.List.splitAt(2) // Some((list{0, 1}, list{2, 3, 4}))\n```"
+ ],
+ "signature": "let splitAt: (t<'a>, int) => option<(list<'a>, list<'a>)>"
+ },
+ {
+ "id": "Belt.List.concat",
+ "kind": "value",
+ "name": "concat",
+ "docstrings": [
+ "Returns the list obtained by adding `secondList` after `firstList`.\n\n## Examples\n\n```rescript\nBelt.List.concat(list{1, 2, 3}, list{4, 5}) // list{1, 2, 3, 4, 5}\n```"
+ ],
+ "signature": "let concat: (t<'a>, t<'a>) => t<'a>"
+ },
+ {
+ "id": "Belt.List.concatMany",
+ "kind": "value",
+ "name": "concatMany",
+ "docstrings": [
+ "Returns the list obtained by concatenating all the lists in array `a`, in\norder.\n\n## Examples\n\n```rescript\nBelt.List.concatMany([list{1, 2, 3}, list{}, list{3}]) // list{1, 2, 3, 3}\n```"
+ ],
+ "signature": "let concatMany: array> => t<'a>"
+ },
+ {
+ "id": "Belt.List.reverseConcat",
+ "kind": "value",
+ "name": "reverseConcat",
+ "docstrings": [
+ "Equivalent to writing: `concat(reverse(firstList, secondList)`\n\n## Examples\n\n```rescript\nBelt.List.reverseConcat(list{1, 2}, list{3, 4}) // list{2, 1, 3, 4}\n```"
+ ],
+ "signature": "let reverseConcat: (t<'a>, t<'a>) => t<'a>"
+ },
+ {
+ "id": "Belt.List.flatten",
+ "kind": "value",
+ "name": "flatten",
+ "docstrings": [
+ "Return the list obtained by concatenating all the lists in list `ls`, in order.\n\n## Examples\n\n```rescript\nBelt.List.flatten(list{list{1, 2, 3}, list{}, list{3}}) // list{1, 2, 3, 3}\n```"
+ ],
+ "signature": "let flatten: t> => t<'a>"
+ },
+ {
+ "id": "Belt.List.mapU",
+ "kind": "value",
+ "name": "mapU",
+ "docstrings": ["Uncurried version of [map](#map)."],
+ "signature": "let mapU: (t<'a>, 'a => 'b) => t<'b>"
+ },
+ {
+ "id": "Belt.List.map",
+ "kind": "value",
+ "name": "map",
+ "docstrings": [
+ "Returns a new list with `f` applied to each element of `someList`.\n\n## Examples\n\n```rescript\nlist{1, 2}->Belt.List.map(x => x + 1) // list{3, 4}\n```"
+ ],
+ "signature": "let map: (t<'a>, 'a => 'b) => t<'b>"
+ },
+ {
+ "id": "Belt.List.zip",
+ "kind": "value",
+ "name": "zip",
+ "docstrings": [
+ "Returns a list of pairs from the two lists with the length of the shorter list.\n\n## Examples\n\n```rescript\nBelt.List.zip(list{1, 2}, list{3, 4, 5}) // list{(1, 3), (2, 4)}\n```"
+ ],
+ "signature": "let zip: (t<'a>, t<'b>) => t<('a, 'b)>"
+ },
+ {
+ "id": "Belt.List.zipByU",
+ "kind": "value",
+ "name": "zipByU",
+ "docstrings": ["Uncurried version of [zipBy](#zipBy)."],
+ "signature": "let zipByU: (t<'a>, t<'b>, ('a, 'b) => 'c) => t<'c>"
+ },
+ {
+ "id": "Belt.List.zipBy",
+ "kind": "value",
+ "name": "zipBy",
+ "docstrings": [
+ "See [Belt.List.zip](#zip)\n\n## Examples\n\n```rescript\nBelt.List.zipBy(list{1, 2, 3}, list{4, 5}, (a, b) => 2 * a + b) // list{6, 9}\n```"
+ ],
+ "signature": "let zipBy: (t<'a>, t<'b>, ('a, 'b) => 'c) => t<'c>"
+ },
+ {
+ "id": "Belt.List.mapWithIndexU",
+ "kind": "value",
+ "name": "mapWithIndexU",
+ "docstrings": ["Uncurried version of [mapWithIndex](#mapWithIndex)."],
+ "signature": "let mapWithIndexU: (t<'a>, (int, 'a) => 'b) => t<'b>"
+ },
+ {
+ "id": "Belt.List.mapWithIndex",
+ "kind": "value",
+ "name": "mapWithIndex",
+ "docstrings": [
+ "Applies `f` to each element of `someList`.\nFunction `f` takes two arguments: the index starting from 0 and the element from `someList`, in that order.\n\n## Examples\n\n```rescript\nlist{1, 2, 3}->Belt.List.mapWithIndex((index, x) => index + x) // list{1, 3, 5}\n```"
+ ],
+ "signature": "let mapWithIndex: (t<'a>, (int, 'a) => 'b) => t<'b>"
+ },
+ {
+ "id": "Belt.List.fromArray",
+ "kind": "value",
+ "name": "fromArray",
+ "docstrings": [
+ "Converts the given array to a list.\n\n## Examples\n\n```rescript\nBelt.List.fromArray([1, 2, 3]) // list{1, 2, 3}\n```"
+ ],
+ "signature": "let fromArray: array<'a> => t<'a>"
+ },
+ {
+ "id": "Belt.List.toArray",
+ "kind": "value",
+ "name": "toArray",
+ "docstrings": [
+ "Converts the given list to an array.\n\n## Examples\n\n```rescript\nBelt.List.toArray(list{1, 2, 3}) // [1, 2, 3]\n```"
+ ],
+ "signature": "let toArray: t<'a> => array<'a>"
+ },
+ {
+ "id": "Belt.List.reverse",
+ "kind": "value",
+ "name": "reverse",
+ "docstrings": [
+ "Returns a new list whose elements are those of `someList` in reversed order.\n\n## Examples\n\n```rescript\nBelt.List.reverse(list{1, 2, 3}) /* list{3, 2, 1} */\n```"
+ ],
+ "signature": "let reverse: t<'a> => t<'a>"
+ },
+ {
+ "id": "Belt.List.mapReverseU",
+ "kind": "value",
+ "name": "mapReverseU",
+ "docstrings": ["Uncurried version of [mapReverse](#mapReverse)."],
+ "signature": "let mapReverseU: (t<'a>, 'a => 'b) => t<'b>"
+ },
+ {
+ "id": "Belt.List.mapReverse",
+ "kind": "value",
+ "name": "mapReverse",
+ "docstrings": [
+ "Equivalent to:\n\n```res\nmap(someList, f)->reverse\n```\n\n## Examples\n\n```rescript\nlist{3, 4, 5}->Belt.List.mapReverse(x => x * x) /* list{25, 16, 9} */\n```"
+ ],
+ "signature": "let mapReverse: (t<'a>, 'a => 'b) => t<'b>"
+ },
+ {
+ "id": "Belt.List.forEachU",
+ "kind": "value",
+ "name": "forEachU",
+ "docstrings": ["Uncurried version of [forEach](#forEach)."],
+ "signature": "let forEachU: (t<'a>, 'a => 'b) => unit"
+ },
+ {
+ "id": "Belt.List.forEach",
+ "kind": "value",
+ "name": "forEach",
+ "docstrings": [
+ "Call `f` on each element of `someList` from the beginning to end.\n`f` returns `unit`, so no new array is created. Use `forEach` when you are primarily concerned with repetitively creating side effects.\n\n## Examples\n\n```rescript\nBelt.List.forEach(list{\"a\", \"b\", \"c\"}, x => Js.log(\"Item: \" ++ x))\n/*\n prints:\n Item: a\n Item: b\n Item: c\n*/\n```"
+ ],
+ "signature": "let forEach: (t<'a>, 'a => 'b) => unit"
+ },
+ {
+ "id": "Belt.List.forEachWithIndexU",
+ "kind": "value",
+ "name": "forEachWithIndexU",
+ "docstrings": [
+ "Uncurried version of [forEachWithIndex](#forEachWithIndex)."
+ ],
+ "signature": "let forEachWithIndexU: (t<'a>, (int, 'a) => 'b) => unit"
+ },
+ {
+ "id": "Belt.List.forEachWithIndex",
+ "kind": "value",
+ "name": "forEachWithIndex",
+ "docstrings": [
+ "Call `f` on each element of `someList` from beginning to end.\nFunction `f` takes two arguments: the index starting from 0 and the element from `someList`. `f` returns `unit`.\n\n## Examples\n\n```rescript\nBelt.List.forEachWithIndex(list{\"a\", \"b\", \"c\"}, (index, x) => {\n Js.log(\"Item \" ++ Belt.Int.toString(index) ++ \" is \" ++ x)\n})\n/*\n prints:\n Item 0 is a\n Item 1 is b\n Item 2 is cc\n*/\n```"
+ ],
+ "signature": "let forEachWithIndex: (t<'a>, (int, 'a) => 'b) => unit"
+ },
+ {
+ "id": "Belt.List.reduceU",
+ "kind": "value",
+ "name": "reduceU",
+ "docstrings": ["Uncurried version of [reduce](#reduce)."],
+ "signature": "let reduceU: (t<'a>, 'b, ('b, 'a) => 'b) => 'b"
+ },
+ {
+ "id": "Belt.List.reduce",
+ "kind": "value",
+ "name": "reduce",
+ "docstrings": [
+ "Applies `f` to each element of `someList` from beginning to end. Function `f` has two parameters: the item from the list and an “accumulator”, which starts with a value of `initialValue`. reduce returns the final value of the accumulator.\n\n## Examples\n\n```rescript\nlist{1, 2, 3, 4}->Belt.List.reduce(0, (a, b) => a + b) /* 10 */\n\n/* same as */\n\nlist{1, 2, 3, 4}->Belt.List.reduce(0, (acc, item) => acc + item) /* 10 */\n```"
+ ],
+ "signature": "let reduce: (t<'a>, 'b, ('b, 'a) => 'b) => 'b"
+ },
+ {
+ "id": "Belt.List.reduceWithIndexU",
+ "kind": "value",
+ "name": "reduceWithIndexU",
+ "docstrings": [
+ "Uncurried version of [reduceWithIndex](#reduceWithIndex)."
+ ],
+ "signature": "let reduceWithIndexU: (t<'a>, 'b, ('b, 'a, int) => 'b) => 'b"
+ },
+ {
+ "id": "Belt.List.reduceWithIndex",
+ "kind": "value",
+ "name": "reduceWithIndex",
+ "docstrings": [
+ "Applies `f` to each element of `someList` from beginning to end. Function `f` has three parameters: the item from the list and an “accumulator”, which starts with a value of `initialValue` and the index of each element. `reduceWithIndex` returns the final value of the accumulator.\n\n## Examples\n\n```rescript\nlist{1, 2, 3, 4}->Belt.List.reduceWithIndex(0, (acc, item, index) => acc + item + index) /* 16 */\n```"
+ ],
+ "signature": "let reduceWithIndex: (t<'a>, 'b, ('b, 'a, int) => 'b) => 'b"
+ },
+ {
+ "id": "Belt.List.reduceReverseU",
+ "kind": "value",
+ "name": "reduceReverseU",
+ "docstrings": ["Uncurried version of [reduceReverse](#reduceReverse)."],
+ "signature": "let reduceReverseU: (t<'a>, 'b, ('b, 'a) => 'b) => 'b"
+ },
+ {
+ "id": "Belt.List.reduceReverse",
+ "kind": "value",
+ "name": "reduceReverse",
+ "docstrings": [
+ "Works like [reduce](#reduce), except that function `f` is applied to each\nitem of `someList` from the last back to the first.\n\n## Examples\n\n```rescript\nlist{1, 2, 3, 4}->Belt.List.reduceReverse(0, (a, b) => a + b) /* 10 */\n\nlist{1, 2, 3, 4}->Belt.List.reduceReverse(10, (a, b) => a - b) /* 0 */\n\nlist{1, 2, 3, 4}->Belt.List.reduceReverse(list{}, Belt.List.add) // list{1, 2, 3, 4}\n```"
+ ],
+ "signature": "let reduceReverse: (t<'a>, 'b, ('b, 'a) => 'b) => 'b"
+ },
+ {
+ "id": "Belt.List.mapReverse2U",
+ "kind": "value",
+ "name": "mapReverse2U",
+ "docstrings": ["Uncurried version of [mapReverse2](#mapReverse2)."],
+ "signature": "let mapReverse2U: (t<'a>, t<'b>, ('a, 'b) => 'c) => t<'c>"
+ },
+ {
+ "id": "Belt.List.mapReverse2",
+ "kind": "value",
+ "name": "mapReverse2",
+ "docstrings": [
+ "Equivalent to: `zipBy(xs, ys, f)->reverse`\n\n## Examples\n\n```rescript\n\nBelt.List.mapReverse2(list{1, 2, 3}, list{1, 2}, (a, b) => a + b) // list{4, 2}\n```"
+ ],
+ "signature": "let mapReverse2: (t<'a>, t<'b>, ('a, 'b) => 'c) => t<'c>"
+ },
+ {
+ "id": "Belt.List.forEach2U",
+ "kind": "value",
+ "name": "forEach2U",
+ "docstrings": ["Uncurried version of [forEach2](#forEach2)."],
+ "signature": "let forEach2U: (t<'a>, t<'b>, ('a, 'b) => 'c) => unit"
+ },
+ {
+ "id": "Belt.List.forEach2",
+ "kind": "value",
+ "name": "forEach2",
+ "docstrings": [
+ "Stops at the length of the shorter list.\n\n## Examples\n\n```rescript\nBelt.List.forEach2(list{\"Z\", \"Y\"}, list{\"A\", \"B\", \"C\"}, (x, y) => Js.log2(x, y))\n\n/*\n prints:\n \"Z\" \"A\"\n \"Y\" \"B\"\n*/\n```"
+ ],
+ "signature": "let forEach2: (t<'a>, t<'b>, ('a, 'b) => 'c) => unit"
+ },
+ {
+ "id": "Belt.List.reduce2U",
+ "kind": "value",
+ "name": "reduce2U",
+ "docstrings": ["Uncurried version of [reduce2](#reduce2)."],
+ "signature": "let reduce2U: (t<'b>, t<'c>, 'a, ('a, 'b, 'c) => 'a) => 'a"
+ },
+ {
+ "id": "Belt.List.reduce2",
+ "kind": "value",
+ "name": "reduce2",
+ "docstrings": [
+ "Applies `f` to each element of `firstList` and `secondList` from beginning to end. Stops with the shorter list. Function `f` has three parameters: an “accumulator” which starts with a value of `initialValue`, an item from `firstList`, and an item from `secondList`. `reduce2` returns the final value of the accumulator.\n\n## Examples\n\n```rescript\nBelt.List.reduce2(list{1, 2, 3}, list{4, 5}, 0, (acc, x, y) => acc + x * x + y) /* 0 + (1 * 1 + 4) + (2 * 2 + 5) */\n```"
+ ],
+ "signature": "let reduce2: (t<'b>, t<'c>, 'a, ('a, 'b, 'c) => 'a) => 'a"
+ },
+ {
+ "id": "Belt.List.reduceReverse2U",
+ "kind": "value",
+ "name": "reduceReverse2U",
+ "docstrings": [
+ "Uncurried version of [reduceReverse2](#reduceReverse2)."
+ ],
+ "signature": "let reduceReverse2U: (t<'a>, t<'b>, 'c, ('c, 'a, 'b) => 'c) => 'c"
+ },
+ {
+ "id": "Belt.List.reduceReverse2",
+ "kind": "value",
+ "name": "reduceReverse2",
+ "docstrings": [
+ "Applies `f` to each element of `firstList` and `secondList` from end to\nbeginning. Stops with the shorter list. Function `f` has three parameters: an\n“accumulator” which starts with a value of init, an item from `firstList`,\nand an item from `secondList`. `reduce2` returns the final value of the\naccumulator.\n\n## Examples\n\n```rescript\nBelt.List.reduceReverse2(list{1, 2, 3}, list{4, 5}, 0, (acc, x, y) => acc + x * x + y) /* + (1 * 1 + 4) + (2 * 2 + 5) */\n```"
+ ],
+ "signature": "let reduceReverse2: (t<'a>, t<'b>, 'c, ('c, 'a, 'b) => 'c) => 'c"
+ },
+ {
+ "id": "Belt.List.everyU",
+ "kind": "value",
+ "name": "everyU",
+ "docstrings": ["Uncurried version of [every](#every)."],
+ "signature": "let everyU: (t<'a>, 'a => bool) => bool"
+ },
+ {
+ "id": "Belt.List.every",
+ "kind": "value",
+ "name": "every",
+ "docstrings": [
+ "Returns `true` if all elements satisfy `pred`, where `pred` is a predicate: a function taking an element and returning a bool.\n\n## Examples\n\n```rescript\nlet isBelow10 = value => value < 10\n\nlist{1, 9, 8, 2}->Belt.List.every(isBelow10) /* true */\n\nlist{1, 99, 8, 2}->Belt.List.every(isBelow10) /* false */\n```"
+ ],
+ "signature": "let every: (t<'a>, 'a => bool) => bool"
+ },
+ {
+ "id": "Belt.List.someU",
+ "kind": "value",
+ "name": "someU",
+ "docstrings": ["Uncurried version of [some](#some)."],
+ "signature": "let someU: (t<'a>, 'a => bool) => bool"
+ },
+ {
+ "id": "Belt.List.some",
+ "kind": "value",
+ "name": "some",
+ "docstrings": [
+ "Returns `true` if at least _one_ of the elements in `someList` satisfies\n`pred`, where `pred` is a predicate: a function taking an element and\nreturning a bool.\n\n## Examples\n\n```rescript\nlet isAbove100 = value => value > 100\n\nlist{101, 1, 2, 3}->Belt.List.some(isAbove100) /* true */\n\nlist{1, 2, 3, 4}->Belt.List.some(isAbove100) /* false */\n```"
+ ],
+ "signature": "let some: (t<'a>, 'a => bool) => bool"
+ },
+ {
+ "id": "Belt.List.every2U",
+ "kind": "value",
+ "name": "every2U",
+ "docstrings": ["Uncurried version of [every2](#every2)."],
+ "signature": "let every2U: (t<'a>, t<'b>, ('a, 'b) => bool) => bool"
+ },
+ {
+ "id": "Belt.List.every2",
+ "kind": "value",
+ "name": "every2",
+ "docstrings": [
+ "Returns `true` if predicate `pred(a, b)` is `true` for all pairs of elements\nup to the shorter length (i.e. `min(length(firstList), length(secondList))`)\n\n## Examples\n\n```rescript\nBelt.List.every2(list{1, 2, 3}, list{0, 1}, (a, b) => a > b) /* true */\n\nBelt.List.every2(list{}, list{1}, (a, b) => a > b) /* true */\n\nBelt.List.every2(list{2, 3}, list{1}, (a, b) => a > b) /* true */\n\nBelt.List.every2(list{0, 1}, list{5, 0}, (a, b) => a > b) /* false */\n```"
+ ],
+ "signature": "let every2: (t<'a>, t<'b>, ('a, 'b) => bool) => bool"
+ },
+ {
+ "id": "Belt.List.some2U",
+ "kind": "value",
+ "name": "some2U",
+ "docstrings": ["Uncurried version of [some2](#some2)."],
+ "signature": "let some2U: (t<'a>, t<'b>, ('a, 'b) => bool) => bool"
+ },
+ {
+ "id": "Belt.List.some2",
+ "kind": "value",
+ "name": "some2",
+ "docstrings": [
+ "Returns `true` if predicate `pred(a, b)` is true for any pair of elements up\nto the shorter length (i.e. `min(length(firstList), length(secondList))`)\n\n## Examples\n\n```rescript\nBelt.List.some2(list{1, 2, 3}, list{0, 1}, (a, b) => a > b) /* true */\n\nBelt.List.some2(list{}, list{1}, (a, b) => a > b) /* false */\n\nBelt.List.some2(list{2, 3}, list{1}, (a, b) => a > b) /* true */\n\nBelt.List.some2(list{0, 1}, list{5, 0}, (a, b) => a > b) /* true */\n```"
+ ],
+ "signature": "let some2: (t<'a>, t<'b>, ('a, 'b) => bool) => bool"
+ },
+ {
+ "id": "Belt.List.cmpByLength",
+ "kind": "value",
+ "name": "cmpByLength",
+ "docstrings": [
+ "Compare two lists solely by length. Returns `-1` if `length(firstList)` is\nless than `length(secondList)`, `0` if `length(firstList)` equals\n`length(secondList)`, and `1` if `length(firstList)` is greater than\n`length(secondList)`.\n\n## Examples\n\n```rescript\nBelt.List.cmpByLength(list{1, 2}, list{3, 4, 5, 6}) /* -1 */\n\nBelt.List.cmpByLength(list{1, 2, 3}, list{4, 5, 6}) /* = 0 */\n\nBelt.List.cmpByLength(list{1, 2, 3, 4}, list{5, 6}) /* = 1 */\n```"
+ ],
+ "signature": "let cmpByLength: (t<'a>, t<'a>) => int"
+ },
+ {
+ "id": "Belt.List.cmpU",
+ "kind": "value",
+ "name": "cmpU",
+ "docstrings": ["Uncurried version of [cmp](#cmp)."],
+ "signature": "let cmpU: (t<'a>, t<'a>, ('a, 'a) => int) => int"
+ },
+ {
+ "id": "Belt.List.cmp",
+ "kind": "value",
+ "name": "cmp",
+ "docstrings": [
+ "Compare elements one by one `compareFn(a, b)`. `compareFn` returns a negative number if `a` is \"less than\" `b`, zero if `a` is \"equal to\" `b`, a positive number if `a` is \"greater than\" `b`.\n\nThe comparison returns the first non-zero result of `compareFn`, or zero if `compareFn` returns zero for all `a` and `b`.\n\nIf all items have compared equal, but `firstList` is exhausted first, return `-1`. (`firstList` is shorter).\nIf all items have compared equal, but `secondList` is exhausted first, return `1` (`firstList` is longer).\n\n## Examples\n\n```rescript\nBelt.List.cmp(list{3}, list{3, 7}, (a, b) => compare(a, b)) /* (-1) */\n\nBelt.List.cmp(list{5, 3}, list{5}, (a, b) => compare(a, b)) /* 1 */\n\nBelt.List.cmp(list{1, 3, 5}, list{1, 4, 2}, (a, b) => compare(a, b)) /* (-1) */\n\nBelt.List.cmp(list{1, 3, 5}, list{1, 2, 3}, (a, b) => compare(a, b)) /* 1 */\n\nBelt.List.cmp(list{1, 3, 5}, list{1, 3, 5}, (a, b) => compare(a, b)) /* 0 */\n```\n\n**Please note:** The total ordering of List is different from Array,\nfor Array, we compare the length first and, only if the lengths are equal, elements one by one.\nFor lists, we just compare elements one by one."
+ ],
+ "signature": "let cmp: (t<'a>, t<'a>, ('a, 'a) => int) => int"
+ },
+ {
+ "id": "Belt.List.eqU",
+ "kind": "value",
+ "name": "eqU",
+ "docstrings": ["Uncurried version of [eq](#eq)."],
+ "signature": "let eqU: (t<'a>, t<'a>, ('a, 'a) => bool) => bool"
+ },
+ {
+ "id": "Belt.List.eq",
+ "kind": "value",
+ "name": "eq",
+ "docstrings": [
+ "Check equality of `firstList` and `secondList` using `eqElem` for equality on\nelements, where `eqElem` is a function that returns `true` if items `x` and\n`y` meet some criterion for equality, `false` otherwise. eq `false` if length\nof `firstList` and `secondList` are not the same.\n\n## Examples\n\n```rescript\nBelt.List.eq(list{1, 2, 3}, list{1, 2}, (a, b) => a == b) /* false */\n\nBelt.List.eq(list{1, 2}, list{1, 2}, (a, b) => a == b) /* true */\n\nBelt.List.eq(list{1, 2, 3}, list{(-1), (-2), (-3)}, (a, b) => abs(a) == abs(b)) /* true */\n```"
+ ],
+ "signature": "let eq: (t<'a>, t<'a>, ('a, 'a) => bool) => bool"
+ },
+ {
+ "id": "Belt.List.hasU",
+ "kind": "value",
+ "name": "hasU",
+ "docstrings": ["Uncurried version of [has](#has)."],
+ "signature": "let hasU: (t<'a>, 'b, ('a, 'b) => bool) => bool"
+ },
+ {
+ "id": "Belt.List.has",
+ "kind": "value",
+ "name": "has",
+ "docstrings": [
+ "Returns `true` if the list contains at least one element for which\n`eqFunction(x)` returns true.\n\n## Examples\n\n```rescript\nlist{1, 2, 3}->Belt.List.has(2, (a, b) => a == b) /* true */\n\nlist{1, 2, 3}->Belt.List.has(4, (a, b) => a == b) /* false */\n\nlist{(-1), (-2), (-3)}->Belt.List.has(2, (a, b) => abs(a) == abs(b)) /* true */\n```"
+ ],
+ "signature": "let has: (t<'a>, 'b, ('a, 'b) => bool) => bool"
+ },
+ {
+ "id": "Belt.List.getByU",
+ "kind": "value",
+ "name": "getByU",
+ "docstrings": ["Uncurried version of [getBy](#getBy)."],
+ "signature": "let getByU: (t<'a>, 'a => bool) => option<'a>"
+ },
+ {
+ "id": "Belt.List.getBy",
+ "kind": "value",
+ "name": "getBy",
+ "docstrings": [
+ "Returns `Some(value)` for the first value in `someList` that satisfies the\npredicate function `pred`. Returns `None` if no element satisfies the function.\n\n## Examples\n\n```rescript\nBelt.List.getBy(list{1, 4, 3, 2}, x => x > 3) /* Some(4) */\n\nBelt.List.getBy(list{1, 4, 3, 2}, x => x > 4) /* None */\n```"
+ ],
+ "signature": "let getBy: (t<'a>, 'a => bool) => option<'a>"
+ },
+ {
+ "id": "Belt.List.keepU",
+ "kind": "value",
+ "name": "keepU",
+ "docstrings": ["Uncurried version of [keep](#keep)."],
+ "signature": "let keepU: (t<'a>, 'a => bool) => t<'a>"
+ },
+ {
+ "id": "Belt.List.keep",
+ "kind": "value",
+ "name": "keep",
+ "docstrings": [
+ "Returns a list of all elements in `someList` which satisfy the predicate function `pred`.\n\n## Examples\n\n```rescript\nlet isEven = x => mod(x, 2) == 0\n\nBelt.List.keep(list{1, 2, 3, 4}, isEven) /* list{2, 4} */\n\nBelt.List.keep(list{None, Some(2), Some(3), None}, Belt.Option.isSome) /* list{Some(2), Some(3)} */\n```"
+ ],
+ "signature": "let keep: (t<'a>, 'a => bool) => t<'a>"
+ },
+ {
+ "id": "Belt.List.filter",
+ "kind": "value",
+ "name": "filter",
+ "docstrings": [
+ "Returns a list of all elements in `someList` which satisfy the predicate function `pred`.\n\n## Examples\n\n```rescript\nlet isEven = x => mod(x, 2) == 0\n\nBelt.List.filter(list{1, 2, 3, 4}, isEven) /* list{2, 4} */\n\nBelt.List.filter(list{None, Some(2), Some(3), None}, Belt.Option.isSome) /* list{Some(2), Some(3)} */\n```"
+ ],
+ "signature": "let filter: (t<'a>, 'a => bool) => t<'a>",
+ "deprecated": "This function will soon be deprecated. Please, use `List.keep` instead."
+ },
+ {
+ "id": "Belt.List.keepWithIndexU",
+ "kind": "value",
+ "name": "keepWithIndexU",
+ "docstrings": ["Uncurried version of [keepWithIndex](#keepWithIndex)."],
+ "signature": "let keepWithIndexU: (t<'a>, ('a, int) => bool) => t<'a>"
+ },
+ {
+ "id": "Belt.List.keepWithIndex",
+ "kind": "value",
+ "name": "keepWithIndex",
+ "docstrings": [
+ "Returns a list of all elements in `someList` which satisfy the predicate function `pred`.\n\n## Examples\n\n```rescript\nlet isEven = x => mod(x, 2) == 0\n\nBelt.List.keepWithIndex(list{1, 2, 3, 4}, (_x, index) => isEven(index)) /* list{1, 3} */\n```"
+ ],
+ "signature": "let keepWithIndex: (t<'a>, ('a, int) => bool) => t<'a>"
+ },
+ {
+ "id": "Belt.List.filterWithIndex",
+ "kind": "value",
+ "name": "filterWithIndex",
+ "docstrings": [
+ "Returns a list of all elements in `someList` which satisfy the predicate function `pred`.\n\n## Examples\n\n```rescript\nlet isEven = x => mod(x, 2) == 0\n\nBelt.List.filterWithIndex(list{1, 2, 3, 4}, (_x, index) => isEven(index)) /* list{1, 3} */\n```"
+ ],
+ "signature": "let filterWithIndex: (t<'a>, ('a, int) => bool) => t<'a>",
+ "deprecated": "This function will soon be deprecated. Please, use `List.keepWithIndex` \\\n instead."
+ },
+ {
+ "id": "Belt.List.keepMapU",
+ "kind": "value",
+ "name": "keepMapU",
+ "docstrings": ["Uncurried version of [keepMap](#keepMap)."],
+ "signature": "let keepMapU: (t<'a>, 'a => option<'b>) => t<'b>"
+ },
+ {
+ "id": "Belt.List.keepMap",
+ "kind": "value",
+ "name": "keepMap",
+ "docstrings": [
+ "Applies `f` to each element of `someList`. If `f(x)` returns `Some(value)`, then `value` is _kept_ in the resulting list.\nIf `f(x)` returns `None`, the element is _not_ retained in the result.\n\n## Examples\n\n```rescript\nlet isEven = x => mod(x, 2) == 0\n\nlist{1, 2, 3, 4}\n->Belt.List.keepMap(x =>\n if (isEven(x)) {\n Some(x)\n } else {\n None\n }\n ) /* list{2, 4} */\n\nlist{Some(1), Some(2), None}->Belt.List.keepMap(x => x) /* list{1, 2} */\n```"
+ ],
+ "signature": "let keepMap: (t<'a>, 'a => option<'b>) => t<'b>"
+ },
+ {
+ "id": "Belt.List.partitionU",
+ "kind": "value",
+ "name": "partitionU",
+ "docstrings": ["Uncurried version of [partition](#partition)."],
+ "signature": "let partitionU: (t<'a>, 'a => bool) => (t<'a>, t<'a>)"
+ },
+ {
+ "id": "Belt.List.partition",
+ "kind": "value",
+ "name": "partition",
+ "docstrings": [
+ "Creates a pair of lists; the first list consists of all elements of `someList` that satisfy the predicate function `pred`; the second list consists of all elements of `someList` that _do not_ satisfy `pred.\n\nIn other words:\n\n```rescript\n(elementsThatSatisfies, elementsThatDoesNotSatisfy)\n```\n\n## Examples\n\n```rescript\nBelt.List.partition(list{1, 2, 3, 4}, x => x > 2) /* (list{3, 4}, list{1, 2}) */\n```"
+ ],
+ "signature": "let partition: (t<'a>, 'a => bool) => (t<'a>, t<'a>)"
+ },
+ {
+ "id": "Belt.List.unzip",
+ "kind": "value",
+ "name": "unzip",
+ "docstrings": [
+ "Takes a list of pairs and creates a pair of lists. The first list contains all the first items of the pairs; the second list contains all the second items.\n\n## Examples\n\n```rescript\nBelt.List.unzip(list{(1, 2), (3, 4)}) /* (list{1, 3}, list{2, 4}) */\n\nBelt.List.unzip(list{(\"H\", \"W\"), (\"e\", \"o\"), (\"l\", \"r\"), (\"l\", \"l\"), (\"o\", \"d\"), (\" \", \"!\")})\n/* (list{\"H\", \"e\", \"l\", \"l\", \"o\", \" \"}, list{\"W\", \"o\", \"r\", \"l\", \"d\", \"!\"}) */\n```"
+ ],
+ "signature": "let unzip: t<('a, 'b)> => (t<'a>, t<'b>)"
+ },
+ {
+ "id": "Belt.List.getAssocU",
+ "kind": "value",
+ "name": "getAssocU",
+ "docstrings": ["Uncurried version of [getAssoc](#getAssoc)."],
+ "signature": "let getAssocU: (t<('a, 'c)>, 'b, ('a, 'b) => bool) => option<'c>"
+ },
+ {
+ "id": "Belt.List.getAssoc",
+ "kind": "value",
+ "name": "getAssoc",
+ "docstrings": [
+ "Return the second element of a pair in `someList` where the first element equals `k` as per the predicate function `eqFunction`, or `None` if not found.\n\n## Examples\n\n```rescript\nlist{(1, \"a\"), (2, \"b\"), (3, \"c\")}->Belt.List.getAssoc(3, (a, b) => a == b) /* Some(\"c\") */\n\nlist{(9, \"morning\"), (15, \"afternoon\"), (22, \"night\")}\n->Belt.List.getAssoc(15, (k, item) => k /* 15 */ == item /* 9, 5, 22 */)\n/* Some(\"afternoon\") */\n```"
+ ],
+ "signature": "let getAssoc: (t<('a, 'c)>, 'b, ('a, 'b) => bool) => option<'c>"
+ },
+ {
+ "id": "Belt.List.hasAssocU",
+ "kind": "value",
+ "name": "hasAssocU",
+ "docstrings": ["Uncurried version of [hasAssoc](#hasAssoc)."],
+ "signature": "let hasAssocU: (t<('a, 'c)>, 'b, ('a, 'b) => bool) => bool"
+ },
+ {
+ "id": "Belt.List.hasAssoc",
+ "kind": "value",
+ "name": "hasAssoc",
+ "docstrings": [
+ "Returns `true` if there is a pair in `someList` where the first element equals `k` as per the predicate function `eqFunction`.\n\n## Examples\n\n```rescript\nlist{(1, \"a\"), (2, \"b\"), (3, \"c\")}->Belt.List.hasAssoc(1, (a, b) => a == b) /* true */\n\nlist{(9, \"morning\"), (15, \"afternoon\"), (22, \"night\")}\n->Belt.List.hasAssoc(25, (k, item) => k /* 25 */ == item /* 9, 5, 22 */) /* false */\n```"
+ ],
+ "signature": "let hasAssoc: (t<('a, 'c)>, 'b, ('a, 'b) => bool) => bool"
+ },
+ {
+ "id": "Belt.List.removeAssocU",
+ "kind": "value",
+ "name": "removeAssocU",
+ "docstrings": ["Uncurried version of [removeAssoc](#removeAssoc)."],
+ "signature": "let removeAssocU: (t<('a, 'c)>, 'b, ('a, 'b) => bool) => t<('a, 'c)>"
+ },
+ {
+ "id": "Belt.List.removeAssoc",
+ "kind": "value",
+ "name": "removeAssoc",
+ "docstrings": [
+ "Return a list after removing the first pair whose first value is `k` per the equality predicate `eqFunction`; if not found, return a new list identical to `someList`.\n\n## Examples\n\n```rescript\nlist{(1, \"a\"), (2, \"b\"), (3, \"c\")}->Belt.List.removeAssoc(1, (a, b) => a == b) /* list{(2, \"b\"), (3, \"c\")} */\n\nlist{(9, \"morning\"), (15, \"afternoon\"), (22, \"night\")}\n->Belt.List.removeAssoc(9, (k, item) => k /* 9 */ == item /* 9, 5, 22 */)\n/* list{(15, \"afternoon\"), (22, \"night\")} */\n```"
+ ],
+ "signature": "let removeAssoc: (t<('a, 'c)>, 'b, ('a, 'b) => bool) => t<('a, 'c)>"
+ },
+ {
+ "id": "Belt.List.setAssocU",
+ "kind": "value",
+ "name": "setAssocU",
+ "docstrings": ["Uncurried version of [setAssoc](#setAssoc)."],
+ "signature": "let setAssocU: (t<('a, 'c)>, 'a, 'c, ('a, 'a) => bool) => t<('a, 'c)>"
+ },
+ {
+ "id": "Belt.List.setAssoc",
+ "kind": "value",
+ "name": "setAssoc",
+ "docstrings": [
+ "If `k` exists in `someList` by satisfying the `eqFunction` predicate, return a new list with the key and value replaced by the new `k` and `v`; otherwise, return a new list with the pair `k`, `v` added to the head of `someList`.\n\n## Examples\n\n```rescript\nlist{(1, \"a\"), (2, \"b\"), (3, \"c\")}->Belt.List.setAssoc(2, \"x\", (a, b) => a == b) /* list{(1, \"a\"), (2, \"x\"), (3, \"c\")} */\n\nlist{(1, \"a\"), (3, \"c\")}->Belt.List.setAssoc(2, \"b\", (a, b) => a == b) /* list{(2, \"b\"), (1, \"a\"), (3, \"c\")} */\n\nlist{(9, \"morning\"), (3, \"morning?!\"), (22, \"night\")}\n->Belt.List.setAssoc(15, \"afternoon\", (a, b) => mod(a, 12) == mod(b, 12))\n/* list{(9, \"morning\"), (15, \"afternoon\"), (22, \"night\")} */\n```\n\n**Please note**\n\nIn the last example, since: `15 mod 12` equals `3 mod 12`\n\nBoth the key _and_ the value are replaced in the list."
+ ],
+ "signature": "let setAssoc: (t<('a, 'c)>, 'a, 'c, ('a, 'a) => bool) => t<('a, 'c)>"
+ },
+ {
+ "id": "Belt.List.sortU",
+ "kind": "value",
+ "name": "sortU",
+ "docstrings": ["Uncurried version of [sort](#sort)."],
+ "signature": "let sortU: (t<'a>, ('a, 'a) => int) => t<'a>"
+ },
+ {
+ "id": "Belt.List.sort",
+ "kind": "value",
+ "name": "sort",
+ "docstrings": [
+ "Returns a sorted list.\n\n## Examples\n\n```rescript\nBelt.List.sort(list{5, 4, 9, 3, 7}, (a, b) => a - b) // list{3, 4, 5, 7, 9}\n```"
+ ],
+ "signature": "let sort: (t<'a>, ('a, 'a) => int) => t<'a>"
+ }
+ ]
+ },
+ "belt/mutablestack": {
+ "id": "Belt.MutableStack",
+ "name": "MutableStack",
+ "docstrings": [
+ "[`Belt.MutableStack`]()\n\n An FILO(first in last out) stack data structure",
+ "First in last out stack. This module implements stacks, with in-place\nmodification."
+ ],
+ "items": [
+ {
+ "id": "Belt.MutableStack.t",
+ "kind": "type",
+ "name": "t",
+ "docstrings": [],
+ "signature": "type t<'a>"
+ },
+ {
+ "id": "Belt.MutableStack.make",
+ "kind": "value",
+ "name": "make",
+ "docstrings": ["Returns a new stack, initially empty."],
+ "signature": "let make: unit => t<'a>"
+ },
+ {
+ "id": "Belt.MutableStack.clear",
+ "kind": "value",
+ "name": "clear",
+ "docstrings": ["Discard all elements from the stack."],
+ "signature": "let clear: t<'a> => unit"
+ },
+ {
+ "id": "Belt.MutableStack.copy",
+ "kind": "value",
+ "name": "copy",
+ "docstrings": ["`copy(x)` O(1) operation, return a new stack."],
+ "signature": "let copy: t<'a> => t<'a>"
+ },
+ {
+ "id": "Belt.MutableStack.push",
+ "kind": "value",
+ "name": "push",
+ "docstrings": [],
+ "signature": "let push: (t<'a>, 'a) => unit"
+ },
+ {
+ "id": "Belt.MutableStack.popUndefined",
+ "kind": "value",
+ "name": "popUndefined",
+ "docstrings": [],
+ "signature": "let popUndefined: t<'a> => Js.undefined<'a>"
+ },
+ {
+ "id": "Belt.MutableStack.pop",
+ "kind": "value",
+ "name": "pop",
+ "docstrings": [],
+ "signature": "let pop: t<'a> => option<'a>"
+ },
+ {
+ "id": "Belt.MutableStack.topUndefined",
+ "kind": "value",
+ "name": "topUndefined",
+ "docstrings": [],
+ "signature": "let topUndefined: t<'a> => Js.undefined<'a>"
+ },
+ {
+ "id": "Belt.MutableStack.top",
+ "kind": "value",
+ "name": "top",
+ "docstrings": [],
+ "signature": "let top: t<'a> => option<'a>"
+ },
+ {
+ "id": "Belt.MutableStack.isEmpty",
+ "kind": "value",
+ "name": "isEmpty",
+ "docstrings": [],
+ "signature": "let isEmpty: t<'a> => bool"
+ },
+ {
+ "id": "Belt.MutableStack.size",
+ "kind": "value",
+ "name": "size",
+ "docstrings": [],
+ "signature": "let size: t<'a> => int"
+ },
+ {
+ "id": "Belt.MutableStack.forEachU",
+ "kind": "value",
+ "name": "forEachU",
+ "docstrings": [],
+ "signature": "let forEachU: (t<'a>, 'a => unit) => unit"
+ },
+ {
+ "id": "Belt.MutableStack.forEach",
+ "kind": "value",
+ "name": "forEach",
+ "docstrings": [],
+ "signature": "let forEach: (t<'a>, 'a => unit) => unit"
+ },
+ {
+ "id": "Belt.MutableStack.dynamicPopIterU",
+ "kind": "value",
+ "name": "dynamicPopIterU",
+ "docstrings": [],
+ "signature": "let dynamicPopIterU: (t<'a>, 'a => unit) => unit"
+ },
+ {
+ "id": "Belt.MutableStack.dynamicPopIter",
+ "kind": "value",
+ "name": "dynamicPopIter",
+ "docstrings": [
+ "`dynamicPopIter(s, f)` apply `f` to each element of `s`. The item is poped\nbefore applying `f`, `s` will be empty after this opeartion. This function is\nuseful for worklist algorithm."
+ ],
+ "signature": "let dynamicPopIter: (t<'a>, 'a => unit) => unit"
+ }
+ ]
+ },
+ "belt/mutablequeue": {
+ "id": "Belt.MutableQueue",
+ "name": "MutableQueue",
+ "docstrings": [
+ "[`Belt.MutableQueue`]()\n\n An FIFO(first in first out) queue data structure",
+ "A FIFO (first in first out) queue data structure."
+ ],
+ "items": [
+ {
+ "id": "Belt.MutableQueue.t",
+ "kind": "type",
+ "name": "t",
+ "docstrings": ["The type of queues containing elements of `type('a)`."],
+ "signature": "type t<'a>"
+ },
+ {
+ "id": "Belt.MutableQueue.make",
+ "kind": "value",
+ "name": "make",
+ "docstrings": ["Returns a new queue, initially empty."],
+ "signature": "let make: unit => t<'a>"
+ },
+ {
+ "id": "Belt.MutableQueue.clear",
+ "kind": "value",
+ "name": "clear",
+ "docstrings": ["Discard all elements from the queue."],
+ "signature": "let clear: t<'a> => unit"
+ },
+ {
+ "id": "Belt.MutableQueue.isEmpty",
+ "kind": "value",
+ "name": "isEmpty",
+ "docstrings": [
+ "Returns `true` if the given queue is empty, `false` otherwise."
+ ],
+ "signature": "let isEmpty: t<'a> => bool"
+ },
+ {
+ "id": "Belt.MutableQueue.fromArray",
+ "kind": "value",
+ "name": "fromArray",
+ "docstrings": [
+ "`fromArray` a is equivalent to `Array.forEach(a, add(q, a));`"
+ ],
+ "signature": "let fromArray: array<'a> => t<'a>"
+ },
+ {
+ "id": "Belt.MutableQueue.add",
+ "kind": "value",
+ "name": "add",
+ "docstrings": [
+ "`add(q, x)` adds the element `x` at the end of the queue `q`."
+ ],
+ "signature": "let add: (t<'a>, 'a) => unit"
+ },
+ {
+ "id": "Belt.MutableQueue.peek",
+ "kind": "value",
+ "name": "peek",
+ "docstrings": [
+ "`peekOpt(q)` returns the first element in queue `q`, without removing it from the queue."
+ ],
+ "signature": "let peek: t<'a> => option<'a>"
+ },
+ {
+ "id": "Belt.MutableQueue.peekUndefined",
+ "kind": "value",
+ "name": "peekUndefined",
+ "docstrings": ["`peekUndefined(q)` returns `undefined` if not found."],
+ "signature": "let peekUndefined: t<'a> => Js.undefined<'a>"
+ },
+ {
+ "id": "Belt.MutableQueue.peekExn",
+ "kind": "value",
+ "name": "peekExn",
+ "docstrings": ["raise an exception if `q` is empty"],
+ "signature": "let peekExn: t<'a> => 'a"
+ },
+ {
+ "id": "Belt.MutableQueue.pop",
+ "kind": "value",
+ "name": "pop",
+ "docstrings": [
+ "`pop(q)` removes and returns the first element in queue `q`."
+ ],
+ "signature": "let pop: t<'a> => option<'a>"
+ },
+ {
+ "id": "Belt.MutableQueue.popUndefined",
+ "kind": "value",
+ "name": "popUndefined",
+ "docstrings": [
+ "`popUndefined(q)` removes and returns the first element in queue `q`. it will\nreturn `undefined` if it is already empty."
+ ],
+ "signature": "let popUndefined: t<'a> => Js.undefined<'a>"
+ },
+ {
+ "id": "Belt.MutableQueue.popExn",
+ "kind": "value",
+ "name": "popExn",
+ "docstrings": ["`popExn(q)` raise an exception if q is empty."],
+ "signature": "let popExn: t<'a> => 'a"
+ },
+ {
+ "id": "Belt.MutableQueue.copy",
+ "kind": "value",
+ "name": "copy",
+ "docstrings": ["`copy(q)` returns a fresh queue."],
+ "signature": "let copy: t<'a> => t<'a>"
+ },
+ {
+ "id": "Belt.MutableQueue.size",
+ "kind": "value",
+ "name": "size",
+ "docstrings": ["Returns the number of elements in a queue."],
+ "signature": "let size: t<'a> => int"
+ },
+ {
+ "id": "Belt.MutableQueue.mapU",
+ "kind": "value",
+ "name": "mapU",
+ "docstrings": [],
+ "signature": "let mapU: (t<'a>, 'a => 'b) => t<'b>"
+ },
+ {
+ "id": "Belt.MutableQueue.map",
+ "kind": "value",
+ "name": "map",
+ "docstrings": [],
+ "signature": "let map: (t<'a>, 'a => 'b) => t<'b>"
+ },
+ {
+ "id": "Belt.MutableQueue.forEachU",
+ "kind": "value",
+ "name": "forEachU",
+ "docstrings": [],
+ "signature": "let forEachU: (t<'a>, 'a => unit) => unit"
+ },
+ {
+ "id": "Belt.MutableQueue.forEach",
+ "kind": "value",
+ "name": "forEach",
+ "docstrings": [
+ "`forEach(q, f) applies`f`in turn to all elements of`q`, from the least\nrecently entered to the most recently entered. The queue itself is unchanged."
+ ],
+ "signature": "let forEach: (t<'a>, 'a => unit) => unit"
+ },
+ {
+ "id": "Belt.MutableQueue.reduceU",
+ "kind": "value",
+ "name": "reduceU",
+ "docstrings": [],
+ "signature": "let reduceU: (t<'a>, 'b, ('b, 'a) => 'b) => 'b"
+ },
+ {
+ "id": "Belt.MutableQueue.reduce",
+ "kind": "value",
+ "name": "reduce",
+ "docstrings": [
+ "`reduce(q, accu, f)` is equivalent to `List.reduce(l, accu, f)`, where `l` is the\nlist of `q`'s elements. The queue remains unchanged."
+ ],
+ "signature": "let reduce: (t<'a>, 'b, ('b, 'a) => 'b) => 'b"
+ },
+ {
+ "id": "Belt.MutableQueue.transfer",
+ "kind": "value",
+ "name": "transfer",
+ "docstrings": [
+ "`transfer(q1, q2)` adds all of `q1`'s elements at the end of the queue `q2`,\nthen clears `q1`. It is equivalent to the sequence `forEach((x) => add(x, q2), q1)`;\nclear `q1`, but runs in constant time."
+ ],
+ "signature": "let transfer: (t<'a>, t<'a>) => unit"
+ },
+ {
+ "id": "Belt.MutableQueue.toArray",
+ "kind": "value",
+ "name": "toArray",
+ "docstrings": ["First added will be in the beginning of the array."],
+ "signature": "let toArray: t<'a> => array<'a>"
+ }
+ ]
+ },
+ "belt/sortarray": {
+ "id": "Belt.SortArray",
+ "name": "SortArray",
+ "docstrings": [
+ "[`Belt.SortArray`]()\n\n The top level provides some generic sort related utilities.\n\n It also has two specialized inner modules\n [`Belt.SortArray.Int`]() and [`Belt.SortArray.String`]()",
+ "A module for Array sort relevant utiliites"
+ ],
+ "items": [
+ {
+ "id": "Belt.SortArray.strictlySortedLengthU",
+ "kind": "value",
+ "name": "strictlySortedLengthU",
+ "docstrings": [],
+ "signature": "let strictlySortedLengthU: (array<'a>, ('a, 'a) => bool) => int"
+ },
+ {
+ "id": "Belt.SortArray.strictlySortedLength",
+ "kind": "value",
+ "name": "strictlySortedLength",
+ "docstrings": [
+ "`strictlySortedLenght(xs, cmp);` return `+n` means increasing order `-n` means negative order\n\n## Examples\n\n```rescript\nBelt.SortArray.strictlySortedLength([1, 2, 3, 4, 3], (x, y) => x < y) == 4\n\nBelt.SortArray.strictlySortedLength([], (x, y) => x < y) == 0\n\nBelt.SortArray.strictlySortedLength([1], (x, y) => x < y) == 1\n\nBelt.SortArray.strictlySortedLength([4, 3, 2, 1], (x, y) => x < y) == -4\n```"
+ ],
+ "signature": "let strictlySortedLength: (array<'a>, ('a, 'a) => bool) => int"
+ },
+ {
+ "id": "Belt.SortArray.isSortedU",
+ "kind": "value",
+ "name": "isSortedU",
+ "docstrings": [],
+ "signature": "let isSortedU: (array<'a>, ('a, 'a) => int) => bool"
+ },
+ {
+ "id": "Belt.SortArray.isSorted",
+ "kind": "value",
+ "name": "isSorted",
+ "docstrings": [
+ "`isSorted(arr, cmp)`: Returns true if array is increasingly sorted (equal is okay)"
+ ],
+ "signature": "let isSorted: (array<'a>, ('a, 'a) => int) => bool"
+ },
+ {
+ "id": "Belt.SortArray.stableSortInPlaceByU",
+ "kind": "value",
+ "name": "stableSortInPlaceByU",
+ "docstrings": [],
+ "signature": "let stableSortInPlaceByU: (array<'a>, ('a, 'a) => int) => unit"
+ },
+ {
+ "id": "Belt.SortArray.stableSortInPlaceBy",
+ "kind": "value",
+ "name": "stableSortInPlaceBy",
+ "docstrings": [],
+ "signature": "let stableSortInPlaceBy: (array<'a>, ('a, 'a) => int) => unit"
+ },
+ {
+ "id": "Belt.SortArray.stableSortByU",
+ "kind": "value",
+ "name": "stableSortByU",
+ "docstrings": [],
+ "signature": "let stableSortByU: (array<'a>, ('a, 'a) => int) => array<'a>"
+ },
+ {
+ "id": "Belt.SortArray.stableSortBy",
+ "kind": "value",
+ "name": "stableSortBy",
+ "docstrings": [
+ "`stableSortBy(xs, cmp)`: Returns a fresh array Sort `xs` in place using\ncomparator `cmp`, the stable means if the elements are equal, their order will\nbe preserved"
+ ],
+ "signature": "let stableSortBy: (array<'a>, ('a, 'a) => int) => array<'a>"
+ },
+ {
+ "id": "Belt.SortArray.binarySearchByU",
+ "kind": "value",
+ "name": "binarySearchByU",
+ "docstrings": [],
+ "signature": "let binarySearchByU: (array<'a>, 'a, ('a, 'a) => int) => int"
+ },
+ {
+ "id": "Belt.SortArray.binarySearchBy",
+ "kind": "value",
+ "name": "binarySearchBy",
+ "docstrings": [
+ "If value is not found and value is less than one or more elements in array, the\nnegative number returned is the bitwise complement of the index of the first\nelement that is larger than value.\n\nIf value is not found and value is greater\nthan all elements in array, the negative number returned is the bitwise\ncomplement of (the index of the last element plus 1)for example, if `key` is\nsmaller than all elements return `-1` since `lnot(-1) == 0` if `key` is larger\nthan all elements return `lnot(-1) == 0` since `lnot(- (len + 1)) == len`\n\n## Examples\n\n```rescript\nBelt.SortArray.binarySearchBy([1, 2, 3, 4, 33, 35, 36], 33, Pervasives.compare) == 4\n\nlnot(Belt.SortArray.binarySearchBy([1, 3, 5, 7], 4, Pervasives.compare)) == 2\n```"
+ ],
+ "signature": "let binarySearchBy: (array<'a>, 'a, ('a, 'a) => int) => int"
+ },
+ {
+ "id": "Belt.SortArray.unionU",
+ "kind": "value",
+ "name": "unionU",
+ "docstrings": [],
+ "signature": "let unionU: (\n array<'a>,\n int,\n int,\n array<'a>,\n int,\n int,\n array<'a>,\n int,\n ('a, 'a) => int,\n) => int"
+ },
+ {
+ "id": "Belt.SortArray.union",
+ "kind": "value",
+ "name": "union",
+ "docstrings": [
+ "`union src src1ofs src1len src2 src2ofs src2len dst dstofs cmp` assume `src` and\n`src2` is strictly sorted. for equivalent elements, it is picked from `src`\nalso assume that `dst` is large enough to store all elements"
+ ],
+ "signature": "let union: (\n array<'a>,\n int,\n int,\n array<'a>,\n int,\n int,\n array<'a>,\n int,\n ('a, 'a) => int,\n) => int"
+ },
+ {
+ "id": "Belt.SortArray.intersectU",
+ "kind": "value",
+ "name": "intersectU",
+ "docstrings": [],
+ "signature": "let intersectU: (\n array<'a>,\n int,\n int,\n array<'a>,\n int,\n int,\n array<'a>,\n int,\n ('a, 'a) => int,\n) => int"
+ },
+ {
+ "id": "Belt.SortArray.intersect",
+ "kind": "value",
+ "name": "intersect",
+ "docstrings": [
+ "`union src src1ofs src1len src2 src2ofs src2len dst dstofs cmp`\n\n**return** the `offset` in the output array"
+ ],
+ "signature": "let intersect: (\n array<'a>,\n int,\n int,\n array<'a>,\n int,\n int,\n array<'a>,\n int,\n ('a, 'a) => int,\n) => int"
+ },
+ {
+ "id": "Belt.SortArray.diffU",
+ "kind": "value",
+ "name": "diffU",
+ "docstrings": [],
+ "signature": "let diffU: (\n array<'a>,\n int,\n int,\n array<'a>,\n int,\n int,\n array<'a>,\n int,\n ('a, 'a) => int,\n) => int"
+ },
+ {
+ "id": "Belt.SortArray.diff",
+ "kind": "value",
+ "name": "diff",
+ "docstrings": [],
+ "signature": "let diff: (\n array<'a>,\n int,\n int,\n array<'a>,\n int,\n int,\n array<'a>,\n int,\n ('a, 'a) => int,\n) => int"
+ }
+ ]
+ },
+ "belt/array": {
+ "id": "Belt.Array",
+ "name": "Array",
+ "docstrings": [
+ "[`Belt.Array`]()\n\n **mutable array**: Utilities functions",
+ "Utilities for `Array` functions.\n\n### Note about index syntax\n\nCode like `arr[0]` does *not* compile to JavaScript `arr[0]`. Reason transforms\nthe `[]` index syntax into a function: `Array.get(arr, 0)`. By default, this\nuses the default standard library's `Array.get` function, which may raise an\nexception if the index isn't found. If you `open Belt`, it will use the\n`Belt.Array.get` function which returns options instead of raising exceptions. \n[See this for more information](../belt.mdx#array-access-runtime-safety)."
+ ],
+ "items": [
+ {
+ "id": "Belt.Array.t",
+ "kind": "type",
+ "name": "t",
+ "docstrings": [],
+ "signature": "type t<'a> = array<'a>"
+ },
+ {
+ "id": "Belt.Array.length",
+ "kind": "value",
+ "name": "length",
+ "docstrings": [
+ "Return the size of the array\n\n## Examples\n\n```rescript\n// Returns 1\nBelt.Array.length([\"test\"])\n```"
+ ],
+ "signature": "let length: t<'a> => int"
+ },
+ {
+ "id": "Belt.Array.size",
+ "kind": "value",
+ "name": "size",
+ "docstrings": ["See [`Belt.Array.length`]()"],
+ "signature": "let size: t<'a> => int"
+ },
+ {
+ "id": "Belt.Array.get",
+ "kind": "value",
+ "name": "get",
+ "docstrings": [
+ "If `i <= 0 <= length(arr)` returns `Some(value)` where `value` is the item at index `i`.\nIf `i` is out of range returns `None`.\n\n## Examples\n\n```rescript\nBelt.Array.get([\"a\", \"b\", \"c\"], 0) == Some(\"a\")\nBelt.Array.get([\"a\", \"b\", \"c\"], 3) == None\nBelt.Array.get([\"a\", \"b\", \"c\"], -1) == None\n```"
+ ],
+ "signature": "let get: (t<'a>, int) => option<'a>"
+ },
+ {
+ "id": "Belt.Array.getExn",
+ "kind": "value",
+ "name": "getExn",
+ "docstrings": [
+ "Raise an exception if `i` is out of range.\nOtherwise return the value at index `i` in `arr`."
+ ],
+ "signature": "let getExn: (t<'a>, int) => 'a"
+ },
+ {
+ "id": "Belt.Array.getUnsafe",
+ "kind": "value",
+ "name": "getUnsafe",
+ "docstrings": [
+ "`getUnsafe(arr, i)`\n\n**Unsafe**\n\nno bounds checking; this would cause type error if `i` does not stay within range"
+ ],
+ "signature": "let getUnsafe: (t<'a>, int) => 'a"
+ },
+ {
+ "id": "Belt.Array.getUndefined",
+ "kind": "value",
+ "name": "getUndefined",
+ "docstrings": [
+ "`getUndefined(arr, i)`\n\nIt does the samething in the runtime as [`getUnsafe`]();\nit is _type safe_ since the return type still track whether it is\nin range or not"
+ ],
+ "signature": "let getUndefined: (t<'a>, int) => Js.undefined<'a>"
+ },
+ {
+ "id": "Belt.Array.set",
+ "kind": "value",
+ "name": "set",
+ "docstrings": [
+ "`set(arr, n, x)` modifies `arr` in place; it replaces the nth element of `arr`\nwith `x`. Returning `false` means not updated due to out of range."
+ ],
+ "signature": "let set: (t<'a>, int, 'a) => bool"
+ },
+ {
+ "id": "Belt.Array.setExn",
+ "kind": "value",
+ "name": "setExn",
+ "docstrings": [
+ "`setExn(arr, i, x)` raise an exception if `i` is out of range."
+ ],
+ "signature": "let setExn: (t<'a>, int, 'a) => unit"
+ },
+ {
+ "id": "Belt.Array.setUnsafe",
+ "kind": "value",
+ "name": "setUnsafe",
+ "docstrings": [],
+ "signature": "let setUnsafe: (t<'a>, int, 'a) => unit"
+ },
+ {
+ "id": "Belt.Array.shuffleInPlace",
+ "kind": "value",
+ "name": "shuffleInPlace",
+ "docstrings": [
+ "`shuffleInPlace(arr)` randomly re-orders the items in `arr`"
+ ],
+ "signature": "let shuffleInPlace: t<'a> => unit"
+ },
+ {
+ "id": "Belt.Array.shuffle",
+ "kind": "value",
+ "name": "shuffle",
+ "docstrings": [
+ "Returns a fresh array with items in original array randomly shuffled."
+ ],
+ "signature": "let shuffle: t<'a> => t<'a>"
+ },
+ {
+ "id": "Belt.Array.reverseInPlace",
+ "kind": "value",
+ "name": "reverseInPlace",
+ "docstrings": [
+ "`reverseInPlace(arr)` reverses items in `arr` in place.\n\n## Examples\n\n```rescript\nlet arr = [10, 11, 12, 13, 14]\n\nlet () = Belt.Array.reverseInPlace(arr)\n\narr == [14, 13, 12, 11, 10]\n```"
+ ],
+ "signature": "let reverseInPlace: t<'a> => unit"
+ },
+ {
+ "id": "Belt.Array.reverse",
+ "kind": "value",
+ "name": "reverse",
+ "docstrings": [
+ "`reverse(arr)` returns a fresh array with items in arr in reverse order.\n\n## Examples\n\n```rescript\nBelt.Array.reverse([10, 11, 12, 13, 14]) == [14, 13, 12, 11, 10]\n```"
+ ],
+ "signature": "let reverse: t<'a> => t<'a>"
+ },
+ {
+ "id": "Belt.Array.makeUninitialized",
+ "kind": "value",
+ "name": "makeUninitialized",
+ "docstrings": [
+ "`makeUninitialized(n)` creates an array of length `n` filled with the undefined\nvalue. You must specify the type of data that will eventually fill the array.\n\n## Examples\n\n```rescript\nlet arr: array> = Belt.Array.makeUninitialized(5)\n\nBelt.Array.getExn(arr, 0) == Js.undefined\n```"
+ ],
+ "signature": "let makeUninitialized: int => array>"
+ },
+ {
+ "id": "Belt.Array.makeUninitializedUnsafe",
+ "kind": "value",
+ "name": "makeUninitializedUnsafe",
+ "docstrings": [
+ "**Unsafe**\n\n## Examples\n\n```rescript\nlet arr = Belt.Array.makeUninitializedUnsafe(5)\n\nJs.log(Belt.Array.getExn(arr, 0)) // undefined\n\nBelt.Array.setExn(arr, 0, \"example\")\n\nJs.log(Belt.Array.getExn(arr, 0) == \"example\")\n```"
+ ],
+ "signature": "let makeUninitializedUnsafe: int => t<'a>"
+ },
+ {
+ "id": "Belt.Array.make",
+ "kind": "value",
+ "name": "make",
+ "docstrings": [
+ "`make(n, e)` return an array of size `n` filled with value `e`.\nReturns an empty array when `n` is negative."
+ ],
+ "signature": "let make: (int, 'a) => t<'a>"
+ },
+ {
+ "id": "Belt.Array.range",
+ "kind": "value",
+ "name": "range",
+ "docstrings": [
+ "`range(start, finish)` create an inclusive array.\n\n## Examples\n\n```rescript\nBelt.Array.range(0, 3) == [0, 1, 2, 3]\n\nBelt.Array.range(3, 0) == []\n\nBelt.Array.range(3, 3) == [3]\n```"
+ ],
+ "signature": "let range: (int, int) => array"
+ },
+ {
+ "id": "Belt.Array.rangeBy",
+ "kind": "value",
+ "name": "rangeBy",
+ "docstrings": [
+ "`rangeBy(start, finish, ~step)` returns empty array when step is 0 or negative.\nIt also return an empty array when `start > finish`.\n\n## Examples\n\n```rescript\nBelt.Array.rangeBy(0, 10, ~step=3) == [0, 3, 6, 9]\n\nBelt.Array.rangeBy(0, 12, ~step=3) == [0, 3, 6, 9, 12]\n\nBelt.Array.rangeBy(33, 0, ~step=1) == []\n\nBelt.Array.rangeBy(33, 0, ~step=-1) == []\n\nBelt.Array.rangeBy(3, 12, ~step=-1) == []\n\nBelt.Array.rangeBy(3, 3, ~step=0) == []\n\nBelt.Array.rangeBy(3, 3, ~step=1) == [3]\n```"
+ ],
+ "signature": "let rangeBy: (int, int, ~step: int) => array"
+ },
+ {
+ "id": "Belt.Array.makeByU",
+ "kind": "value",
+ "name": "makeByU",
+ "docstrings": [],
+ "signature": "let makeByU: (int, int => 'a) => t<'a>"
+ },
+ {
+ "id": "Belt.Array.makeBy",
+ "kind": "value",
+ "name": "makeBy",
+ "docstrings": [
+ "`makeBy(n, f)` return an empty array when n is negative return an array of size\nn populated by `f(i)` start from `0` to `n - 1`.\n\n## Examples\n\n```rescript\nBelt.Array.makeBy(5, (i) => i) == [0, 1, 2, 3, 4]\n\nBelt.Array.makeBy(5, (i) => i * i) == [0, 1, 4, 9, 16]\n```"
+ ],
+ "signature": "let makeBy: (int, int => 'a) => t<'a>"
+ },
+ {
+ "id": "Belt.Array.makeByAndShuffleU",
+ "kind": "value",
+ "name": "makeByAndShuffleU",
+ "docstrings": [],
+ "signature": "let makeByAndShuffleU: (int, int => 'a) => t<'a>"
+ },
+ {
+ "id": "Belt.Array.makeByAndShuffle",
+ "kind": "value",
+ "name": "makeByAndShuffle",
+ "docstrings": ["Equivalent to `shuffle(makeBy(n, f))`"],
+ "signature": "let makeByAndShuffle: (int, int => 'a) => t<'a>"
+ },
+ {
+ "id": "Belt.Array.zip",
+ "kind": "value",
+ "name": "zip",
+ "docstrings": [
+ "`zip(a, b)` create an array of pairs from corresponding elements of a and b.\nStop with the shorter array.\n\n## Examples\n\n```rescript\nBelt.Array.zip([1, 2], [3, 4, 5]) == [(1, 3), (2, 4)]\n```"
+ ],
+ "signature": "let zip: (t<'a>, array<'b>) => array<('a, 'b)>"
+ },
+ {
+ "id": "Belt.Array.zipByU",
+ "kind": "value",
+ "name": "zipByU",
+ "docstrings": [],
+ "signature": "let zipByU: (t<'a>, array<'b>, ('a, 'b) => 'c) => array<'c>"
+ },
+ {
+ "id": "Belt.Array.zipBy",
+ "kind": "value",
+ "name": "zipBy",
+ "docstrings": [
+ "`zipBy(xs, ys, f)` create an array by applying `f` to corresponding elements of\n`xs` and `ys`. Stops with shorter array.\n\nEquivalent to `map(zip(xs, ys), ((a, b)) => f(a, b))`\n\n## Examples\n\n```rescript\nBelt.Array.zipBy([1, 2, 3], [4, 5], (a, b) => 2 * a + b) == [6, 9]\n```"
+ ],
+ "signature": "let zipBy: (t<'a>, array<'b>, ('a, 'b) => 'c) => array<'c>"
+ },
+ {
+ "id": "Belt.Array.unzip",
+ "kind": "value",
+ "name": "unzip",
+ "docstrings": [
+ "`unzip(a)` takes an array of pairs and creates a pair of arrays. The first array\ncontains all the first items of the pairs; the second array contains all the\nsecond items.\n\n## Examples\n\n```rescript\nBelt.Array.unzip([(1, 2), (3, 4)]) == ([1, 3], [2, 4])\n\nBelt.Array.unzip([(1, 2), (3, 4), (5, 6), (7, 8)]) == ([1, 3, 5, 7], [2, 4, 6, 8])\n```"
+ ],
+ "signature": "let unzip: array<('a, 'b)> => (t<'a>, array<'b>)"
+ },
+ {
+ "id": "Belt.Array.concat",
+ "kind": "value",
+ "name": "concat",
+ "docstrings": [
+ "`concat(xs, ys)` returns a fresh array containing the concatenation of the arrays\n`v1` and `v2`, so even if `v1` or `v2` is empty; it can not be shared.\n\n## Examples\n\n```rescript\nBelt.Array.concat([1, 2, 3], [4, 5]) == [1, 2, 3, 4, 5]\n\nBelt.Array.concat([], [\"a\", \"b\", \"c\"]) == [\"a\", \"b\", \"c\"]\n```"
+ ],
+ "signature": "let concat: (t<'a>, t<'a>) => t<'a>"
+ },
+ {
+ "id": "Belt.Array.concatMany",
+ "kind": "value",
+ "name": "concatMany",
+ "docstrings": [
+ "`concatMany(xss)` returns a fresh array as the concatenation of `xss` (an array of arrays)\n\n## Examples\n\n```rescript\nBelt.Array.concatMany([[1, 2, 3], [4, 5, 6], [7, 8]]) == [1, 2, 3, 4, 5, 6, 7, 8]\n```"
+ ],
+ "signature": "let concatMany: array> => t<'a>"
+ },
+ {
+ "id": "Belt.Array.slice",
+ "kind": "value",
+ "name": "slice",
+ "docstrings": [
+ "`slice(xs, offset, len)` creates a new array with the len elements of `xs`\nstarting at `offset` for `offset` can be negative;and is evaluated as\n`length(xs) - offset(slice, xs) - 1(1)` means get the last element as a\nsingleton array `slice(xs, ~-len, len)` will return a copy of the array if the\narray does not have enough data; `slice` extracts through the end of sequence.\n\nif `len` is negative; returns the empty array.\n\n## Examples\n\n```rescript\nBelt.Array.slice([10, 11, 12, 13, 14, 15, 16], ~offset=2, ~len=3) == [12, 13, 14]\n\nBelt.Array.slice([10, 11, 12, 13, 14, 15, 16], ~offset=-4, ~len=3) == [13, 14, 15]\n\nBelt.Array.slice([10, 11, 12, 13, 14, 15, 16], ~offset=4, ~len=9) == [14, 15, 16]\n```"
+ ],
+ "signature": "let slice: (t<'a>, ~offset: int, ~len: int) => t<'a>"
+ },
+ {
+ "id": "Belt.Array.sliceToEnd",
+ "kind": "value",
+ "name": "sliceToEnd",
+ "docstrings": [
+ "`sliceToEnd(xs, offset)` creates a new array with the elements of `xs` starting\nat `offset`\n\n`offset` can be negative; and is evaluated as `length(xs) - offset(sliceToEnd, xs) - 1`\nmeans get the last element as a singleton array\n\n`sliceToEnd(xs, 0)` will return a copy of the array\n\n## Examples\n\n```rescript\nBelt.Array.sliceToEnd([10, 11, 12, 13, 14, 15, 16], 2) == [12, 13, 14, 15, 16]\n\nBelt.Array.sliceToEnd([10, 11, 12, 13, 14, 15, 16], -4) == [13, 14, 15, 16]\n```"
+ ],
+ "signature": "let sliceToEnd: (t<'a>, int) => t<'a>"
+ },
+ {
+ "id": "Belt.Array.copy",
+ "kind": "value",
+ "name": "copy",
+ "docstrings": [
+ "`copy(a)` returns a copy of `a`; that is; a fresh array containing the same\nelements as `a`."
+ ],
+ "signature": "let copy: t<'a> => t<'a>"
+ },
+ {
+ "id": "Belt.Array.fill",
+ "kind": "value",
+ "name": "fill",
+ "docstrings": [
+ "`fill(arr, ~offset, ~len, x)` modifies `arr` in place, storing `x` in elements\nnumber `offset` to `offset + len - 1`. `offset` can be negative; and is evaluated\nas `length(arr - offset)`.\n\n`fill(arr, ~offset=-1, ~len=1)` means fill the last element, if the array does not have enough data; `fill` will ignore it\n\n## Examples\n\n```rescript\nlet arr = Belt.Array.makeBy(5, (i) => i)\n\nBelt.Array.fill(arr, ~offset=2, ~len=2, 9)\n\narr == [0, 1, 9, 9, 4]\n\nBelt.Array.fill(arr, ~offset=7, ~len=2, 8)\n\narr == [0, 1, 9, 9, 4]"
+ ],
+ "signature": "let fill: (t<'a>, ~offset: int, ~len: int, 'a) => unit"
+ },
+ {
+ "id": "Belt.Array.blit",
+ "kind": "value",
+ "name": "blit",
+ "docstrings": [
+ "`blit(~src=v1, ~srcOffset=o1, ~dst=v2, ~dstOffset=o2, ~len)` copies `len` elements\nfrom array `v1`;starting at element number `o1`;to array `v2`, starting at element\nnumber `o2`. It works correctly even if `v1` and `v2` are the same array and the\nsource and destination chunks overlap.\n\n`offset` can be negative; `-1` means `len - 1`; if `len + offset` is still negative;it will be set as 0\n\nFor each of the examples;presume that `v1 == [10, 11, 12, 13, 14, 15, 16, 17]` and `v2 == [20, 21, 22, 23, 24, 25, 26, 27]`. The result shown is the content of the destination array.\n\n## Examples\n\n```rescript\nlet v1 = [10, 11, 12, 13, 14, 15, 16, 17]\nlet v2 = [20, 21, 22, 23, 24, 25, 26, 27]\n\nBelt.Array.blit(~src=v1, ~srcOffset=4, ~dst=v2, ~dstOffset=2, ~len=3)\nv2 == [20, 21, 14, 15, 16, 25, 26, 27]\n\nBelt.Array.blit(~src=v1, ~srcOffset=4, ~dst=v1, ~dstOffset=2, ~len=3)\nv1 == [10, 11, 14, 15, 16, 15, 16, 17]\n```"
+ ],
+ "signature": "let blit: (\n ~src: t<'a>,\n ~srcOffset: int,\n ~dst: t<'a>,\n ~dstOffset: int,\n ~len: int,\n) => unit"
+ },
+ {
+ "id": "Belt.Array.blitUnsafe",
+ "kind": "value",
+ "name": "blitUnsafe",
+ "docstrings": ["Unsafe blit without bounds checking."],
+ "signature": "let blitUnsafe: (\n ~src: t<'a>,\n ~srcOffset: int,\n ~dst: t<'a>,\n ~dstOffset: int,\n ~len: int,\n) => unit"
+ },
+ {
+ "id": "Belt.Array.forEachU",
+ "kind": "value",
+ "name": "forEachU",
+ "docstrings": [],
+ "signature": "let forEachU: (t<'a>, 'a => unit) => unit"
+ },
+ {
+ "id": "Belt.Array.forEach",
+ "kind": "value",
+ "name": "forEach",
+ "docstrings": [
+ "`forEach(xs, f)`\n\nCall `f` on each element of `xs` from the beginning to end. `f` returns `unit`\nso no new array is created. Use `forEach` when you are primarily concerned with\nrepetitively creating side effects.\n\n## Examples\n\n```rescript\nBelt.Array.forEach([\"a\", \"b\", \"c\"], x => Js.log(\"Item: \" ++ x))\n\n/*\n prints:\n Item: a\n Item: b\n Item: c\n*/\nlet total = ref(0)\n\nBelt.Array.forEach([1, 2, 3, 4], x => total := total.contents + x)\n\ntotal.contents == 1 + 2 + 3 + 4\n```"
+ ],
+ "signature": "let forEach: (t<'a>, 'a => unit) => unit"
+ },
+ {
+ "id": "Belt.Array.mapU",
+ "kind": "value",
+ "name": "mapU",
+ "docstrings": [],
+ "signature": "let mapU: (t<'a>, 'a => 'b) => array<'b>"
+ },
+ {
+ "id": "Belt.Array.map",
+ "kind": "value",
+ "name": "map",
+ "docstrings": [
+ "`map(xs, f)` returns a new array by calling `f` for each element of `xs` from\nthe beginning to end.\n\n## Examples\n\n```rescript\nBelt.Array.map([1, 2], (x) => x + 1) == [3, 4]\n```"
+ ],
+ "signature": "let map: (t<'a>, 'a => 'b) => array<'b>"
+ },
+ {
+ "id": "Belt.Array.flatMapU",
+ "kind": "value",
+ "name": "flatMapU",
+ "docstrings": [],
+ "signature": "let flatMapU: (t<'a>, 'a => array<'b>) => array<'b>"
+ },
+ {
+ "id": "Belt.Array.flatMap",
+ "kind": "value",
+ "name": "flatMap",
+ "docstrings": [
+ "`flatMap(xs, f)` returns a new array by calling `f` for each element of `xs` from\nthe beginning to end, concatenating the results.\n\n## Examples\n\n```rescript\nBelt.Array.flatMap([1, 2], x => [x + 10, x + 20]) == [11, 21, 12, 22]\n```"
+ ],
+ "signature": "let flatMap: (t<'a>, 'a => array<'b>) => array<'b>"
+ },
+ {
+ "id": "Belt.Array.getByU",
+ "kind": "value",
+ "name": "getByU",
+ "docstrings": [],
+ "signature": "let getByU: (t<'a>, 'a => bool) => option<'a>"
+ },
+ {
+ "id": "Belt.Array.getBy",
+ "kind": "value",
+ "name": "getBy",
+ "docstrings": [
+ "`getBy(xs, p)` returns `Some(value)` for the first value in `xs` that satisifies\nthe predicate function `p`; returns `None` if no element satisifies the function.\n\n## Examples\n\n```rescript\nBelt.Array.getBy([1, 4, 3, 2], (x) => mod(x, 2) == 0) == Some(4)\nBelt.Array.getBy([15, 13, 11], (x) => mod(x, 2) == 0) == None\n```"
+ ],
+ "signature": "let getBy: (t<'a>, 'a => bool) => option<'a>"
+ },
+ {
+ "id": "Belt.Array.getIndexByU",
+ "kind": "value",
+ "name": "getIndexByU",
+ "docstrings": [],
+ "signature": "let getIndexByU: (t<'a>, 'a => bool) => option"
+ },
+ {
+ "id": "Belt.Array.getIndexBy",
+ "kind": "value",
+ "name": "getIndexBy",
+ "docstrings": [
+ "`getIndexBy(xs, p)` returns `Some(index)` for the first value in `xs` that\nsatisifies the predicate function `p`; returns `None` if no element satisifies\nthe function.\n\n## Examples\n\n```rescript\nBelt.Array.getIndexBy([1, 4, 3, 2], (x) => mod(x, 2) == 0) == Some(1)\nBelt.Array.getIndexBy([15, 13, 11], (x) => mod(x, 2) == 0) == None\n```"
+ ],
+ "signature": "let getIndexBy: (t<'a>, 'a => bool) => option"
+ },
+ {
+ "id": "Belt.Array.keepU",
+ "kind": "value",
+ "name": "keepU",
+ "docstrings": [],
+ "signature": "let keepU: (t<'a>, 'a => bool) => t<'a>"
+ },
+ {
+ "id": "Belt.Array.keep",
+ "kind": "value",
+ "name": "keep",
+ "docstrings": [
+ "`keep(xs, p)` returns a new array that keep all elements satisfy `p`."
+ ],
+ "signature": "let keep: (t<'a>, 'a => bool) => t<'a>"
+ },
+ {
+ "id": "Belt.Array.keepWithIndexU",
+ "kind": "value",
+ "name": "keepWithIndexU",
+ "docstrings": [],
+ "signature": "let keepWithIndexU: (t<'a>, ('a, int) => bool) => t<'a>"
+ },
+ {
+ "id": "Belt.Array.keepWithIndex",
+ "kind": "value",
+ "name": "keepWithIndex",
+ "docstrings": [
+ "`keepWithIndex(xs, p)` returns a new array that keep all elements satisfy `p`.\n\n## Examples\n\n```rescript\nBelt.Array.keepWithIndex([1, 2, 3], (_x, i) => i == 1) == [2]\n```"
+ ],
+ "signature": "let keepWithIndex: (t<'a>, ('a, int) => bool) => t<'a>"
+ },
+ {
+ "id": "Belt.Array.keepMapU",
+ "kind": "value",
+ "name": "keepMapU",
+ "docstrings": [],
+ "signature": "let keepMapU: (t<'a>, 'a => option<'b>) => array<'b>"
+ },
+ {
+ "id": "Belt.Array.keepMap",
+ "kind": "value",
+ "name": "keepMap",
+ "docstrings": [
+ "`keepMap(xs, p)` returns a new array that keep all elements that return a non\nNone applied `p`.\n\n## Examples\n\n```rescript\nBelt.Array.keepMap([1, 2, 3], x =>\n if mod(x, 2) == 0 {\n Some(x)\n } else {\n None\n }\n)\n== [2]\n```"
+ ],
+ "signature": "let keepMap: (t<'a>, 'a => option<'b>) => array<'b>"
+ },
+ {
+ "id": "Belt.Array.forEachWithIndexU",
+ "kind": "value",
+ "name": "forEachWithIndexU",
+ "docstrings": [],
+ "signature": "let forEachWithIndexU: (t<'a>, (int, 'a) => unit) => unit"
+ },
+ {
+ "id": "Belt.Array.forEachWithIndex",
+ "kind": "value",
+ "name": "forEachWithIndex",
+ "docstrings": [
+ "`forEachWithIndex(xs, f)` same as `Belt.Array.forEach`, except that `f` is\nsupplied two arguments: the index starting from 0 and the element from `xs`.\n\n## Examples\n\n```rescript\nBelt.Array.forEachWithIndex([\"a\", \"b\", \"c\"], (i, x) => Js.log(\"Item \" ++ Belt.Int.toString(i) ++ \" is \" ++ x))\n\n/*\n prints:\n Item 0 is a\n Item 1 is b\n Item 2 is cc\n*/\nlet total = ref(0)\n\nBelt.Array.forEachWithIndex([10, 11, 12, 13], (i, x) => total := total.contents + x + i)\n\ntotal.contents == 0 + 10 + 1 + 11 + 2 + 12 + 3 + 13\n```"
+ ],
+ "signature": "let forEachWithIndex: (t<'a>, (int, 'a) => unit) => unit"
+ },
+ {
+ "id": "Belt.Array.mapWithIndexU",
+ "kind": "value",
+ "name": "mapWithIndexU",
+ "docstrings": [],
+ "signature": "let mapWithIndexU: (t<'a>, (int, 'a) => 'b) => array<'b>"
+ },
+ {
+ "id": "Belt.Array.mapWithIndex",
+ "kind": "value",
+ "name": "mapWithIndex",
+ "docstrings": [
+ "`mapWithIndex(xs, f)` applies `f` to each element of `xs`. Function `f` takes\ntwo arguments: the index starting from 0 and the element from `xs`.\n\n## Examples\n\n```rescript\nBelt.Array.mapWithIndex([1, 2, 3], (i, x) => i + x) == [0 + 1, 1 + 2, 2 + 3]\n```"
+ ],
+ "signature": "let mapWithIndex: (t<'a>, (int, 'a) => 'b) => array<'b>"
+ },
+ {
+ "id": "Belt.Array.partitionU",
+ "kind": "value",
+ "name": "partitionU",
+ "docstrings": [],
+ "signature": "let partitionU: (t<'a>, 'a => bool) => (t<'a>, t<'a>)"
+ },
+ {
+ "id": "Belt.Array.partition",
+ "kind": "value",
+ "name": "partition",
+ "docstrings": [
+ "`partition(f, a)` split array into tuple of two arrays based on predicate `f`;\nfirst of tuple where predicate cause true, second where predicate cause false\n\n## Examples\n\n```rescript\nBelt.Array.partition([1, 2, 3, 4, 5], (x) => mod(x, 2) == 0) == ([2, 4], [1, 3, 5])\n\nBelt.Array.partition([1, 2, 3, 4, 5], (x) => mod(x, 2) != 0) == ([1, 3, 5], [2, 4])\n```"
+ ],
+ "signature": "let partition: (t<'a>, 'a => bool) => (t<'a>, t<'a>)"
+ },
+ {
+ "id": "Belt.Array.reduceU",
+ "kind": "value",
+ "name": "reduceU",
+ "docstrings": [],
+ "signature": "let reduceU: (array<'b>, 'a, ('a, 'b) => 'a) => 'a"
+ },
+ {
+ "id": "Belt.Array.reduce",
+ "kind": "value",
+ "name": "reduce",
+ "docstrings": [
+ "`reduce(xs, init, f)` applies `f` to each element of `xs` from beginning to end.\nFunction `f` has two parameters: the item from the list and an “accumulator”;\nwhich starts with a value of `init`. `reduce` returns the final value of the\naccumulator.\n\n## Examples\n\n```rescript\nBelt.Array.reduce([2, 3, 4], 1, (a, b) => a + b) == 10\n\nBelt.Array.reduce([\"a\", \"b\", \"c\", \"d\"], \"\", (a, b) => a ++ b) == \"abcd\"\n```"
+ ],
+ "signature": "let reduce: (array<'b>, 'a, ('a, 'b) => 'a) => 'a"
+ },
+ {
+ "id": "Belt.Array.reduceReverseU",
+ "kind": "value",
+ "name": "reduceReverseU",
+ "docstrings": [],
+ "signature": "let reduceReverseU: (array<'b>, 'a, ('a, 'b) => 'a) => 'a"
+ },
+ {
+ "id": "Belt.Array.reduceReverse",
+ "kind": "value",
+ "name": "reduceReverse",
+ "docstrings": [
+ "`reduceReverse(xs, init, f)` works like `Belt.Array.reduce` except that\nfunction `f` is applied to each item of `xs` from the last back to the first.\n\n## Examples\n\n```rescript\nBelt.Array.reduceReverse([\"a\", \"b\", \"c\", \"d\"], \"\", (a, b) => a ++ b) == \"dcba\"\n```"
+ ],
+ "signature": "let reduceReverse: (array<'b>, 'a, ('a, 'b) => 'a) => 'a"
+ },
+ {
+ "id": "Belt.Array.reduceReverse2U",
+ "kind": "value",
+ "name": "reduceReverse2U",
+ "docstrings": [],
+ "signature": "let reduceReverse2U: (t<'a>, array<'b>, 'c, ('c, 'a, 'b) => 'c) => 'c"
+ },
+ {
+ "id": "Belt.Array.reduceReverse2",
+ "kind": "value",
+ "name": "reduceReverse2",
+ "docstrings": [
+ "`reduceReverse2(xs, ys, init, f)` reduces two arrays xs and ys;taking items\nstarting at `min(length(xs), length(ys))` down to and including zero.\n\n## Examples\n\n```rescript\nBelt.Array.reduceReverse2([1, 2, 3], [1, 2], 0, (acc, x, y) => acc + x + y) == 6\n```"
+ ],
+ "signature": "let reduceReverse2: (t<'a>, array<'b>, 'c, ('c, 'a, 'b) => 'c) => 'c"
+ },
+ {
+ "id": "Belt.Array.reduceWithIndexU",
+ "kind": "value",
+ "name": "reduceWithIndexU",
+ "docstrings": [],
+ "signature": "let reduceWithIndexU: (t<'a>, 'b, ('b, 'a, int) => 'b) => 'b"
+ },
+ {
+ "id": "Belt.Array.reduceWithIndex",
+ "kind": "value",
+ "name": "reduceWithIndex",
+ "docstrings": [
+ "Applies `f` to each element of `xs` from beginning to end. Function `f` has\nthree parameters: the item from the array and an “accumulator”, which starts \nwith a value of `init` and the index of each element. `reduceWithIndex` returns\nthe final value of the accumulator.\n\n## Examples\n\n```rescript\nBelt.Array.reduceWithIndex([1, 2, 3, 4], 0, (acc, x, i) => acc + x + i) == 16\n```"
+ ],
+ "signature": "let reduceWithIndex: (t<'a>, 'b, ('b, 'a, int) => 'b) => 'b"
+ },
+ {
+ "id": "Belt.Array.joinWithU",
+ "kind": "value",
+ "name": "joinWithU",
+ "docstrings": [],
+ "signature": "let joinWithU: (t<'a>, string, 'a => string) => string"
+ },
+ {
+ "id": "Belt.Array.joinWith",
+ "kind": "value",
+ "name": "joinWith",
+ "docstrings": [
+ "`joinWith(xs, sep, toString)`\n\nConcatenates all the elements of `xs` converted to string with `toString`, each\nseparated by `sep`, the string given as the second argument, into a single string.\nIf the array has only one element, then that element will be returned without \nusing the separator. If the array is empty, the empty string will be returned.\n\n## Examples\n\n```rescript\nBelt.Array.joinWith([0, 1], \", \", Js.Int.toString) == \"0, 1\"\nBelt.Array.joinWith([], \" \", Js.Int.toString) == \"\"\nBelt.Array.joinWith([1], \" \", Js.Int.toString) == \"1\"\n```"
+ ],
+ "signature": "let joinWith: (t<'a>, string, 'a => string) => string"
+ },
+ {
+ "id": "Belt.Array.someU",
+ "kind": "value",
+ "name": "someU",
+ "docstrings": [],
+ "signature": "let someU: (t<'a>, 'a => bool) => bool"
+ },
+ {
+ "id": "Belt.Array.some",
+ "kind": "value",
+ "name": "some",
+ "docstrings": [
+ "`some(xs, p)` returns true if at least one of the elements in `xs` satifies `p`;\nwhere `p` is a predicate: a function taking an element and returning a `bool`.\n\n## Examples\n\n```rescript\nBelt.Array.some([2, 3, 4], (x) => mod(x, 2) == 1) == true\n\nBelt.Array.some([(-1), (-3), (-5)], (x) => x > 0) == false\n```"
+ ],
+ "signature": "let some: (t<'a>, 'a => bool) => bool"
+ },
+ {
+ "id": "Belt.Array.everyU",
+ "kind": "value",
+ "name": "everyU",
+ "docstrings": [],
+ "signature": "let everyU: (t<'a>, 'a => bool) => bool"
+ },
+ {
+ "id": "Belt.Array.every",
+ "kind": "value",
+ "name": "every",
+ "docstrings": [
+ "`every(xs, p)` returns `true` if all elements satisfy `p`; where `p` is a\npredicate: a function taking an element and returning a `bool`.\n\n## Examples\n\n```rescript\nBelt.Array.every([1, 3, 5], (x) => mod(x, 2) == 1) == true\n\nBelt.Array.every([1, (-3), 5], (x) => x > 0) == false\n```"
+ ],
+ "signature": "let every: (t<'a>, 'a => bool) => bool"
+ },
+ {
+ "id": "Belt.Array.every2U",
+ "kind": "value",
+ "name": "every2U",
+ "docstrings": [],
+ "signature": "let every2U: (t<'a>, array<'b>, ('a, 'b) => bool) => bool"
+ },
+ {
+ "id": "Belt.Array.every2",
+ "kind": "value",
+ "name": "every2",
+ "docstrings": [
+ "`every2(xs, ys, p)` returns true if `p(xi, yi)` is true for all pairs of\nelements up to the shorter length (i.e. `min(length(xs), length(ys))`)\n\n## Examples\n\n```rescript\nBelt.Array.every2([1, 2, 3], [0, 1], (a, b) => a > b) == true\n\nBelt.Array.every2([], [1], (x, y) => x > y) == true\n\nBelt.Array.every2([2, 3], [1], (x, y) => x > y) == true\n\nBelt.Array.every2([0, 1], [5, 0], (x, y) => x > y) == false\n```"
+ ],
+ "signature": "let every2: (t<'a>, array<'b>, ('a, 'b) => bool) => bool"
+ },
+ {
+ "id": "Belt.Array.some2U",
+ "kind": "value",
+ "name": "some2U",
+ "docstrings": [],
+ "signature": "let some2U: (t<'a>, array<'b>, ('a, 'b) => bool) => bool"
+ },
+ {
+ "id": "Belt.Array.some2",
+ "kind": "value",
+ "name": "some2",
+ "docstrings": [
+ "`some2(xs, ys, p)` returns true if `p(xi, yi)` is true for any pair of elements\nup to the shorter length (i.e. `min(length(xs), length(ys))`)\n\n## Examples\n\n```rescript\nBelt.Array.some2([0, 2], [1, 0, 3], (a, b) => a > b) == true\n\nBelt.Array.some2([], [1], (x, y) => x > y) == false\n\nBelt.Array.some2([2, 3], [1, 4], (x, y) => x > y) == true\n```"
+ ],
+ "signature": "let some2: (t<'a>, array<'b>, ('a, 'b) => bool) => bool"
+ },
+ {
+ "id": "Belt.Array.cmpU",
+ "kind": "value",
+ "name": "cmpU",
+ "docstrings": [],
+ "signature": "let cmpU: (t<'a>, t<'a>, ('a, 'a) => int) => int"
+ },
+ {
+ "id": "Belt.Array.cmp",
+ "kind": "value",
+ "name": "cmp",
+ "docstrings": [
+ "`cmp(xs, ys, f)` compared by length if `length(xs) != length(ys)`; returning `-1`\nif `length(xs) < length(ys)` or 1 if `length(xs) > length(ys)`. Otherwise\ncompare one by one `f(x, y)`. `f` returns a negative number if `x` is “less than” `y`\nzero if `x` is “equal to” `y` a positive number if `x` is “greater than”\n`y`. The comparison returns the first non-zero result of `f`; or zero if `f`\nreturns zero for all `x` and `y`.\n\n## Examples\n\n```rescript\nBelt.Array.cmp([1, 3, 5], [1, 4, 2], (a, b) => compare(a, b)) == -1\n\nBelt.Array.cmp([1, 3, 5], [1, 2, 3], (a, b) => compare(a, b)) == 1\n\nBelt.Array.cmp([1, 3, 5], [1, 3, 5], (a, b) => compare(a, b)) == 0\n```"
+ ],
+ "signature": "let cmp: (t<'a>, t<'a>, ('a, 'a) => int) => int"
+ },
+ {
+ "id": "Belt.Array.eqU",
+ "kind": "value",
+ "name": "eqU",
+ "docstrings": [],
+ "signature": "let eqU: (t<'a>, t<'a>, ('a, 'a) => bool) => bool"
+ },
+ {
+ "id": "Belt.Array.eq",
+ "kind": "value",
+ "name": "eq",
+ "docstrings": [
+ "`eq(xs, ys)` return `false` if length is not the same otherwise compare items\none by one using `f(xi, yi)`; and return true if all results are true false otherwise\n\n## Examples\n\n```rescript\nBelt.Array.eq([1, 2, 3], [(-1), (-2), (-3)], (a, b) => abs(a) == abs(b)) == true\n```"
+ ],
+ "signature": "let eq: (t<'a>, t<'a>, ('a, 'a) => bool) => bool"
+ },
+ {
+ "id": "Belt.Array.truncateToLengthUnsafe",
+ "kind": "value",
+ "name": "truncateToLengthUnsafe",
+ "docstrings": [
+ "Unsafe `truncateToLengthUnsafe(xs, n)` sets length of array `xs` to `n`. If `n`\nis greater than the length of `xs`; the extra elements are set to `Js.Null_undefined.null`.\nIf `n` is less than zero; raises a `RangeError`.\n\n## Examples\n\n```rescript\nlet arr = [\"ant\", \"bee\", \"cat\", \"dog\", \"elk\"]\n\nBelt.Array.truncateToLengthUnsafe(arr, 3)\n\narr == [\"ant\", \"bee\", \"cat\"]\n```"
+ ],
+ "signature": "let truncateToLengthUnsafe: (t<'a>, int) => unit"
+ },
+ {
+ "id": "Belt.Array.initU",
+ "kind": "value",
+ "name": "initU",
+ "docstrings": [],
+ "signature": "let initU: (int, int => 'a) => t<'a>"
+ },
+ {
+ "id": "Belt.Array.init",
+ "kind": "value",
+ "name": "init",
+ "docstrings": [],
+ "signature": "let init: (int, int => 'a) => t<'a>"
+ },
+ {
+ "id": "Belt.Array.push",
+ "kind": "value",
+ "name": "push",
+ "docstrings": [
+ "`arr->push(item)` pushes an element `item` into an array `arr`."
+ ],
+ "signature": "let push: (t<'a>, 'a) => unit"
+ }
+ ]
+ },
+ "belt/id": {
+ "id": "Belt.Id",
+ "name": "Id",
+ "docstrings": [
+ "[`Belt.Id`]()\n\n Provide utilities to create identified comparators or hashes for\n data structures used below.\n\n It create a unique identifier per module of\n functions so that different data structures with slightly different\n comparison functions won't mix",
+ "[`Belt.Id`]()\n\nProvide utiliites to create identified comparators or hashes for\ndata structures used below.\n\nIt create a unique identifer per module of functions so that different data structures with slightly different\ncomparison functions won't mix."
+ ],
+ "items": [
+ {
+ "id": "Belt.Id.hash",
+ "kind": "type",
+ "name": "hash",
+ "docstrings": [
+ "`('a, 'id) hash`\n\nIts runtime represenation is a `hash` function, but signed with a\ntype parameter, so that different hash functions type mismatch"
+ ],
+ "signature": "type hash<'a, 'id>"
+ },
+ {
+ "id": "Belt.Id.eq",
+ "kind": "type",
+ "name": "eq",
+ "docstrings": [
+ "`('a, 'id) eq`\n\nIts runtime represenation is an `eq` function, but signed with a\ntype parameter, so that different hash functions type mismatch"
+ ],
+ "signature": "type eq<'a, 'id>"
+ },
+ {
+ "id": "Belt.Id.cmp",
+ "kind": "type",
+ "name": "cmp",
+ "docstrings": [
+ "`('a,'id) cmp`\n\nIts runtime representation is a `cmp` function, but signed with a\ntype parameter, so that different hash functions type mismatch"
+ ],
+ "signature": "type cmp<'a, 'id>"
+ },
+ {
+ "id": "Belt.Id.comparable",
+ "kind": "type",
+ "name": "comparable",
+ "docstrings": [
+ "`('key, 'id) cmparable` is a module of functions, here it only includes `cmp`.\n\nUnlike normal functions, when created, it comes with a unique identity (guaranteed\nby the type system).\n\nIt can be created using function [`comparableU`]() or [`comparable`]().\n\nThe idea of a unique identity when created is that it makes sure two sets would type\nmismatch if they use different comparison function"
+ ],
+ "signature": "type comparable<'key, 'id> = module(Comparable\n with type identity = 'id\n with type t = 'key)"
+ },
+ {
+ "id": "Belt.Id.comparableU",
+ "kind": "value",
+ "name": "comparableU",
+ "docstrings": [],
+ "signature": "let comparableU: (\n ~cmp: ('a, 'a) => int,\n) => module(Comparable with type t = 'a)"
+ },
+ {
+ "id": "Belt.Id.comparable",
+ "kind": "value",
+ "name": "comparable",
+ "docstrings": [
+ "## Examples\n\n```rescript\nmodule C = (\n val Belt.Id.comparable ~cmp:(compare : int -> int -> int)\n)\nlet m = Belt.Set.make(module C)\n```\nNote that the name of C can not be ignored"
+ ],
+ "signature": "let comparable: (\n ~cmp: ('a, 'a) => int,\n) => module(Comparable with type t = 'a)"
+ },
+ {
+ "id": "Belt.Id.hashable",
+ "kind": "type",
+ "name": "hashable",
+ "docstrings": [
+ "`('key, 'id) hashable` is a module of functions, here it only includes `hash`, `eq`.\n\nUnlike normal functions, when created, it comes with a unique identity (guaranteed\nby the type system).\n\nIt can be created using function [`hashableU`]() or [`hashable`]().\n\nThe idea of a unique identity when created is that it makes sure two hash sets would type\nmismatch if they use different comparison function"
+ ],
+ "signature": "type hashable<'key, 'id> = module(Hashable\n with type identity = 'id\n with type t = 'key)"
+ },
+ {
+ "id": "Belt.Id.hashableU",
+ "kind": "value",
+ "name": "hashableU",
+ "docstrings": [],
+ "signature": "let hashableU: (\n ~hash: 'a => int,\n ~eq: ('a, 'a) => bool,\n) => module(Hashable with type t = 'a)"
+ },
+ {
+ "id": "Belt.Id.hashable",
+ "kind": "value",
+ "name": "hashable",
+ "docstrings": [],
+ "signature": "let hashable: (\n ~hash: 'a => int,\n ~eq: ('a, 'a) => bool,\n) => module(Hashable with type t = 'a)"
+ },
+ {
+ "id": "Belt.Id.getHashInternal",
+ "kind": "value",
+ "name": "getHashInternal",
+ "docstrings": [],
+ "signature": "let getHashInternal: hash<'a, 'id> => 'a => int"
+ },
+ {
+ "id": "Belt.Id.getEqInternal",
+ "kind": "value",
+ "name": "getEqInternal",
+ "docstrings": [],
+ "signature": "let getEqInternal: eq<'a, 'id> => ('a, 'a) => bool"
+ },
+ {
+ "id": "Belt.Id.getCmpInternal",
+ "kind": "value",
+ "name": "getCmpInternal",
+ "docstrings": [],
+ "signature": "let getCmpInternal: cmp<'a, 'id> => ('a, 'a) => int"
+ }
+ ]
+ }
+}
diff --git a/data/api/v11.0.0/core.json b/data/api/v11.0.0/core.json
new file mode 100644
index 000000000..fc8e00078
--- /dev/null
+++ b/data/api/v11.0.0/core.json
@@ -0,0 +1,9894 @@
+{
+ "core": {
+ "id": "Core",
+ "name": "Core",
+ "docstrings": [],
+ "items": [
+ {
+ "id": "Core.timeoutId",
+ "kind": "type",
+ "name": "timeoutId",
+ "docstrings": [
+ "An `id` representing a timeout started via `setTimeout`.\n\nSee [`setTimeout`](https://developer.mozilla.org/en-US/docs/Web/API/setTimeout) on MDN."
+ ],
+ "signature": "type timeoutId = Js.Global.timeoutId"
+ },
+ {
+ "id": "Core.setTimeout",
+ "kind": "value",
+ "name": "setTimeout",
+ "docstrings": [
+ "`setTimeout(callback, durationInMilliseconds)` starts a timer that will execute `callback` after `durationInMilliseconds`.\n\nSee [`setTimeout`](https://developer.mozilla.org/en-US/docs/Web/API/setTimeout) on MDN.\n\n## Examples\n```rescript\n// Log to the console after 2 seconds (2000 milliseconds).\nlet timeoutId = setTimeout(() => {\n Console.log(\"This prints in 2 seconds.\")\n}, 2000)\n```"
+ ],
+ "signature": "let setTimeout: (unit => unit, int) => timeoutId"
+ },
+ {
+ "id": "Core.setTimeoutFloat",
+ "kind": "value",
+ "name": "setTimeoutFloat",
+ "docstrings": [
+ "`setTimeoutFloat(callback, durationInMilliseconds)` starts a timer that will execute `callback` after `durationInMilliseconds`.\n\nThe same as `setTimeout`, but allows you to pass a `float` instead of an `int` for the duration.\n\nSee [`setTimeout`](https://developer.mozilla.org/en-US/docs/Web/API/setTimeout) on MDN.\n\n## Examples\n```rescript\n// Log to the console after 2 seconds (2000 milliseconds).\nlet timeoutId = setTimeoutFloat(() => {\n Console.log(\"This prints in 2 seconds.\")\n}, 2000.)\n```"
+ ],
+ "signature": "let setTimeoutFloat: (unit => unit, float) => timeoutId"
+ },
+ {
+ "id": "Core.clearTimeout",
+ "kind": "value",
+ "name": "clearTimeout",
+ "docstrings": [
+ "`clearTimeout(timeoutId)` clears a scheduled timeout if it hasn't already executed.\n\nSee [`clearTimeout`](https://developer.mozilla.org/en-US/docs/Web/API/clearTimeout) on MDN.\n\n## Examples\n```rescript\nlet timeoutId = setTimeout(() => {\n Console.log(\"This prints in 2 seconds.\")\n}, 2000)\n\n// Clearing the timeout right away, before 2 seconds has passed, means that the above callback logging to the console will never run.\nclearTimeout(timeoutId)\n```"
+ ],
+ "signature": "let clearTimeout: timeoutId => unit"
+ },
+ {
+ "id": "Core.intervalId",
+ "kind": "type",
+ "name": "intervalId",
+ "docstrings": [
+ "An `id` representing an interval started via `setInterval`.\n\nSee [`setInterval`](https://developer.mozilla.org/en-US/docs/Web/API/setInterval) on MDN."
+ ],
+ "signature": "type intervalId = Js.Global.intervalId"
+ },
+ {
+ "id": "Core.setInterval",
+ "kind": "value",
+ "name": "setInterval",
+ "docstrings": [
+ "`setInterval(callback, intervalInMilliseconds)` starts an interval that will execute `callback` every `durationInMilliseconds` milliseconds.\n\nSee [`setInterval`](https://developer.mozilla.org/en-US/docs/Web/API/setInterval) on MDN.\n\n## Examples\n```rescript\n// Log to the console ever 2 seconds (2000 milliseconds).\nlet intervalId = setInterval(() => {\n Console.log(\"This prints every 2 seconds.\")\n}, 2000)\n```"
+ ],
+ "signature": "let setInterval: (unit => unit, int) => intervalId"
+ },
+ {
+ "id": "Core.setIntervalFloat",
+ "kind": "value",
+ "name": "setIntervalFloat",
+ "docstrings": [
+ "`setIntervalFloat(callback, intervalInMilliseconds)` starts an interval that will execute `callback` every `durationInMilliseconds` milliseconds.\n\nThe same as `setInterval`, but allows you to pass a `float` instead of an `int` for the duration.\n\nSee [`setInterval`](https://developer.mozilla.org/en-US/docs/Web/API/setInterval) on MDN.\n\n## Examples\n```rescript\n// Log to the console ever 2 seconds (2000 milliseconds).\nlet intervalId = setIntervalFloat(() => {\n Console.log(\"This prints every 2 seconds.\")\n}, 2000.)\n```"
+ ],
+ "signature": "let setIntervalFloat: (unit => unit, float) => intervalId"
+ },
+ {
+ "id": "Core.clearInterval",
+ "kind": "value",
+ "name": "clearInterval",
+ "docstrings": [
+ "`clearInterval(intervalId)` clears a scheduled interval.\n\nSee [`clearInterval`](https://developer.mozilla.org/en-US/docs/Web/API/clearInterval) on MDN.\n\n## Examples\n```rescript\nlet intervalId = setInterval(() => {\n Console.log(\"This prints in 2 seconds.\")\n}, 2000)\n\n// Stop the interval after 10 seconds\nlet timeoutId = setTimeout(() => {\n clearInterval(intervalId)\n}, 10000)\n```"
+ ],
+ "signature": "let clearInterval: intervalId => unit"
+ },
+ {
+ "id": "Core.encodeURI",
+ "kind": "value",
+ "name": "encodeURI",
+ "docstrings": [
+ "Encodes a URI by replacing characters in the provided string that aren't valid in a URL.\n\nThis is intended to operate on full URIs, so it encodes fewer characters than what `encodeURIComponent` does.\nIf you're looking to encode just parts of a URI, like a query parameter, prefer `encodeURIComponent`.\n\nSee [`encodeURI`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURI) on MDN.\n\n## Examples\n```rescript\nConsole.log(encodeURI(\"https://rescript-lang.org?array=[someValue]\"))\n// Logs \"https://rescript-lang.org?array=%5BsomeValue%5D\" to the console.\n```"
+ ],
+ "signature": "let encodeURI: string => string"
+ },
+ {
+ "id": "Core.decodeURI",
+ "kind": "value",
+ "name": "decodeURI",
+ "docstrings": [
+ "Decodes a previously encoded URI back to a regular string.\n\nThis is intended to operate on full URIs, so it decodes fewer characters than what `decodeURIComponent` does.\nIf you're looking to decode just parts of a URI, like a query parameter, prefer `decodeURIComponent`.\n\nSee [`decodeURI`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURI) on MDN.\n\n## Examples\n```rescript\nConsole.log(decodeURI(\"https://rescript-lang.org?array=%5BsomeValue%5D\"))\n// Logs \"https://rescript-lang.org?array=[someValue]\" to the console.\n```"
+ ],
+ "signature": "let decodeURI: string => string"
+ },
+ {
+ "id": "Core.encodeURIComponent",
+ "kind": "value",
+ "name": "encodeURIComponent",
+ "docstrings": [
+ "Encodes a string so it can be used as part of a URI.\n\nSee [`encodeURIComponent`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent) on MDN.\n\n## Examples\n```rescript\nConsole.log(encodeURIComponent(\"array=[someValue]\"))\n// Logs \"array%3D%5BsomeValue%5D\" to the console.\n```"
+ ],
+ "signature": "let encodeURIComponent: string => string"
+ },
+ {
+ "id": "Core.decodeURIComponent",
+ "kind": "value",
+ "name": "decodeURIComponent",
+ "docstrings": [
+ "Decodes a previously URI encoded string back to its original form.\n\nSee [`decodeURIComponent`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURIComponent) on MDN.\n\n## Examples\n```rescript\nConsole.log(decodeURIComponent(\"array%3D%5BsomeValue%5D\"))\n// Logs \"array=[someValue]\" to the console.\n```"
+ ],
+ "signature": "let decodeURIComponent: string => string"
+ },
+ {
+ "id": "Core.window",
+ "kind": "value",
+ "name": "window",
+ "docstrings": [],
+ "signature": "let window: Dom.window"
+ },
+ {
+ "id": "Core.document",
+ "kind": "value",
+ "name": "document",
+ "docstrings": [],
+ "signature": "let document: Dom.document"
+ },
+ {
+ "id": "Core.globalThis",
+ "kind": "value",
+ "name": "globalThis",
+ "docstrings": [],
+ "signature": "let globalThis: {..}"
+ },
+ {
+ "id": "Core.null",
+ "kind": "value",
+ "name": "null",
+ "docstrings": [],
+ "signature": "let null: Core__Nullable.t<'a>"
+ },
+ {
+ "id": "Core.undefined",
+ "kind": "value",
+ "name": "undefined",
+ "docstrings": [],
+ "signature": "let undefined: Core__Nullable.t<'a>"
+ },
+ {
+ "id": "Core.typeof",
+ "kind": "value",
+ "name": "typeof",
+ "docstrings": [],
+ "signature": "let typeof: 'a => Core__Type.t"
+ },
+ {
+ "id": "Core.import",
+ "kind": "value",
+ "name": "import",
+ "docstrings": [
+ "`import(value)` dynamically import a value or function from a ReScript\nmodule. The import call will return a `promise`, resolving to the dynamically loaded\nvalue.\n\n## Examples\n\n`Core__Array.res` file:\n\n```rescript\n@send external indexOf: (array<'a>, 'a) => int = \"indexOf\"\n\nlet indexOfOpt = (arr, item) =>\n switch arr->indexOf(item) {\n | -1 => None\n | index => Some(index)\n }\n```\nIn other file you can import the `indexOfOpt` value defined in `Core__Array.res`\n\n```rescript\nlet main = async () => {\n let indexOfOpt = await import(Core__Array.indexOfOpt)\n let index = indexOfOpt([1, 2], 2)\n Console.log(index)\n}\n```\n\nCompiles to:\n\n```javascript\nasync function main() {\n var add = await import(\"./Core__Array.mjs\").then(function(m) {\n return m.indexOfOpt;\n });\n var index = indexOfOpt([1, 2], 2);\n console.log(index);\n}\n```"
+ ],
+ "signature": "let import: 'a => promise<'a>"
+ },
+ {
+ "id": "Core.null",
+ "kind": "type",
+ "name": "null",
+ "docstrings": [],
+ "signature": "type null<'a> = Js.null<'a>"
+ },
+ {
+ "id": "Core.undefined",
+ "kind": "type",
+ "name": "undefined",
+ "docstrings": [],
+ "signature": "type undefined<'a> = Js.undefined<'a>"
+ },
+ {
+ "id": "Core.nullable",
+ "kind": "type",
+ "name": "nullable",
+ "docstrings": [],
+ "signature": "type nullable<'a> = Js.nullable<'a>"
+ },
+ {
+ "id": "Core.panic",
+ "kind": "value",
+ "name": "panic",
+ "docstrings": [],
+ "signature": "let panic: string => 'a"
+ }
+ ]
+ },
+ "core/intl/numberformat/grouping": {
+ "id": "Core.Intl.NumberFormat.Grouping",
+ "name": "Grouping",
+ "docstrings": [],
+ "items": [
+ {
+ "id": "Core.Intl.NumberFormat.Grouping.t",
+ "kind": "type",
+ "name": "t",
+ "docstrings": [],
+ "signature": "type t"
+ },
+ {
+ "id": "Core.Intl.NumberFormat.Grouping.parsed",
+ "kind": "type",
+ "name": "parsed",
+ "docstrings": [],
+ "signature": "type parsed = [#always | #auto | #bool(bool) | #min2]"
+ },
+ {
+ "id": "Core.Intl.NumberFormat.Grouping.fromBool",
+ "kind": "value",
+ "name": "fromBool",
+ "docstrings": [],
+ "signature": "let fromBool: bool => t"
+ },
+ {
+ "id": "Core.Intl.NumberFormat.Grouping.fromString",
+ "kind": "value",
+ "name": "fromString",
+ "docstrings": [],
+ "signature": "let fromString: [#always | #auto | #min2] => t"
+ },
+ {
+ "id": "Core.Intl.NumberFormat.Grouping.parseJsValue",
+ "kind": "value",
+ "name": "parseJsValue",
+ "docstrings": [],
+ "signature": "let parseJsValue: 'a => option<[> #always | #auto | #bool(bool) | #min2]>"
+ }
+ ]
+ },
+ "core/intl/segments": {
+ "id": "Core.Intl.Segments",
+ "name": "Segments",
+ "docstrings": [
+ "A Segments instance is an object that represents the segments of a specific string, subject to the locale and options of its constructing Intl.Segmenter instance.\nhttps://tc39.es/ecma402/#sec-segments-objects"
+ ],
+ "items": [
+ {
+ "id": "Core.Intl.Segments.t",
+ "kind": "type",
+ "name": "t",
+ "docstrings": [],
+ "signature": "type t"
+ },
+ {
+ "id": "Core.Intl.Segments.segmentData",
+ "kind": "type",
+ "name": "segmentData",
+ "docstrings": [],
+ "signature": "type segmentData = {\n segment: string,\n index: int,\n isWordLike: option,\n input: string,\n}"
+ },
+ {
+ "id": "Core.Intl.Segments.containing",
+ "kind": "value",
+ "name": "containing",
+ "docstrings": [],
+ "signature": "let containing: t => segmentData"
+ },
+ {
+ "id": "Core.Intl.Segments.containingWithIndex",
+ "kind": "value",
+ "name": "containingWithIndex",
+ "docstrings": [],
+ "signature": "let containingWithIndex: (t, int) => segmentData"
+ }
+ ]
+ },
+ "core/intl/segmenter": {
+ "id": "Core.Intl.Segmenter",
+ "name": "Segmenter",
+ "docstrings": ["Not supported in Firefox"],
+ "items": [
+ {
+ "id": "Core.Intl.Segmenter.t",
+ "kind": "type",
+ "name": "t",
+ "docstrings": [],
+ "signature": "type t"
+ },
+ {
+ "id": "Core.Intl.Segmenter.granularity",
+ "kind": "type",
+ "name": "granularity",
+ "docstrings": [],
+ "signature": "type granularity = [#grapheme | #sentence | #word]"
+ },
+ {
+ "id": "Core.Intl.Segmenter.options",
+ "kind": "type",
+ "name": "options",
+ "docstrings": [],
+ "signature": "type options = {\n localeMatcher?: Core__Intl__Common.localeMatcher,\n granularity?: granularity,\n}"
+ },
+ {
+ "id": "Core.Intl.Segmenter.pluralCategories",
+ "kind": "type",
+ "name": "pluralCategories",
+ "docstrings": [],
+ "signature": "type pluralCategories = [\n | #few\n | #many\n | #one\n | #other\n | #two\n | #zero\n]"
+ },
+ {
+ "id": "Core.Intl.Segmenter.resolvedOptions",
+ "kind": "type",
+ "name": "resolvedOptions",
+ "docstrings": [],
+ "signature": "type resolvedOptions = {\n locale: string,\n granularity: granularity,\n}"
+ },
+ {
+ "id": "Core.Intl.Segmenter.supportedLocalesOptions",
+ "kind": "type",
+ "name": "supportedLocalesOptions",
+ "docstrings": [],
+ "signature": "type supportedLocalesOptions = {\n localeMatcher: Core__Intl__Common.localeMatcher,\n}"
+ },
+ {
+ "id": "Core.Intl.Segmenter.make",
+ "kind": "value",
+ "name": "make",
+ "docstrings": [],
+ "signature": "let make: (~locales: array=?, ~options: options=?) => t"
+ },
+ {
+ "id": "Core.Intl.Segmenter.supportedLocalesOf",
+ "kind": "value",
+ "name": "supportedLocalesOf",
+ "docstrings": [],
+ "signature": "let supportedLocalesOf: (array, ~options: supportedLocalesOptions=?) => t"
+ },
+ {
+ "id": "Core.Intl.Segmenter.resolvedOptions",
+ "kind": "value",
+ "name": "resolvedOptions",
+ "docstrings": [],
+ "signature": "let resolvedOptions: t => resolvedOptions"
+ },
+ {
+ "id": "Core.Intl.Segmenter.segment",
+ "kind": "value",
+ "name": "segment",
+ "docstrings": [],
+ "signature": "let segment: (t, string) => Core__Intl__Segments.t"
+ }
+ ]
+ },
+ "core/intl/relativetimeformat": {
+ "id": "Core.Intl.RelativeTimeFormat",
+ "name": "RelativeTimeFormat",
+ "docstrings": [],
+ "items": [
+ {
+ "id": "Core.Intl.RelativeTimeFormat.t",
+ "kind": "type",
+ "name": "t",
+ "docstrings": [],
+ "signature": "type t"
+ },
+ {
+ "id": "Core.Intl.RelativeTimeFormat.numeric",
+ "kind": "type",
+ "name": "numeric",
+ "docstrings": [],
+ "signature": "type numeric = [#always | #auto]"
+ },
+ {
+ "id": "Core.Intl.RelativeTimeFormat.style",
+ "kind": "type",
+ "name": "style",
+ "docstrings": [],
+ "signature": "type style = [#long | #narrow | #short]"
+ },
+ {
+ "id": "Core.Intl.RelativeTimeFormat.timeUnit",
+ "kind": "type",
+ "name": "timeUnit",
+ "docstrings": [],
+ "signature": "type timeUnit = [\n | #day\n | #hour\n | #minute\n | #month\n | #quarter\n | #second\n | #week\n | #year\n]"
+ },
+ {
+ "id": "Core.Intl.RelativeTimeFormat.options",
+ "kind": "type",
+ "name": "options",
+ "docstrings": [],
+ "signature": "type options = {\n localeMatcher?: Core__Intl__Common.localeMatcher,\n numeric?: numeric,\n style?: style,\n}"
+ },
+ {
+ "id": "Core.Intl.RelativeTimeFormat.supportedLocalesOptions",
+ "kind": "type",
+ "name": "supportedLocalesOptions",
+ "docstrings": [],
+ "signature": "type supportedLocalesOptions = {\n localeMatcher: Core__Intl__Common.localeMatcher,\n}"
+ },
+ {
+ "id": "Core.Intl.RelativeTimeFormat.resolvedOptions",
+ "kind": "type",
+ "name": "resolvedOptions",
+ "docstrings": [],
+ "signature": "type resolvedOptions = {\n locale: string,\n numeric: numeric,\n style: style,\n numberingSystem: string,\n}"
+ },
+ {
+ "id": "Core.Intl.RelativeTimeFormat.relativeTimePartComponent",
+ "kind": "type",
+ "name": "relativeTimePartComponent",
+ "docstrings": [],
+ "signature": "type relativeTimePartComponent = [#integer | #literal]"
+ },
+ {
+ "id": "Core.Intl.RelativeTimeFormat.relativeTimePart",
+ "kind": "type",
+ "name": "relativeTimePart",
+ "docstrings": [],
+ "signature": "type relativeTimePart = {\n \\\"type\": relativeTimePartComponent,\n value: string,\n unit?: timeUnit,\n}"
+ },
+ {
+ "id": "Core.Intl.RelativeTimeFormat.make",
+ "kind": "value",
+ "name": "make",
+ "docstrings": [],
+ "signature": "let make: (~locales: array=?, ~options: options=?) => t"
+ },
+ {
+ "id": "Core.Intl.RelativeTimeFormat.supportedLocalesOf",
+ "kind": "value",
+ "name": "supportedLocalesOf",
+ "docstrings": [],
+ "signature": "let supportedLocalesOf: (array, ~options: supportedLocalesOptions=?) => t"
+ },
+ {
+ "id": "Core.Intl.RelativeTimeFormat.resolvedOptions",
+ "kind": "value",
+ "name": "resolvedOptions",
+ "docstrings": [],
+ "signature": "let resolvedOptions: t => resolvedOptions"
+ },
+ {
+ "id": "Core.Intl.RelativeTimeFormat.format",
+ "kind": "value",
+ "name": "format",
+ "docstrings": [],
+ "signature": "let format: (t, int, timeUnit) => string"
+ },
+ {
+ "id": "Core.Intl.RelativeTimeFormat.formatToParts",
+ "kind": "value",
+ "name": "formatToParts",
+ "docstrings": [],
+ "signature": "let formatToParts: (t, int, timeUnit) => array"
+ }
+ ]
+ },
+ "core/intl/pluralrules": {
+ "id": "Core.Intl.PluralRules",
+ "name": "PluralRules",
+ "docstrings": [],
+ "items": [
+ {
+ "id": "Core.Intl.PluralRules.t",
+ "kind": "type",
+ "name": "t",
+ "docstrings": [],
+ "signature": "type t"
+ },
+ {
+ "id": "Core.Intl.PluralRules.localeType",
+ "kind": "type",
+ "name": "localeType",
+ "docstrings": [],
+ "signature": "type localeType = [#cardinal | #ordinal]"
+ },
+ {
+ "id": "Core.Intl.PluralRules.options",
+ "kind": "type",
+ "name": "options",
+ "docstrings": [],
+ "signature": "type options = {\n localeMatcher?: Core__Intl__Common.localeMatcher,\n \\\"type\"?: localeType,\n minimumIntegerDigits?: Core__Intl__Common.oneTo21,\n minimumFractionDigits?: Core__Intl__Common.zeroTo20,\n maximumFractionDigits?: Core__Intl__Common.zeroTo20,\n minimumSignificantDigits?: Core__Intl__Common.oneTo21,\n maximumSignificantDigits?: Core__Intl__Common.oneTo21,\n}"
+ },
+ {
+ "id": "Core.Intl.PluralRules.pluralCategories",
+ "kind": "type",
+ "name": "pluralCategories",
+ "docstrings": [],
+ "signature": "type pluralCategories = [\n | #few\n | #many\n | #one\n | #other\n | #two\n | #zero\n]"
+ },
+ {
+ "id": "Core.Intl.PluralRules.resolvedOptions",
+ "kind": "type",
+ "name": "resolvedOptions",
+ "docstrings": [],
+ "signature": "type resolvedOptions = {\n locale: string,\n pluralCategories: array,\n \\\"type\": localeType,\n minimumIntegerDigits?: Core__Intl__Common.oneTo21,\n minimumFractionDigits?: Core__Intl__Common.zeroTo20,\n maximumFractionDigits?: Core__Intl__Common.zeroTo20,\n minimumSignificantDigits?: Core__Intl__Common.oneTo21,\n maximumSignificantDigits?: Core__Intl__Common.oneTo21,\n}"
+ },
+ {
+ "id": "Core.Intl.PluralRules.supportedLocalesOptions",
+ "kind": "type",
+ "name": "supportedLocalesOptions",
+ "docstrings": [],
+ "signature": "type supportedLocalesOptions = {\n localeMatcher: Core__Intl__Common.localeMatcher,\n}"
+ },
+ {
+ "id": "Core.Intl.PluralRules.make",
+ "kind": "value",
+ "name": "make",
+ "docstrings": [],
+ "signature": "let make: (~locales: array=?, ~options: options=?) => t"
+ },
+ {
+ "id": "Core.Intl.PluralRules.supportedLocalesOf",
+ "kind": "value",
+ "name": "supportedLocalesOf",
+ "docstrings": [],
+ "signature": "let supportedLocalesOf: (array, ~options: supportedLocalesOptions=?) => t"
+ },
+ {
+ "id": "Core.Intl.PluralRules.resolvedOptions",
+ "kind": "value",
+ "name": "resolvedOptions",
+ "docstrings": [],
+ "signature": "let resolvedOptions: t => resolvedOptions"
+ },
+ {
+ "id": "Core.Intl.PluralRules.rule",
+ "kind": "type",
+ "name": "rule",
+ "docstrings": [],
+ "signature": "type rule = [#few | #many | #one | #other | #two | #zero]"
+ },
+ {
+ "id": "Core.Intl.PluralRules.select",
+ "kind": "value",
+ "name": "select",
+ "docstrings": [],
+ "signature": "let select: (t, float) => rule"
+ },
+ {
+ "id": "Core.Intl.PluralRules.selectInt",
+ "kind": "value",
+ "name": "selectInt",
+ "docstrings": [],
+ "signature": "let selectInt: (t, int) => rule"
+ },
+ {
+ "id": "Core.Intl.PluralRules.selectBigInt",
+ "kind": "value",
+ "name": "selectBigInt",
+ "docstrings": [],
+ "signature": "let selectBigInt: (t, bigint) => rule"
+ },
+ {
+ "id": "Core.Intl.PluralRules.selectRange",
+ "kind": "value",
+ "name": "selectRange",
+ "docstrings": [],
+ "signature": "let selectRange: (t, ~start: float, ~end: float) => rule"
+ },
+ {
+ "id": "Core.Intl.PluralRules.selectRangeInt",
+ "kind": "value",
+ "name": "selectRangeInt",
+ "docstrings": [],
+ "signature": "let selectRangeInt: (t, ~start: int, ~end: int) => rule"
+ },
+ {
+ "id": "Core.Intl.PluralRules.selectRangeBigInt",
+ "kind": "value",
+ "name": "selectRangeBigInt",
+ "docstrings": [],
+ "signature": "let selectRangeBigInt: (t, ~start: bigint, ~end: bigint) => rule"
+ }
+ ]
+ },
+ "core/intl/numberformat": {
+ "id": "Core.Intl.NumberFormat",
+ "name": "NumberFormat",
+ "docstrings": [],
+ "items": [
+ {
+ "id": "Core.Intl.NumberFormat.t",
+ "kind": "type",
+ "name": "t",
+ "docstrings": [],
+ "signature": "type t"
+ },
+ {
+ "id": "Core.Intl.NumberFormat.currency",
+ "kind": "type",
+ "name": "currency",
+ "docstrings": ["An ISO 4217 currency code. e.g. USD, EUR, CNY"],
+ "signature": "type currency = string"
+ },
+ {
+ "id": "Core.Intl.NumberFormat.currencyDisplay",
+ "kind": "type",
+ "name": "currencyDisplay",
+ "docstrings": [],
+ "signature": "type currencyDisplay = [\n | #code\n | #name\n | #narrowSymbol\n | #symbol\n]"
+ },
+ {
+ "id": "Core.Intl.NumberFormat.currencySign",
+ "kind": "type",
+ "name": "currencySign",
+ "docstrings": [],
+ "signature": "type currencySign = [#accounting | #standard]"
+ },
+ {
+ "id": "Core.Intl.NumberFormat.notation",
+ "kind": "type",
+ "name": "notation",
+ "docstrings": [],
+ "signature": "type notation = [\n | #compact\n | #engineering\n | #scientific\n | #standard\n]"
+ },
+ {
+ "id": "Core.Intl.NumberFormat.compactDisplay",
+ "kind": "type",
+ "name": "compactDisplay",
+ "docstrings": ["Used only when notation is #compact"],
+ "signature": "type compactDisplay = [#long | #short]"
+ },
+ {
+ "id": "Core.Intl.NumberFormat.signDisplay",
+ "kind": "type",
+ "name": "signDisplay",
+ "docstrings": [],
+ "signature": "type signDisplay = [\n | #always\n | #auto\n | #exceptZero\n | #negative\n | #never\n]"
+ },
+ {
+ "id": "Core.Intl.NumberFormat.style",
+ "kind": "type",
+ "name": "style",
+ "docstrings": [],
+ "signature": "type style = [#currency | #decimal | #percent | #unit]"
+ },
+ {
+ "id": "Core.Intl.NumberFormat.unitSystem",
+ "kind": "type",
+ "name": "unitSystem",
+ "docstrings": [
+ "Defined in https://tc39.es/proposal-unified-intl-numberformat/section6/locales-currencies-tz_proposed_out.html#sec-issanctionedsimpleunitidentifier\nOnly used when style is #unit"
+ ],
+ "signature": "type unitSystem = string"
+ },
+ {
+ "id": "Core.Intl.NumberFormat.unitDisplay",
+ "kind": "type",
+ "name": "unitDisplay",
+ "docstrings": ["Only used when style is #unit"],
+ "signature": "type unitDisplay = [#long | #narrow | #short]"
+ },
+ {
+ "id": "Core.Intl.NumberFormat.rounding",
+ "kind": "type",
+ "name": "rounding",
+ "docstrings": [],
+ "signature": "type rounding = [\n | #ceil\n | #expand\n | #floor\n | #halfCeil\n | #halfEven\n | #halfExpand\n | #halfFloor\n | #halfTrunc\n | #trunc\n]"
+ },
+ {
+ "id": "Core.Intl.NumberFormat.roundingPriority",
+ "kind": "type",
+ "name": "roundingPriority",
+ "docstrings": [],
+ "signature": "type roundingPriority = [\n | #auto\n | #lessPrecision\n | #morePrecision\n]"
+ },
+ {
+ "id": "Core.Intl.NumberFormat.roundingIncrement",
+ "kind": "type",
+ "name": "roundingIncrement",
+ "docstrings": [],
+ "signature": "type roundingIncrement = [\n | #1\n | #10\n | #100\n | #1000\n | #2\n | #20\n | #200\n | #2000\n | #25\n | #250\n | #2500\n | #5\n | #50\n | #500\n | #5000\n]"
+ },
+ {
+ "id": "Core.Intl.NumberFormat.trailingZeroDisplay",
+ "kind": "type",
+ "name": "trailingZeroDisplay",
+ "docstrings": [],
+ "signature": "type trailingZeroDisplay = [\n | #auto\n | #lessPrecision\n | #stripIfInteger\n]"
+ },
+ {
+ "id": "Core.Intl.NumberFormat.options",
+ "kind": "type",
+ "name": "options",
+ "docstrings": [],
+ "signature": "type options = {\n compactDisplay?: compactDisplay,\n numberingSystem?: Core__Intl__Common.numberingSystem,\n currency?: currency,\n currencyDisplay?: currencyDisplay,\n currencySign?: currencySign,\n localeMatcher?: Core__Intl__Common.localeMatcher,\n notation?: notation,\n signDisplay?: signDisplay,\n style?: style,\n unit?: unitSystem,\n unitDisplay?: unitDisplay,\n useGrouping?: Grouping.t,\n roundingMode?: rounding,\n roundingPriority?: roundingPriority,\n roundingIncrement?: roundingIncrement,\n trailingZeroDisplay?: trailingZeroDisplay,\n minimumIntegerDigits?: Core__Intl__Common.oneTo21,\n minimumFractionDigits?: Core__Intl__Common.zeroTo20,\n maximumFractionDigits?: Core__Intl__Common.zeroTo20,\n minimumSignificantDigits?: Core__Intl__Common.oneTo21,\n maximumSignificantDigits?: Core__Intl__Common.oneTo21,\n}"
+ },
+ {
+ "id": "Core.Intl.NumberFormat.resolvedOptions",
+ "kind": "type",
+ "name": "resolvedOptions",
+ "docstrings": [],
+ "signature": "type resolvedOptions = {\n currency?: currency,\n currencyDisplay?: currencyDisplay,\n currencySign?: currencySign,\n compactDisplay?: compactDisplay,\n unit: unitSystem,\n unitDisplay: unitDisplay,\n roundingMode?: rounding,\n roundingPriority?: roundingPriority,\n roundingIncrement?: roundingIncrement,\n minimumIntegerDigits?: Core__Intl__Common.oneTo21,\n minimumFractionDigits?: Core__Intl__Common.zeroTo20,\n maximumFractionDigits?: Core__Intl__Common.zeroTo20,\n minimumSignificantDigits?: Core__Intl__Common.oneTo21,\n maximumSignificantDigits?: Core__Intl__Common.oneTo21,\n locale: string,\n notation: notation,\n numberingSystem: Core__Intl__Common.numberingSystem,\n signDisplay: signDisplay,\n style: style,\n useGrouping: Grouping.t,\n}"
+ },
+ {
+ "id": "Core.Intl.NumberFormat.supportedLocalesOptions",
+ "kind": "type",
+ "name": "supportedLocalesOptions",
+ "docstrings": [],
+ "signature": "type supportedLocalesOptions = {\n localeMatcher: Core__Intl__Common.localeMatcher,\n}"
+ },
+ {
+ "id": "Core.Intl.NumberFormat.numberFormatPartType",
+ "kind": "type",
+ "name": "numberFormatPartType",
+ "docstrings": [],
+ "signature": "type numberFormatPartType = [\n | #compact\n | #currency\n | #decimal\n | #exponentInteger\n | #exponentMinusSign\n | #exponentSeparator\n | #fraction\n | #group\n | #infinity\n | #integer\n | #literal\n | #minusSign\n | #nan\n | #percentSign\n | #plusSign\n | #unit\n | #unknown\n]"
+ },
+ {
+ "id": "Core.Intl.NumberFormat.numberFormatPart",
+ "kind": "type",
+ "name": "numberFormatPart",
+ "docstrings": [],
+ "signature": "type numberFormatPart = {\n \\\"type\": numberFormatPartType,\n value: string,\n}"
+ },
+ {
+ "id": "Core.Intl.NumberFormat.rangeSource",
+ "kind": "type",
+ "name": "rangeSource",
+ "docstrings": [],
+ "signature": "type rangeSource = [#endRange | #shared | #startRange]"
+ },
+ {
+ "id": "Core.Intl.NumberFormat.numberFormatRangePart",
+ "kind": "type",
+ "name": "numberFormatRangePart",
+ "docstrings": [],
+ "signature": "type numberFormatRangePart = {\n \\\"type\": numberFormatPartType,\n value: string,\n source: rangeSource,\n}"
+ },
+ {
+ "id": "Core.Intl.NumberFormat.make",
+ "kind": "value",
+ "name": "make",
+ "docstrings": [],
+ "signature": "let make: (~locales: array=?, ~options: options=?) => t"
+ },
+ {
+ "id": "Core.Intl.NumberFormat.supportedLocalesOf",
+ "kind": "value",
+ "name": "supportedLocalesOf",
+ "docstrings": [],
+ "signature": "let supportedLocalesOf: (array, ~options: supportedLocalesOptions=?) => t"
+ },
+ {
+ "id": "Core.Intl.NumberFormat.resolvedOptions",
+ "kind": "value",
+ "name": "resolvedOptions",
+ "docstrings": [],
+ "signature": "let resolvedOptions: t => resolvedOptions"
+ },
+ {
+ "id": "Core.Intl.NumberFormat.format",
+ "kind": "value",
+ "name": "format",
+ "docstrings": [],
+ "signature": "let format: (t, float) => string"
+ },
+ {
+ "id": "Core.Intl.NumberFormat.formatRange",
+ "kind": "value",
+ "name": "formatRange",
+ "docstrings": [],
+ "signature": "let formatRange: (t, ~start: float, ~end: float) => array"
+ },
+ {
+ "id": "Core.Intl.NumberFormat.formatToParts",
+ "kind": "value",
+ "name": "formatToParts",
+ "docstrings": [],
+ "signature": "let formatToParts: (t, float) => array"
+ },
+ {
+ "id": "Core.Intl.NumberFormat.formatRangeToParts",
+ "kind": "value",
+ "name": "formatRangeToParts",
+ "docstrings": [],
+ "signature": "let formatRangeToParts: (\n t,\n ~start: float,\n ~end: float,\n) => array"
+ },
+ {
+ "id": "Core.Intl.NumberFormat.formatInt",
+ "kind": "value",
+ "name": "formatInt",
+ "docstrings": [],
+ "signature": "let formatInt: (t, int) => string"
+ },
+ {
+ "id": "Core.Intl.NumberFormat.formatIntRange",
+ "kind": "value",
+ "name": "formatIntRange",
+ "docstrings": [],
+ "signature": "let formatIntRange: (t, ~start: int, ~end: int) => array"
+ },
+ {
+ "id": "Core.Intl.NumberFormat.formatIntToParts",
+ "kind": "value",
+ "name": "formatIntToParts",
+ "docstrings": [],
+ "signature": "let formatIntToParts: (t, int) => array"
+ },
+ {
+ "id": "Core.Intl.NumberFormat.formatIntRangeToParts",
+ "kind": "value",
+ "name": "formatIntRangeToParts",
+ "docstrings": [],
+ "signature": "let formatIntRangeToParts: (t, ~start: int, ~end: int) => array"
+ },
+ {
+ "id": "Core.Intl.NumberFormat.formatBigInt",
+ "kind": "value",
+ "name": "formatBigInt",
+ "docstrings": [],
+ "signature": "let formatBigInt: (t, bigint) => string"
+ },
+ {
+ "id": "Core.Intl.NumberFormat.formatBigIntRange",
+ "kind": "value",
+ "name": "formatBigIntRange",
+ "docstrings": [],
+ "signature": "let formatBigIntRange: (t, ~start: bigint, ~end: bigint) => array"
+ },
+ {
+ "id": "Core.Intl.NumberFormat.formatBigIntToParts",
+ "kind": "value",
+ "name": "formatBigIntToParts",
+ "docstrings": [],
+ "signature": "let formatBigIntToParts: (t, bigint) => array"
+ },
+ {
+ "id": "Core.Intl.NumberFormat.formatBigIntRangeToParts",
+ "kind": "value",
+ "name": "formatBigIntRangeToParts",
+ "docstrings": [],
+ "signature": "let formatBigIntRangeToParts: (t, ~start: bigint, ~end: bigint) => array"
+ },
+ {
+ "id": "Core.Intl.NumberFormat.formatString",
+ "kind": "value",
+ "name": "formatString",
+ "docstrings": [],
+ "signature": "let formatString: (t, string) => string"
+ },
+ {
+ "id": "Core.Intl.NumberFormat.formatStringToParts",
+ "kind": "value",
+ "name": "formatStringToParts",
+ "docstrings": [],
+ "signature": "let formatStringToParts: (t, string) => array"
+ }
+ ]
+ },
+ "core/intl/locale": {
+ "id": "Core.Intl.Locale",
+ "name": "Locale",
+ "docstrings": [],
+ "items": [
+ {
+ "id": "Core.Intl.Locale.t",
+ "kind": "type",
+ "name": "t",
+ "docstrings": [],
+ "signature": "type t"
+ },
+ {
+ "id": "Core.Intl.Locale.options",
+ "kind": "type",
+ "name": "options",
+ "docstrings": [],
+ "signature": "type options = {\n baseName?: string,\n calendar?: Core__Intl__Common.calendar,\n collation?: Core__Intl__Common.collation,\n hourCycle?: [#h11 | #h12 | #h23 | #h24],\n caseFirst?: [#\"false\" | #lower | #upper],\n numberingSystem?: Core__Intl__Common.numberingSystem,\n numeric?: bool,\n language?: string,\n script?: string,\n region?: string,\n}"
+ },
+ {
+ "id": "Core.Intl.Locale.make",
+ "kind": "value",
+ "name": "make",
+ "docstrings": [],
+ "signature": "let make: (string, ~options: options=?) => t"
+ },
+ {
+ "id": "Core.Intl.Locale.baseName",
+ "kind": "value",
+ "name": "baseName",
+ "docstrings": [],
+ "signature": "let baseName: t => string"
+ },
+ {
+ "id": "Core.Intl.Locale.calendar",
+ "kind": "value",
+ "name": "calendar",
+ "docstrings": [],
+ "signature": "let calendar: t => option"
+ },
+ {
+ "id": "Core.Intl.Locale.caseFirst",
+ "kind": "value",
+ "name": "caseFirst",
+ "docstrings": [],
+ "signature": "let caseFirst: t => option"
+ },
+ {
+ "id": "Core.Intl.Locale.collation",
+ "kind": "value",
+ "name": "collation",
+ "docstrings": [],
+ "signature": "let collation: t => option"
+ },
+ {
+ "id": "Core.Intl.Locale.hourCycle",
+ "kind": "value",
+ "name": "hourCycle",
+ "docstrings": [],
+ "signature": "let hourCycle: t => option"
+ },
+ {
+ "id": "Core.Intl.Locale.language",
+ "kind": "value",
+ "name": "language",
+ "docstrings": [],
+ "signature": "let language: t => string"
+ },
+ {
+ "id": "Core.Intl.Locale.numberingSystem",
+ "kind": "value",
+ "name": "numberingSystem",
+ "docstrings": [],
+ "signature": "let numberingSystem: t => option"
+ },
+ {
+ "id": "Core.Intl.Locale.numeric",
+ "kind": "value",
+ "name": "numeric",
+ "docstrings": [],
+ "signature": "let numeric: t => bool"
+ },
+ {
+ "id": "Core.Intl.Locale.region",
+ "kind": "value",
+ "name": "region",
+ "docstrings": [],
+ "signature": "let region: t => option"
+ },
+ {
+ "id": "Core.Intl.Locale.script",
+ "kind": "value",
+ "name": "script",
+ "docstrings": [],
+ "signature": "let script: t => option"
+ },
+ {
+ "id": "Core.Intl.Locale.maximize",
+ "kind": "value",
+ "name": "maximize",
+ "docstrings": [],
+ "signature": "let maximize: t => t"
+ },
+ {
+ "id": "Core.Intl.Locale.minimize",
+ "kind": "value",
+ "name": "minimize",
+ "docstrings": [],
+ "signature": "let minimize: t => t"
+ }
+ ]
+ },
+ "core/intl/listformat": {
+ "id": "Core.Intl.ListFormat",
+ "name": "ListFormat",
+ "docstrings": [],
+ "items": [
+ {
+ "id": "Core.Intl.ListFormat.t",
+ "kind": "type",
+ "name": "t",
+ "docstrings": [],
+ "signature": "type t"
+ },
+ {
+ "id": "Core.Intl.ListFormat.listType",
+ "kind": "type",
+ "name": "listType",
+ "docstrings": [],
+ "signature": "type listType = [#conjunction | #disjunction | #unit]"
+ },
+ {
+ "id": "Core.Intl.ListFormat.style",
+ "kind": "type",
+ "name": "style",
+ "docstrings": [],
+ "signature": "type style = [#long | #narrow | #short]"
+ },
+ {
+ "id": "Core.Intl.ListFormat.options",
+ "kind": "type",
+ "name": "options",
+ "docstrings": [],
+ "signature": "type options = {\n localeMatcher?: Core__Intl__Common.localeMatcher,\n \\\"type\"?: listType,\n style?: style,\n}"
+ },
+ {
+ "id": "Core.Intl.ListFormat.listPartComponentType",
+ "kind": "type",
+ "name": "listPartComponentType",
+ "docstrings": [],
+ "signature": "type listPartComponentType = [#element | #literal]"
+ },
+ {
+ "id": "Core.Intl.ListFormat.listPart",
+ "kind": "type",
+ "name": "listPart",
+ "docstrings": [],
+ "signature": "type listPart = {\n \\\"type\": listPartComponentType,\n value: string,\n}"
+ },
+ {
+ "id": "Core.Intl.ListFormat.resolvedOptions",
+ "kind": "type",
+ "name": "resolvedOptions",
+ "docstrings": [],
+ "signature": "type resolvedOptions = {\n locale: string,\n style: style,\n \\\"type\": listType,\n}"
+ },
+ {
+ "id": "Core.Intl.ListFormat.supportedLocalesOptions",
+ "kind": "type",
+ "name": "supportedLocalesOptions",
+ "docstrings": [],
+ "signature": "type supportedLocalesOptions = {\n localeMatcher: Core__Intl__Common.localeMatcher,\n}"
+ },
+ {
+ "id": "Core.Intl.ListFormat.make",
+ "kind": "value",
+ "name": "make",
+ "docstrings": [],
+ "signature": "let make: (~locales: array=?, ~options: options=?) => t"
+ },
+ {
+ "id": "Core.Intl.ListFormat.supportedLocalesOf",
+ "kind": "value",
+ "name": "supportedLocalesOf",
+ "docstrings": [],
+ "signature": "let supportedLocalesOf: (array, ~options: supportedLocalesOptions=?) => t"
+ },
+ {
+ "id": "Core.Intl.ListFormat.resolvedOptions",
+ "kind": "value",
+ "name": "resolvedOptions",
+ "docstrings": [],
+ "signature": "let resolvedOptions: t => resolvedOptions"
+ },
+ {
+ "id": "Core.Intl.ListFormat.format",
+ "kind": "value",
+ "name": "format",
+ "docstrings": [],
+ "signature": "let format: (t, array) => string"
+ },
+ {
+ "id": "Core.Intl.ListFormat.formatToParts",
+ "kind": "value",
+ "name": "formatToParts",
+ "docstrings": [],
+ "signature": "let formatToParts: (t, array) => array"
+ }
+ ]
+ },
+ "core/intl/datetimeformat": {
+ "id": "Core.Intl.DateTimeFormat",
+ "name": "DateTimeFormat",
+ "docstrings": [],
+ "items": [
+ {
+ "id": "Core.Intl.DateTimeFormat.t",
+ "kind": "type",
+ "name": "t",
+ "docstrings": [],
+ "signature": "type t"
+ },
+ {
+ "id": "Core.Intl.DateTimeFormat.dateStyle",
+ "kind": "type",
+ "name": "dateStyle",
+ "docstrings": [],
+ "signature": "type dateStyle = [#full | #long | #medium | #short]"
+ },
+ {
+ "id": "Core.Intl.DateTimeFormat.timeStyle",
+ "kind": "type",
+ "name": "timeStyle",
+ "docstrings": [],
+ "signature": "type timeStyle = [#full | #long | #medium | #short]"
+ },
+ {
+ "id": "Core.Intl.DateTimeFormat.dayPeriod",
+ "kind": "type",
+ "name": "dayPeriod",
+ "docstrings": [],
+ "signature": "type dayPeriod = [#long | #narrow | #short]"
+ },
+ {
+ "id": "Core.Intl.DateTimeFormat.weekday",
+ "kind": "type",
+ "name": "weekday",
+ "docstrings": [],
+ "signature": "type weekday = [#long | #narrow | #short]"
+ },
+ {
+ "id": "Core.Intl.DateTimeFormat.era",
+ "kind": "type",
+ "name": "era",
+ "docstrings": [],
+ "signature": "type era = [#long | #narrow | #short]"
+ },
+ {
+ "id": "Core.Intl.DateTimeFormat.year",
+ "kind": "type",
+ "name": "year",
+ "docstrings": [],
+ "signature": "type year = [#\"2-digit\" | #numeric]"
+ },
+ {
+ "id": "Core.Intl.DateTimeFormat.month",
+ "kind": "type",
+ "name": "month",
+ "docstrings": [],
+ "signature": "type month = [\n | #\"2-digit\"\n | #long\n | #narrow\n | #numeric\n | #short\n]"
+ },
+ {
+ "id": "Core.Intl.DateTimeFormat.day",
+ "kind": "type",
+ "name": "day",
+ "docstrings": [],
+ "signature": "type day = [#\"2-digit\" | #numeric]"
+ },
+ {
+ "id": "Core.Intl.DateTimeFormat.hour",
+ "kind": "type",
+ "name": "hour",
+ "docstrings": [],
+ "signature": "type hour = [#\"2-digit\" | #numeric]"
+ },
+ {
+ "id": "Core.Intl.DateTimeFormat.minute",
+ "kind": "type",
+ "name": "minute",
+ "docstrings": [],
+ "signature": "type minute = [#\"2-digit\" | #numeric]"
+ },
+ {
+ "id": "Core.Intl.DateTimeFormat.second",
+ "kind": "type",
+ "name": "second",
+ "docstrings": [],
+ "signature": "type second = [#\"2-digit\" | #numeric]"
+ },
+ {
+ "id": "Core.Intl.DateTimeFormat.timeZoneName",
+ "kind": "type",
+ "name": "timeZoneName",
+ "docstrings": [
+ "Firefox also supports IANA time zone names here\nNode v19+ supports \"shortOffset\", \"shortGeneric\", \"longOffset\", and \"longGeneric\"."
+ ],
+ "signature": "type timeZoneName = [\n | #long\n | #longGeneric\n | #longOffset\n | #short\n | #shortGeneric\n | #shortOffset\n]"
+ },
+ {
+ "id": "Core.Intl.DateTimeFormat.hourCycle",
+ "kind": "type",
+ "name": "hourCycle",
+ "docstrings": [],
+ "signature": "type hourCycle = [#h11 | #h12 | #h23 | #h24]"
+ },
+ {
+ "id": "Core.Intl.DateTimeFormat.formatMatcher",
+ "kind": "type",
+ "name": "formatMatcher",
+ "docstrings": [],
+ "signature": "type formatMatcher = [#basic | #\"best fit\"]"
+ },
+ {
+ "id": "Core.Intl.DateTimeFormat.fractionalSecondDigits",
+ "kind": "type",
+ "name": "fractionalSecondDigits",
+ "docstrings": [],
+ "signature": "type fractionalSecondDigits = [#0 | #1 | #2 | #3]"
+ },
+ {
+ "id": "Core.Intl.DateTimeFormat.options",
+ "kind": "type",
+ "name": "options",
+ "docstrings": [],
+ "signature": "type options = {\n dateStyle?: dateStyle,\n timeStyle?: timeStyle,\n calendar?: Core__Intl__Common.calendar,\n dayPeriod?: dayPeriod,\n numberingSystem?: Core__Intl__Common.numberingSystem,\n localeMatcher?: Core__Intl__Common.localeMatcher,\n timeZone?: string,\n hour12?: bool,\n hourCycle?: hourCycle,\n formatMatcher?: formatMatcher,\n weekday?: weekday,\n era?: era,\n year?: year,\n month?: month,\n day?: day,\n hour?: hour,\n minute?: minute,\n second?: second,\n fractionalSecondDigits?: fractionalSecondDigits,\n timeZoneName?: timeZoneName,\n}"
+ },
+ {
+ "id": "Core.Intl.DateTimeFormat.resolvedOptions",
+ "kind": "type",
+ "name": "resolvedOptions",
+ "docstrings": [],
+ "signature": "type resolvedOptions = {\n dateStyle?: dateStyle,\n timeStyle?: timeStyle,\n weekday?: weekday,\n era?: era,\n year?: year,\n month?: month,\n day?: day,\n hour?: hour,\n minute?: minute,\n second?: second,\n fractionalSecondDigits?: fractionalSecondDigits,\n timeZoneName?: timeZoneName,\n calendar: Core__Intl__Common.calendar,\n hour12: bool,\n hourCycle: hourCycle,\n locale: string,\n numberingSystem: Core__Intl__Common.numberingSystem,\n timeZone: string,\n}"
+ },
+ {
+ "id": "Core.Intl.DateTimeFormat.supportedLocalesOptions",
+ "kind": "type",
+ "name": "supportedLocalesOptions",
+ "docstrings": [],
+ "signature": "type supportedLocalesOptions = {\n localeMatcher: Core__Intl__Common.localeMatcher,\n}"
+ },
+ {
+ "id": "Core.Intl.DateTimeFormat.dateTimeComponent",
+ "kind": "type",
+ "name": "dateTimeComponent",
+ "docstrings": [],
+ "signature": "type dateTimeComponent = [\n | #day\n | #dayPeriod\n | #era\n | #fractionalSecond\n | #hour\n | #literal\n | #minute\n | #month\n | #relatedYear\n | #second\n | #timeZone\n | #weekday\n | #year\n | #yearName\n]"
+ },
+ {
+ "id": "Core.Intl.DateTimeFormat.dateTimePart",
+ "kind": "type",
+ "name": "dateTimePart",
+ "docstrings": [],
+ "signature": "type dateTimePart = {\n \\\"type\": dateTimeComponent,\n value: string,\n}"
+ },
+ {
+ "id": "Core.Intl.DateTimeFormat.dateTimeRangeSource",
+ "kind": "type",
+ "name": "dateTimeRangeSource",
+ "docstrings": [],
+ "signature": "type dateTimeRangeSource = [\n | #endRange\n | #shared\n | #startRange\n]"
+ },
+ {
+ "id": "Core.Intl.DateTimeFormat.dateTimeRangePart",
+ "kind": "type",
+ "name": "dateTimeRangePart",
+ "docstrings": [],
+ "signature": "type dateTimeRangePart = {\n \\\"type\": dateTimeComponent,\n value: string,\n source: dateTimeRangeSource,\n}"
+ },
+ {
+ "id": "Core.Intl.DateTimeFormat.make",
+ "kind": "value",
+ "name": "make",
+ "docstrings": [],
+ "signature": "let make: (~locales: array=?, ~options: options=?) => t"
+ },
+ {
+ "id": "Core.Intl.DateTimeFormat.supportedLocalesOf",
+ "kind": "value",
+ "name": "supportedLocalesOf",
+ "docstrings": [],
+ "signature": "let supportedLocalesOf: (array, ~options: supportedLocalesOptions=?) => t"
+ },
+ {
+ "id": "Core.Intl.DateTimeFormat.resolvedOptions",
+ "kind": "value",
+ "name": "resolvedOptions",
+ "docstrings": [],
+ "signature": "let resolvedOptions: t => resolvedOptions"
+ },
+ {
+ "id": "Core.Intl.DateTimeFormat.format",
+ "kind": "value",
+ "name": "format",
+ "docstrings": [],
+ "signature": "let format: (t, Core__Date.t) => string"
+ },
+ {
+ "id": "Core.Intl.DateTimeFormat.formatToParts",
+ "kind": "value",
+ "name": "formatToParts",
+ "docstrings": [],
+ "signature": "let formatToParts: (t, Core__Date.t) => array"
+ },
+ {
+ "id": "Core.Intl.DateTimeFormat.formatRange",
+ "kind": "value",
+ "name": "formatRange",
+ "docstrings": [],
+ "signature": "let formatRange: (\n t,\n ~startDate: Core__Date.t,\n ~endDate: Core__Date.t,\n) => string"
+ },
+ {
+ "id": "Core.Intl.DateTimeFormat.formatRangeToParts",
+ "kind": "value",
+ "name": "formatRangeToParts",
+ "docstrings": [],
+ "signature": "let formatRangeToParts: (\n t,\n ~startDate: Core__Date.t,\n ~endDate: Core__Date.t,\n) => array"
+ }
+ ]
+ },
+ "core/intl/collator": {
+ "id": "Core.Intl.Collator",
+ "name": "Collator",
+ "docstrings": [],
+ "items": [
+ {
+ "id": "Core.Intl.Collator.t",
+ "kind": "type",
+ "name": "t",
+ "docstrings": [],
+ "signature": "type t"
+ },
+ {
+ "id": "Core.Intl.Collator.usage",
+ "kind": "type",
+ "name": "usage",
+ "docstrings": [],
+ "signature": "type usage = [#search | #sort]"
+ },
+ {
+ "id": "Core.Intl.Collator.sensitivity",
+ "kind": "type",
+ "name": "sensitivity",
+ "docstrings": [],
+ "signature": "type sensitivity = [#accent | #base | #case | #variant]"
+ },
+ {
+ "id": "Core.Intl.Collator.caseFirst",
+ "kind": "type",
+ "name": "caseFirst",
+ "docstrings": [],
+ "signature": "type caseFirst = [#\"false\" | #lower | #upper]"
+ },
+ {
+ "id": "Core.Intl.Collator.options",
+ "kind": "type",
+ "name": "options",
+ "docstrings": [],
+ "signature": "type options = {\n localeMatcher?: Core__Intl__Common.localeMatcher,\n usage?: usage,\n sensitivity?: sensitivity,\n ignorePunctuation?: bool,\n numeric?: bool,\n caseFirst?: caseFirst,\n}"
+ },
+ {
+ "id": "Core.Intl.Collator.resolvedOptions",
+ "kind": "type",
+ "name": "resolvedOptions",
+ "docstrings": [],
+ "signature": "type resolvedOptions = {\n locale: string,\n usage: usage,\n sensitivity: sensitivity,\n ignorePunctuation: bool,\n collation: [\n | #compat\n | #default\n | #dict\n | #emoji\n | #eor\n | #phonebk\n | #phonetic\n | #pinyin\n | #stroke\n | #trad\n | #unihan\n | #zhuyin\n ],\n numeric?: bool,\n caseFirst?: caseFirst,\n}"
+ },
+ {
+ "id": "Core.Intl.Collator.supportedLocalesOptions",
+ "kind": "type",
+ "name": "supportedLocalesOptions",
+ "docstrings": [],
+ "signature": "type supportedLocalesOptions = {\n localeMatcher: Core__Intl__Common.localeMatcher,\n}"
+ },
+ {
+ "id": "Core.Intl.Collator.make",
+ "kind": "value",
+ "name": "make",
+ "docstrings": [],
+ "signature": "let make: (~locales: array=?, ~options: options=?) => t"
+ },
+ {
+ "id": "Core.Intl.Collator.supportedLocalesOf",
+ "kind": "value",
+ "name": "supportedLocalesOf",
+ "docstrings": [],
+ "signature": "let supportedLocalesOf: (array, ~options: supportedLocalesOptions=?) => t"
+ },
+ {
+ "id": "Core.Intl.Collator.resolvedOptions",
+ "kind": "value",
+ "name": "resolvedOptions",
+ "docstrings": [],
+ "signature": "let resolvedOptions: t => resolvedOptions"
+ },
+ {
+ "id": "Core.Intl.Collator.compare",
+ "kind": "value",
+ "name": "compare",
+ "docstrings": [],
+ "signature": "let compare: (t, string, string) => int"
+ }
+ ]
+ },
+ "core/intl/common": {
+ "id": "Core.Intl.Common",
+ "name": "Common",
+ "docstrings": [],
+ "items": [
+ {
+ "id": "Core.Intl.Common.localeMatcher",
+ "kind": "type",
+ "name": "localeMatcher",
+ "docstrings": [],
+ "signature": "type localeMatcher = [#\"best fit\" | #lookup]"
+ },
+ {
+ "id": "Core.Intl.Common.calendar",
+ "kind": "type",
+ "name": "calendar",
+ "docstrings": [],
+ "signature": "type calendar = [\n | #buddhist\n | #chinese\n | #coptic\n | #dangi\n | #ethioaa\n | #ethiopic\n | #gregory\n | #hebrew\n | #indian\n | #islamic\n | #\"islamic-civil\"\n | #\"islamic-rgsa\"\n | #\"islamic-tbla\"\n | #\"islamic-umalqura\"\n | #iso8601\n | #japanese\n | #persian\n | #roc\n]"
+ },
+ {
+ "id": "Core.Intl.Common.collation",
+ "kind": "type",
+ "name": "collation",
+ "docstrings": [],
+ "signature": "type collation = [\n | #compat\n | #dict\n | #emoji\n | #eor\n | #phonebk\n | #phonetic\n | #pinyin\n | #stroke\n | #trad\n | #unihan\n | #zhuyin\n]"
+ },
+ {
+ "id": "Core.Intl.Common.numberingSystem",
+ "kind": "type",
+ "name": "numberingSystem",
+ "docstrings": [],
+ "signature": "type numberingSystem = [\n | #adlm\n | #ahom\n | #arab\n | #arabext\n | #bali\n | #beng\n | #bhks\n | #brah\n | #cakm\n | #cham\n | #deva\n | #diak\n | #fullwide\n | #gong\n | #gonm\n | #gujr\n | #guru\n | #hanidec\n | #hmng\n | #hmnp\n | #java\n | #kali\n | #kawi\n | #khmr\n | #knda\n | #lana\n | #lanatham\n | #laoo\n | #latn\n | #lepc\n | #limb\n | #mathbold\n | #mathdbl\n | #mathmono\n | #mathsanb\n | #mathsans\n | #mlym\n | #modi\n | #mong\n | #mroo\n | #mtei\n | #mymr\n | #mymrshan\n | #mymrtlng\n | #nagm\n | #newa\n | #nkoo\n | #olck\n | #orya\n | #osma\n | #rohg\n | #saur\n | #segment\n | #shrd\n | #sind\n | #sinh\n | #sora\n | #sund\n | #takr\n | #talu\n | #tamldec\n | #telu\n | #thai\n | #tibt\n | #tirh\n | #tnsa\n | #vaii\n | #wara\n | #wcho\n]"
+ },
+ {
+ "id": "Core.Intl.Common.oneTo21",
+ "kind": "type",
+ "name": "oneTo21",
+ "docstrings": [],
+ "signature": "type oneTo21 = [\n | #1\n | #10\n | #11\n | #12\n | #13\n | #14\n | #15\n | #16\n | #17\n | #18\n | #19\n | #2\n | #20\n | #21\n | #3\n | #4\n | #5\n | #6\n | #7\n | #8\n | #9\n]"
+ },
+ {
+ "id": "Core.Intl.Common.zeroTo20",
+ "kind": "type",
+ "name": "zeroTo20",
+ "docstrings": [],
+ "signature": "type zeroTo20 = [\n | #0\n | #1\n | #10\n | #11\n | #12\n | #13\n | #14\n | #15\n | #16\n | #17\n | #18\n | #19\n | #2\n | #20\n | #3\n | #4\n | #5\n | #6\n | #7\n | #8\n | #9\n]"
+ }
+ ]
+ },
+ "core/biguint64array/constants": {
+ "id": "Core.BigUint64Array.Constants",
+ "name": "Constants",
+ "docstrings": [],
+ "items": [
+ {
+ "id": "Core.BigUint64Array.Constants.bytesPerElement",
+ "kind": "value",
+ "name": "bytesPerElement",
+ "docstrings": [
+ "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)"
+ ],
+ "signature": "let bytesPerElement: int"
+ }
+ ]
+ },
+ "core/bigint64array/constants": {
+ "id": "Core.BigInt64Array.Constants",
+ "name": "Constants",
+ "docstrings": [],
+ "items": [
+ {
+ "id": "Core.BigInt64Array.Constants.bytesPerElement",
+ "kind": "value",
+ "name": "bytesPerElement",
+ "docstrings": [
+ "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)"
+ ],
+ "signature": "let bytesPerElement: int"
+ }
+ ]
+ },
+ "core/uint8clampedarray/constants": {
+ "id": "Core.Uint8ClampedArray.Constants",
+ "name": "Constants",
+ "docstrings": [],
+ "items": [
+ {
+ "id": "Core.Uint8ClampedArray.Constants.bytesPerElement",
+ "kind": "value",
+ "name": "bytesPerElement",
+ "docstrings": [
+ "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)"
+ ],
+ "signature": "let bytesPerElement: int"
+ }
+ ]
+ },
+ "core/uint32array/constants": {
+ "id": "Core.Uint32Array.Constants",
+ "name": "Constants",
+ "docstrings": [],
+ "items": [
+ {
+ "id": "Core.Uint32Array.Constants.bytesPerElement",
+ "kind": "value",
+ "name": "bytesPerElement",
+ "docstrings": [
+ "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)"
+ ],
+ "signature": "let bytesPerElement: int"
+ }
+ ]
+ },
+ "core/uint16array/constants": {
+ "id": "Core.Uint16Array.Constants",
+ "name": "Constants",
+ "docstrings": [],
+ "items": [
+ {
+ "id": "Core.Uint16Array.Constants.bytesPerElement",
+ "kind": "value",
+ "name": "bytesPerElement",
+ "docstrings": [
+ "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)"
+ ],
+ "signature": "let bytesPerElement: int"
+ }
+ ]
+ },
+ "core/uint8array/constants": {
+ "id": "Core.Uint8Array.Constants",
+ "name": "Constants",
+ "docstrings": [],
+ "items": [
+ {
+ "id": "Core.Uint8Array.Constants.bytesPerElement",
+ "kind": "value",
+ "name": "bytesPerElement",
+ "docstrings": [
+ "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)"
+ ],
+ "signature": "let bytesPerElement: int"
+ }
+ ]
+ },
+ "core/int32array/constants": {
+ "id": "Core.Int32Array.Constants",
+ "name": "Constants",
+ "docstrings": [],
+ "items": [
+ {
+ "id": "Core.Int32Array.Constants.bytesPerElement",
+ "kind": "value",
+ "name": "bytesPerElement",
+ "docstrings": [
+ "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)"
+ ],
+ "signature": "let bytesPerElement: int"
+ }
+ ]
+ },
+ "core/int16array/constants": {
+ "id": "Core.Int16Array.Constants",
+ "name": "Constants",
+ "docstrings": [],
+ "items": [
+ {
+ "id": "Core.Int16Array.Constants.bytesPerElement",
+ "kind": "value",
+ "name": "bytesPerElement",
+ "docstrings": [
+ "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)"
+ ],
+ "signature": "let bytesPerElement: int"
+ }
+ ]
+ },
+ "core/int8array/constants": {
+ "id": "Core.Int8Array.Constants",
+ "name": "Constants",
+ "docstrings": [],
+ "items": [
+ {
+ "id": "Core.Int8Array.Constants.bytesPerElement",
+ "kind": "value",
+ "name": "bytesPerElement",
+ "docstrings": [
+ "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)"
+ ],
+ "signature": "let bytesPerElement: int"
+ }
+ ]
+ },
+ "core/float64array/constants": {
+ "id": "Core.Float64Array.Constants",
+ "name": "Constants",
+ "docstrings": [],
+ "items": [
+ {
+ "id": "Core.Float64Array.Constants.bytesPerElement",
+ "kind": "value",
+ "name": "bytesPerElement",
+ "docstrings": [
+ "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)"
+ ],
+ "signature": "let bytesPerElement: int"
+ }
+ ]
+ },
+ "core/float32array/constants": {
+ "id": "Core.Float32Array.Constants",
+ "name": "Constants",
+ "docstrings": [],
+ "items": [
+ {
+ "id": "Core.Float32Array.Constants.bytesPerElement",
+ "kind": "value",
+ "name": "bytesPerElement",
+ "docstrings": [
+ "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)"
+ ],
+ "signature": "let bytesPerElement: int"
+ }
+ ]
+ },
+ "core/json/decode": {
+ "id": "Core.JSON.Decode",
+ "name": "Decode",
+ "docstrings": [],
+ "items": [
+ {
+ "id": "Core.JSON.Decode.bool",
+ "kind": "value",
+ "name": "bool",
+ "docstrings": [
+ "Decodes a single JSON value. If the value is a bool, it will return `Some(bool)` - otherwise it will return `None`.\n\n ## Examples\n ```rescript\n JSON.parseExn(`true`)->JSON.Decode.bool\n // Some(true)\n\n JSON.parseExn(`\"hello world\"`)->JSON.Decode.bool\n // None\n ```"
+ ],
+ "signature": "let bool: t => option"
+ },
+ {
+ "id": "Core.JSON.Decode.null",
+ "kind": "value",
+ "name": "null",
+ "docstrings": [
+ "Decodes a single JSON value. If the value is null, it will return `Some(Null.t)` - otherwise it will return `None`.\n\n ## Examples\n ```rescript\n JSON.parseExn(`null`)->JSON.Decode.null\n // Some(null)\n\n JSON.parseExn(`\"hello world\"`)->JSON.Decode.null\n // None\n ```"
+ ],
+ "signature": "let null: t => option>"
+ },
+ {
+ "id": "Core.JSON.Decode.string",
+ "kind": "value",
+ "name": "string",
+ "docstrings": [
+ "Decodes a single JSON value. If the value is a string, it will return `Some(string)` - otherwise it will return `None`.\n\n ## Examples\n ```rescript\n JSON.parseExn(`\"hello world\"`)->JSON.Decode.string\n // Some(\"hello world\")\n\n JSON.parseExn(`42`)->JSON.Decode.string\n // None \n ```"
+ ],
+ "signature": "let string: t => option"
+ },
+ {
+ "id": "Core.JSON.Decode.float",
+ "kind": "value",
+ "name": "float",
+ "docstrings": [
+ "Decodes a single JSON value. If the value is a float, it will return `Some(float)` - otherwise it will return `None`.\n\n ## Examples\n ```rescript\n JSON.parseExn(`42.0`)->JSON.Decode.float\n // Some(42.0)\n\n JSON.parseExn(`\"hello world\"`)->JSON.Decode.float\n // None\n ```"
+ ],
+ "signature": "let float: t => option"
+ },
+ {
+ "id": "Core.JSON.Decode.object",
+ "kind": "value",
+ "name": "object",
+ "docstrings": [
+ "Decodes a single JSON value. If the value is an object, it will return `Some(Dict.t)` - otherwise it will return `None`.\n\n ## Examples\n ```rescript\n JSON.parseExn(`{\"foo\":\"bar\"}`)->JSON.Decode.object\n // Some({ foo: 'bar' })\n\n JSON.parseExn(`\"hello world\"`)->JSON.Decode.object\n // None\n ```"
+ ],
+ "signature": "let object: t => option>"
+ },
+ {
+ "id": "Core.JSON.Decode.array",
+ "kind": "value",
+ "name": "array",
+ "docstrings": [
+ "Decodes a single JSON value. If the value is an array, it will return `Some(array)` - otherwise it will return `None`.\n\n ## Examples\n ```rescript\n JSON.parseExn(`[\"foo\", \"bar\"]`)->JSON.Decode.array\n // Some([ 'foo', 'bar' ])\n\n JSON.parseExn(`\"hello world\"`)->JSON.Decode.array\n // None\n ```"
+ ],
+ "signature": "let array: t => option>"
+ }
+ ]
+ },
+ "core/json/encode": {
+ "id": "Core.JSON.Encode",
+ "name": "Encode",
+ "docstrings": [],
+ "items": [
+ {
+ "id": "Core.JSON.Encode.bool",
+ "kind": "value",
+ "name": "bool",
+ "docstrings": [
+ "Returns a boolean as a JSON object.\n\n ## Examples\n ```rescript\n JSON.Encode.bool(true)\n ```"
+ ],
+ "signature": "let bool: bool => t"
+ },
+ {
+ "id": "Core.JSON.Encode.null",
+ "kind": "value",
+ "name": "null",
+ "docstrings": [
+ "Returns null as a JSON object.\n\n ## Examples\n ```rescript\n JSON.Encode.null\n ```"
+ ],
+ "signature": "let null: t"
+ },
+ {
+ "id": "Core.JSON.Encode.string",
+ "kind": "value",
+ "name": "string",
+ "docstrings": [
+ "Returns a string as a JSON object.\n\n ## Examples\n ```rescript\n JSON.Encode.string(\"hello world\")\n ```"
+ ],
+ "signature": "let string: string => t"
+ },
+ {
+ "id": "Core.JSON.Encode.int",
+ "kind": "value",
+ "name": "int",
+ "docstrings": [
+ "Returns an int as a JSON object.\n\n ## Examples\n ```rescript\n JSON.Encode.int(42)\n ```"
+ ],
+ "signature": "let int: int => t"
+ },
+ {
+ "id": "Core.JSON.Encode.float",
+ "kind": "value",
+ "name": "float",
+ "docstrings": [
+ "Returns a float as a JSON object.\n\n ## Examples\n ```rescript\n JSON.Encode.float(42.0)\n ```"
+ ],
+ "signature": "let float: float => t"
+ },
+ {
+ "id": "Core.JSON.Encode.object",
+ "kind": "value",
+ "name": "object",
+ "docstrings": [
+ "Returns a dict as a JSON object.\n\n ## Examples\n ```rescript\n let dict = Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n ])\n\n JSON.Encode.object(dict)\n ```"
+ ],
+ "signature": "let object: Core__Dict.t => t"
+ },
+ {
+ "id": "Core.JSON.Encode.array",
+ "kind": "value",
+ "name": "array",
+ "docstrings": [
+ "Returns an array as a JSON object.\n\n ## Examples\n ```rescript\n let array = [JSON.Encode.string(\"hello world\"), JSON.Encode.int(42)]\n\n JSON.Encode.array(array)\n ```"
+ ],
+ "signature": "let array: array => t"
+ }
+ ]
+ },
+ "core/json/classify": {
+ "id": "Core.JSON.Classify",
+ "name": "Classify",
+ "docstrings": [],
+ "items": [
+ {
+ "id": "Core.JSON.Classify.t",
+ "kind": "type",
+ "name": "t",
+ "docstrings": ["A type representing a JavaScript type."],
+ "signature": "type t =\n | Bool(bool)\n | Null\n | String(string)\n | Number(float)\n | Object(Core__Dict.t)\n | Array(array)"
+ },
+ {
+ "id": "Core.JSON.Classify.classify",
+ "kind": "value",
+ "name": "classify",
+ "docstrings": [
+ "Returns the JSON type of any value.\n\n ## Examples\n ```rescript\n JSON.Classify.classify(\"hello world\")\n // String(\"hello world\")\n\n JSON.Classify.classify(42)\n // Number(42)\n ```"
+ ],
+ "signature": "let classify: 'a => t"
+ }
+ ]
+ },
+ "core/type/classify": {
+ "id": "Core.Type.Classify",
+ "name": "Classify",
+ "docstrings": [],
+ "items": [
+ {
+ "id": "Core.Type.Classify.function",
+ "kind": "type",
+ "name": "function",
+ "docstrings": [
+ "An abstract type representing a JavaScript function.\n\n See [`function`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function) on MDN."
+ ],
+ "signature": "type function"
+ },
+ {
+ "id": "Core.Type.Classify.object",
+ "kind": "type",
+ "name": "object",
+ "docstrings": [
+ "An abstract type representing a JavaScript object.\n\n See [`object`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object) on MDN."
+ ],
+ "signature": "type object"
+ },
+ {
+ "id": "Core.Type.Classify.t",
+ "kind": "type",
+ "name": "t",
+ "docstrings": ["The type representing a classified JavaScript value."],
+ "signature": "type t =\n | Bool(bool)\n | Null\n | Undefined\n | String(string)\n | Number(float)\n | Object(object)\n | Function(function)\n | Symbol(Core__Symbol.t)\n | BigInt(bigint)"
+ },
+ {
+ "id": "Core.Type.Classify.classify",
+ "kind": "value",
+ "name": "classify",
+ "docstrings": [
+ "`classify(anyValue)`\nClassifies a JavaScript value.\n\n## Examples\n```rescript\nswitch %raw(`null`)->Type.Classify.classify {\n| Null => Console.log(\"Yup, that's null.\")\n| _ => Console.log(\"This doesn't actually appear to be null...\")\n}\n```"
+ ],
+ "signature": "let classify: 'a => t"
+ }
+ ]
+ },
+ "core/regexp/result": {
+ "id": "Core.RegExp.Result",
+ "name": "Result",
+ "docstrings": [],
+ "items": [
+ {
+ "id": "Core.RegExp.Result.t",
+ "kind": "type",
+ "name": "t",
+ "docstrings": ["Type representing the result of a `RegExp` execution."],
+ "signature": "type t = array