diff --git a/.gitattributes b/.gitattributes
index 291b72280..b17d448d5 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -1,2 +1,4 @@
*.res linguist-language=ReScript
*.resi linguist-language=ReScript
+
+/public/playground-bundles/** binary linguist-vendored
diff --git a/.gitignore b/.gitignore
index 4b6ddf80c..79ff8c108 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
@@ -26,4 +27,13 @@ lib/
.vercel
src/**/*.mjs
-scripts/**/*.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/.nowignore b/.nowignore
deleted file mode 100644
index 5b3ad333e..000000000
--- a/.nowignore
+++ /dev/null
@@ -1,2 +0,0 @@
-.next/
-node_modules/
diff --git a/README.md b/README.md
index 48b2e84bd..90d521539 100644
--- a/README.md
+++ b/README.md
@@ -1,8 +1,5 @@
-[](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.
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..19ccbb487
--- /dev/null
+++ b/_blogposts/2025-03-05-what-can-i-do-with-rescript.mdx
@@ -0,0 +1,143 @@
+---
+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!
\ No newline at end of file
diff --git a/_blogposts/2025-03-17-retreats.mdx b/_blogposts/2025-03-17-retreats.mdx
new file mode 100644
index 000000000..2fe26ad9e
--- /dev/null
+++ b/_blogposts/2025-03-17-retreats.mdx
@@ -0,0 +1,99 @@
+---
+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..312cc0f88
--- /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/2020-03-26-generalize-uncurry.mdx b/_blogposts/archive/2020-03-26-generalize-uncurry.mdx
index ba1b49ed5..ff35f0321 100644
--- a/_blogposts/archive/2020-03-26-generalize-uncurry.mdx
+++ b/_blogposts/archive/2020-03-26-generalize-uncurry.mdx
@@ -53,19 +53,19 @@ 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
diff --git a/data/api/v12.0.0/belt.json b/data/api/v12.0.0/belt.json
index 86bc0c43e..ba0eb1e34 100644
--- a/data/api/v12.0.0/belt.json
+++ b/data/api/v12.0.0/belt.json
@@ -3,7 +3,7 @@
"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."
+ "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 `rescript.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## 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": []
},
@@ -91,7 +91,8 @@
"kind": "value",
"name": "forEachU",
"docstrings": [],
- "signature": "let forEachU: (t<'b>, (key, 'b) => unit) => unit"
+ "signature": "let forEachU: (t<'b>, (key, 'b) => unit) => unit",
+ "deprecated": "Use `forEach` instead"
},
{
"id": "Belt.HashMap.String.forEach",
@@ -105,7 +106,8 @@
"kind": "value",
"name": "reduceU",
"docstrings": [],
- "signature": "let reduceU: (t<'b>, 'c, ('c, key, 'b) => 'c) => 'c"
+ "signature": "let reduceU: (t<'b>, 'c, ('c, key, 'b) => 'c) => 'c",
+ "deprecated": "Use `reduce` instead"
},
{
"id": "Belt.HashMap.String.reduce",
@@ -119,7 +121,8 @@
"kind": "value",
"name": "keepMapInPlaceU",
"docstrings": [],
- "signature": "let keepMapInPlaceU: (t<'a>, (key, 'a) => option<'a>) => unit"
+ "signature": "let keepMapInPlaceU: (t<'a>, (key, 'a) => option<'a>) => unit",
+ "deprecated": "Use `keepMapInPlace` instead"
},
{
"id": "Belt.HashMap.String.keepMapInPlace",
@@ -270,7 +273,8 @@
"kind": "value",
"name": "forEachU",
"docstrings": [],
- "signature": "let forEachU: (t<'b>, (key, 'b) => unit) => unit"
+ "signature": "let forEachU: (t<'b>, (key, 'b) => unit) => unit",
+ "deprecated": "Use `forEach` instead"
},
{
"id": "Belt.HashMap.Int.forEach",
@@ -284,7 +288,8 @@
"kind": "value",
"name": "reduceU",
"docstrings": [],
- "signature": "let reduceU: (t<'b>, 'c, ('c, key, 'b) => 'c) => 'c"
+ "signature": "let reduceU: (t<'b>, 'c, ('c, key, 'b) => 'c) => 'c",
+ "deprecated": "Use `reduce` instead"
},
{
"id": "Belt.HashMap.Int.reduce",
@@ -298,7 +303,8 @@
"kind": "value",
"name": "keepMapInPlaceU",
"docstrings": [],
- "signature": "let keepMapInPlaceU: (t<'a>, (key, 'a) => option<'a>) => unit"
+ "signature": "let keepMapInPlaceU: (t<'a>, (key, 'a) => option<'a>) => unit",
+ "deprecated": "Use `keepMapInPlace` instead"
},
{
"id": "Belt.HashMap.Int.keepMapInPlace",
@@ -441,7 +447,8 @@
"kind": "value",
"name": "forEachU",
"docstrings": [],
- "signature": "let forEachU: (t, key => unit) => unit"
+ "signature": "let forEachU: (t, key => unit) => unit",
+ "deprecated": "Use `forEach` instead"
},
{
"id": "Belt.HashSet.String.forEach",
@@ -455,7 +462,8 @@
"kind": "value",
"name": "reduceU",
"docstrings": [],
- "signature": "let reduceU: (t, 'c, ('c, key) => 'c) => 'c"
+ "signature": "let reduceU: (t, 'c, ('c, key) => 'c) => 'c",
+ "deprecated": "Use `reduce` instead"
},
{
"id": "Belt.HashSet.String.reduce",
@@ -584,7 +592,8 @@
"kind": "value",
"name": "forEachU",
"docstrings": [],
- "signature": "let forEachU: (t, key => unit) => unit"
+ "signature": "let forEachU: (t, key => unit) => unit",
+ "deprecated": "Use `forEach` instead"
},
{
"id": "Belt.HashSet.Int.forEach",
@@ -598,7 +607,8 @@
"kind": "value",
"name": "reduceU",
"docstrings": [],
- "signature": "let reduceU: (t, 'c, ('c, key) => 'c) => 'c"
+ "signature": "let reduceU: (t, 'c, ('c, key) => 'c) => 'c",
+ "deprecated": "Use `reduce` instead"
},
{
"id": "Belt.HashSet.Int.reduce",
@@ -703,7 +713,8 @@
"kind": "value",
"name": "cmpU",
"docstrings": [],
- "signature": "let cmpU: (t<'a>, t<'a>, ('a, 'a) => int) => int"
+ "signature": "let cmpU: (t<'a>, t<'a>, ('a, 'a) => int) => int",
+ "deprecated": "Use `cmp` instead"
},
{
"id": "Belt.MutableMap.String.cmp",
@@ -719,7 +730,8 @@
"kind": "value",
"name": "eqU",
"docstrings": [],
- "signature": "let eqU: (t<'a>, t<'a>, ('a, 'a) => bool) => bool"
+ "signature": "let eqU: (t<'a>, t<'a>, ('a, 'a) => bool) => bool",
+ "deprecated": "Use `eq` instead"
},
{
"id": "Belt.MutableMap.String.eq",
@@ -735,7 +747,8 @@
"kind": "value",
"name": "forEachU",
"docstrings": [],
- "signature": "let forEachU: (t<'a>, (key, 'a) => unit) => unit"
+ "signature": "let forEachU: (t<'a>, (key, 'a) => unit) => unit",
+ "deprecated": "Use `forEach` instead"
},
{
"id": "Belt.MutableMap.String.forEach",
@@ -751,7 +764,8 @@
"kind": "value",
"name": "reduceU",
"docstrings": [],
- "signature": "let reduceU: (t<'a>, 'b, ('b, key, 'a) => 'b) => 'b"
+ "signature": "let reduceU: (t<'a>, 'b, ('b, key, 'a) => 'b) => 'b",
+ "deprecated": "Use `reduce` instead"
},
{
"id": "Belt.MutableMap.String.reduce",
@@ -767,7 +781,8 @@
"kind": "value",
"name": "everyU",
"docstrings": [],
- "signature": "let everyU: (t<'a>, (key, 'a) => bool) => bool"
+ "signature": "let everyU: (t<'a>, (key, 'a) => bool) => bool",
+ "deprecated": "Use `every` instead"
},
{
"id": "Belt.MutableMap.String.every",
@@ -783,7 +798,8 @@
"kind": "value",
"name": "someU",
"docstrings": [],
- "signature": "let someU: (t<'a>, (key, 'a) => bool) => bool"
+ "signature": "let someU: (t<'a>, (key, 'a) => bool) => bool",
+ "deprecated": "Use `some` instead"
},
{
"id": "Belt.MutableMap.String.some",
@@ -963,7 +979,8 @@
"kind": "value",
"name": "updateU",
"docstrings": [],
- "signature": "let updateU: (t<'a>, key, option<'a> => option<'a>) => unit"
+ "signature": "let updateU: (t<'a>, key, option<'a> => option<'a>) => unit",
+ "deprecated": "Use `update` instead"
},
{
"id": "Belt.MutableMap.String.update",
@@ -977,7 +994,8 @@
"kind": "value",
"name": "mapU",
"docstrings": [],
- "signature": "let mapU: (t<'a>, 'a => 'b) => t<'b>"
+ "signature": "let mapU: (t<'a>, 'a => 'b) => t<'b>",
+ "deprecated": "Use `map` instead"
},
{
"id": "Belt.MutableMap.String.map",
@@ -993,7 +1011,8 @@
"kind": "value",
"name": "mapWithKeyU",
"docstrings": [],
- "signature": "let mapWithKeyU: (t<'a>, (key, 'a) => 'b) => t<'b>"
+ "signature": "let mapWithKeyU: (t<'a>, (key, 'a) => 'b) => t<'b>",
+ "deprecated": "Use `mapWithKey` instead"
},
{
"id": "Belt.MutableMap.String.mapWithKey",
@@ -1056,7 +1075,8 @@
"kind": "value",
"name": "cmpU",
"docstrings": [],
- "signature": "let cmpU: (t<'a>, t<'a>, ('a, 'a) => int) => int"
+ "signature": "let cmpU: (t<'a>, t<'a>, ('a, 'a) => int) => int",
+ "deprecated": "Use `cmp` instead"
},
{
"id": "Belt.MutableMap.Int.cmp",
@@ -1072,7 +1092,8 @@
"kind": "value",
"name": "eqU",
"docstrings": [],
- "signature": "let eqU: (t<'a>, t<'a>, ('a, 'a) => bool) => bool"
+ "signature": "let eqU: (t<'a>, t<'a>, ('a, 'a) => bool) => bool",
+ "deprecated": "Use `eq` instead"
},
{
"id": "Belt.MutableMap.Int.eq",
@@ -1088,7 +1109,8 @@
"kind": "value",
"name": "forEachU",
"docstrings": [],
- "signature": "let forEachU: (t<'a>, (key, 'a) => unit) => unit"
+ "signature": "let forEachU: (t<'a>, (key, 'a) => unit) => unit",
+ "deprecated": "Use `forEach` instead"
},
{
"id": "Belt.MutableMap.Int.forEach",
@@ -1104,7 +1126,8 @@
"kind": "value",
"name": "reduceU",
"docstrings": [],
- "signature": "let reduceU: (t<'a>, 'b, ('b, key, 'a) => 'b) => 'b"
+ "signature": "let reduceU: (t<'a>, 'b, ('b, key, 'a) => 'b) => 'b",
+ "deprecated": "Use `reduce` instead"
},
{
"id": "Belt.MutableMap.Int.reduce",
@@ -1120,7 +1143,8 @@
"kind": "value",
"name": "everyU",
"docstrings": [],
- "signature": "let everyU: (t<'a>, (key, 'a) => bool) => bool"
+ "signature": "let everyU: (t<'a>, (key, 'a) => bool) => bool",
+ "deprecated": "Use `every` instead"
},
{
"id": "Belt.MutableMap.Int.every",
@@ -1136,7 +1160,8 @@
"kind": "value",
"name": "someU",
"docstrings": [],
- "signature": "let someU: (t<'a>, (key, 'a) => bool) => bool"
+ "signature": "let someU: (t<'a>, (key, 'a) => bool) => bool",
+ "deprecated": "Use `some` instead"
},
{
"id": "Belt.MutableMap.Int.some",
@@ -1316,7 +1341,8 @@
"kind": "value",
"name": "updateU",
"docstrings": [],
- "signature": "let updateU: (t<'a>, key, option<'a> => option<'a>) => unit"
+ "signature": "let updateU: (t<'a>, key, option<'a> => option<'a>) => unit",
+ "deprecated": "Use `update` instead"
},
{
"id": "Belt.MutableMap.Int.update",
@@ -1330,7 +1356,8 @@
"kind": "value",
"name": "mapU",
"docstrings": [],
- "signature": "let mapU: (t<'a>, 'a => 'b) => t<'b>"
+ "signature": "let mapU: (t<'a>, 'a => 'b) => t<'b>",
+ "deprecated": "Use `map` instead"
},
{
"id": "Belt.MutableMap.Int.map",
@@ -1346,7 +1373,8 @@
"kind": "value",
"name": "mapWithKeyU",
"docstrings": [],
- "signature": "let mapWithKeyU: (t<'a>, (key, 'a) => 'b) => t<'b>"
+ "signature": "let mapWithKeyU: (t<'a>, (key, 'a) => 'b) => t<'b>",
+ "deprecated": "Use `mapWithKey` instead"
},
{
"id": "Belt.MutableMap.Int.mapWithKey",
@@ -1514,7 +1542,8 @@
"kind": "value",
"name": "forEachU",
"docstrings": [],
- "signature": "let forEachU: (t, value => unit) => unit"
+ "signature": "let forEachU: (t, value => unit) => unit",
+ "deprecated": "Use `forEach` instead"
},
{
"id": "Belt.MutableSet.String.forEach",
@@ -1530,7 +1559,8 @@
"kind": "value",
"name": "reduceU",
"docstrings": [],
- "signature": "let reduceU: (t, 'a, ('a, value) => 'a) => 'a"
+ "signature": "let reduceU: (t, 'a, ('a, value) => 'a) => 'a",
+ "deprecated": "Use `reduce` instead"
},
{
"id": "Belt.MutableSet.String.reduce",
@@ -1546,7 +1576,8 @@
"kind": "value",
"name": "everyU",
"docstrings": [],
- "signature": "let everyU: (t, value => bool) => bool"
+ "signature": "let everyU: (t, value => bool) => bool",
+ "deprecated": "Use `every` instead"
},
{
"id": "Belt.MutableSet.String.every",
@@ -1562,7 +1593,8 @@
"kind": "value",
"name": "someU",
"docstrings": [],
- "signature": "let someU: (t, value => bool) => bool"
+ "signature": "let someU: (t, value => bool) => bool",
+ "deprecated": "Use `some` instead"
},
{
"id": "Belt.MutableSet.String.some",
@@ -1578,7 +1610,8 @@
"kind": "value",
"name": "keepU",
"docstrings": [],
- "signature": "let keepU: (t, value => bool) => t"
+ "signature": "let keepU: (t, value => bool) => t",
+ "deprecated": "Use `keep` instead"
},
{
"id": "Belt.MutableSet.String.keep",
@@ -1594,7 +1627,8 @@
"kind": "value",
"name": "partitionU",
"docstrings": [],
- "signature": "let partitionU: (t, value => bool) => (t, t)"
+ "signature": "let partitionU: (t, value => bool) => (t, t)",
+ "deprecated": "Use `partition` instead"
},
{
"id": "Belt.MutableSet.String.partition",
@@ -1856,7 +1890,8 @@
"kind": "value",
"name": "forEachU",
"docstrings": [],
- "signature": "let forEachU: (t, value => unit) => unit"
+ "signature": "let forEachU: (t, value => unit) => unit",
+ "deprecated": "Use `forEach` instead"
},
{
"id": "Belt.MutableSet.Int.forEach",
@@ -1872,7 +1907,8 @@
"kind": "value",
"name": "reduceU",
"docstrings": [],
- "signature": "let reduceU: (t, 'a, ('a, value) => 'a) => 'a"
+ "signature": "let reduceU: (t, 'a, ('a, value) => 'a) => 'a",
+ "deprecated": "Use `reduce` instead"
},
{
"id": "Belt.MutableSet.Int.reduce",
@@ -1888,7 +1924,8 @@
"kind": "value",
"name": "everyU",
"docstrings": [],
- "signature": "let everyU: (t, value => bool) => bool"
+ "signature": "let everyU: (t, value => bool) => bool",
+ "deprecated": "Use `every` instead"
},
{
"id": "Belt.MutableSet.Int.every",
@@ -1904,7 +1941,8 @@
"kind": "value",
"name": "someU",
"docstrings": [],
- "signature": "let someU: (t, value => bool) => bool"
+ "signature": "let someU: (t, value => bool) => bool",
+ "deprecated": "Use `some` instead"
},
{
"id": "Belt.MutableSet.Int.some",
@@ -1920,7 +1958,8 @@
"kind": "value",
"name": "keepU",
"docstrings": [],
- "signature": "let keepU: (t, value => bool) => t"
+ "signature": "let keepU: (t, value => bool) => t",
+ "deprecated": "Use `keep` instead"
},
{
"id": "Belt.MutableSet.Int.keep",
@@ -1936,7 +1975,8 @@
"kind": "value",
"name": "partitionU",
"docstrings": [],
- "signature": "let partitionU: (t, value => bool) => (t, t)"
+ "signature": "let partitionU: (t, value => bool) => (t, t)",
+ "deprecated": "Use `partition` instead"
},
{
"id": "Belt.MutableSet.Int.partition",
@@ -2088,7 +2128,8 @@
"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"
+ "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",
+ "deprecated": "Use `cmp` instead"
},
{
"id": "Belt.Map.Dict.cmp",
@@ -2102,7 +2143,8 @@
"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"
+ "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",
+ "deprecated": "Use `eq` instead"
},
{
"id": "Belt.Map.Dict.eq",
@@ -2118,14 +2160,15 @@
"kind": "value",
"name": "findFirstByU",
"docstrings": [],
- "signature": "let findFirstByU: (t<'k, 'v, 'id>, ('k, 'v) => bool) => option<('k, 'v)>"
+ "signature": "let findFirstByU: (t<'k, 'v, 'id>, ('k, 'v) => bool) => option<('k, 'v)>",
+ "deprecated": "Use `findFirstBy` instead"
},
{
"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```"
+ "`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\nassertEqual(Belt.Map.Dict.findFirstBy(s0, (k, _) => k == 4), Some((4, \"4\")))\n```"
],
"signature": "let findFirstBy: (t<'k, 'v, 'id>, ('k, 'v) => bool) => option<('k, 'v)>"
},
@@ -2134,7 +2177,8 @@
"kind": "value",
"name": "forEachU",
"docstrings": [],
- "signature": "let forEachU: (t<'k, 'a, 'id>, ('k, 'a) => unit) => unit"
+ "signature": "let forEachU: (t<'k, 'a, 'id>, ('k, 'a) => unit) => unit",
+ "deprecated": "Use `forEach` instead"
},
{
"id": "Belt.Map.Dict.forEach",
@@ -2150,7 +2194,8 @@
"kind": "value",
"name": "reduceU",
"docstrings": [],
- "signature": "let reduceU: (t<'k, 'a, 'id>, 'b, ('b, 'k, 'a) => 'b) => 'b"
+ "signature": "let reduceU: (t<'k, 'a, 'id>, 'b, ('b, 'k, 'a) => 'b) => 'b",
+ "deprecated": "Use `reduce` instead"
},
{
"id": "Belt.Map.Dict.reduce",
@@ -2166,7 +2211,8 @@
"kind": "value",
"name": "everyU",
"docstrings": [],
- "signature": "let everyU: (t<'k, 'a, 'id>, ('k, 'a) => bool) => bool"
+ "signature": "let everyU: (t<'k, 'a, 'id>, ('k, 'a) => bool) => bool",
+ "deprecated": "Use `every` instead"
},
{
"id": "Belt.Map.Dict.every",
@@ -2182,7 +2228,8 @@
"kind": "value",
"name": "someU",
"docstrings": [],
- "signature": "let someU: (t<'k, 'a, 'id>, ('k, 'a) => bool) => bool"
+ "signature": "let someU: (t<'k, 'a, 'id>, ('k, 'a) => bool) => bool",
+ "deprecated": "Use `some` instead"
},
{
"id": "Belt.Map.Dict.some",
@@ -2358,7 +2405,8 @@
"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>"
+ "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>",
+ "deprecated": "Use `update` instead"
},
{
"id": "Belt.Map.Dict.update",
@@ -2372,7 +2420,8 @@
"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>"
+ "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>",
+ "deprecated": "Use `merge` instead"
},
{
"id": "Belt.Map.Dict.merge",
@@ -2395,7 +2444,8 @@
"kind": "value",
"name": "keepU",
"docstrings": [],
- "signature": "let keepU: (t<'k, 'a, 'id>, ('k, 'a) => bool) => t<'k, 'a, 'id>"
+ "signature": "let keepU: (t<'k, 'a, 'id>, ('k, 'a) => bool) => t<'k, 'a, 'id>",
+ "deprecated": "Use `keep` instead"
},
{
"id": "Belt.Map.Dict.keep",
@@ -2411,7 +2461,8 @@
"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>)"
+ "signature": "let partitionU: (\n t<'k, 'a, 'id>,\n ('k, 'a) => bool,\n) => (t<'k, 'a, 'id>, t<'k, 'a, 'id>)",
+ "deprecated": "Use `partition` instead"
},
{
"id": "Belt.Map.Dict.partition",
@@ -2436,7 +2487,8 @@
"kind": "value",
"name": "mapU",
"docstrings": [],
- "signature": "let mapU: (t<'k, 'a, 'id>, 'a => 'b) => t<'k, 'b, 'id>"
+ "signature": "let mapU: (t<'k, 'a, 'id>, 'a => 'b) => t<'k, 'b, 'id>",
+ "deprecated": "Use `map` instead"
},
{
"id": "Belt.Map.Dict.map",
@@ -2452,7 +2504,8 @@
"kind": "value",
"name": "mapWithKeyU",
"docstrings": [],
- "signature": "let mapWithKeyU: (t<'k, 'a, 'id>, ('k, 'a) => 'b) => t<'k, 'b, 'id>"
+ "signature": "let mapWithKeyU: (t<'k, 'a, 'id>, ('k, 'a) => 'b) => t<'k, 'b, 'id>",
+ "deprecated": "Use `mapWithKey` instead"
},
{
"id": "Belt.Map.Dict.mapWithKey",
@@ -2510,7 +2563,8 @@
"kind": "value",
"name": "cmpU",
"docstrings": [],
- "signature": "let cmpU: (t<'v>, t<'v>, ('v, 'v) => int) => int"
+ "signature": "let cmpU: (t<'v>, t<'v>, ('v, 'v) => int) => int",
+ "deprecated": "Use `cmp` instead"
},
{
"id": "Belt.Map.String.cmp",
@@ -2524,7 +2578,8 @@
"kind": "value",
"name": "eqU",
"docstrings": [],
- "signature": "let eqU: (t<'v>, t<'v>, ('v, 'v) => bool) => bool"
+ "signature": "let eqU: (t<'v>, t<'v>, ('v, 'v) => bool) => bool",
+ "deprecated": "Use `eq` instead"
},
{
"id": "Belt.Map.String.eq",
@@ -2540,14 +2595,15 @@
"kind": "value",
"name": "findFirstByU",
"docstrings": [],
- "signature": "let findFirstByU: (t<'v>, (key, 'v) => bool) => option<(key, 'v)>"
+ "signature": "let findFirstByU: (t<'v>, (key, 'v) => bool) => option<(key, 'v)>",
+ "deprecated": "Use `findFirstBy` instead"
},
{
"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```"
+ "`findFirstBy(m, p)` uses funcion `f` to find the first key value pair\nto match predicate `p`.\n\n## Examples\n\n```rescript\nlet mapString = Belt.Map.String.fromArray([(\"1\", \"one\"), (\"2\", \"two\"), (\"3\", \"three\")])\n\nmapString->\nBelt.Map.String.findFirstBy((k, v) => k == \"1\" && v == \"one\")\n->assertEqual(Some(\"1\", \"one\"))\n```"
],
"signature": "let findFirstBy: (t<'v>, (key, 'v) => bool) => option<(key, 'v)>"
},
@@ -2556,7 +2612,8 @@
"kind": "value",
"name": "forEachU",
"docstrings": [],
- "signature": "let forEachU: (t<'v>, (key, 'v) => unit) => unit"
+ "signature": "let forEachU: (t<'v>, (key, 'v) => unit) => unit",
+ "deprecated": "Use `forEach` instead"
},
{
"id": "Belt.Map.String.forEach",
@@ -2572,7 +2629,8 @@
"kind": "value",
"name": "reduceU",
"docstrings": [],
- "signature": "let reduceU: (t<'v>, 'v2, ('v2, key, 'v) => 'v2) => 'v2"
+ "signature": "let reduceU: (t<'v>, 'v2, ('v2, key, 'v) => 'v2) => 'v2",
+ "deprecated": "Use `reduce` instead"
},
{
"id": "Belt.Map.String.reduce",
@@ -2588,7 +2646,8 @@
"kind": "value",
"name": "everyU",
"docstrings": [],
- "signature": "let everyU: (t<'v>, (key, 'v) => bool) => bool"
+ "signature": "let everyU: (t<'v>, (key, 'v) => bool) => bool",
+ "deprecated": "Use `every` instead"
},
{
"id": "Belt.Map.String.every",
@@ -2604,7 +2663,8 @@
"kind": "value",
"name": "someU",
"docstrings": [],
- "signature": "let someU: (t<'v>, (key, 'v) => bool) => bool"
+ "signature": "let someU: (t<'v>, (key, 'v) => bool) => bool",
+ "deprecated": "Use `some` instead"
},
{
"id": "Belt.Map.String.some",
@@ -2782,7 +2842,8 @@
"kind": "value",
"name": "updateU",
"docstrings": [],
- "signature": "let updateU: (t<'v>, key, option<'v> => option<'v>) => t<'v>"
+ "signature": "let updateU: (t<'v>, key, option<'v> => option<'v>) => t<'v>",
+ "deprecated": "Use `update` instead"
},
{
"id": "Belt.Map.String.update",
@@ -2796,7 +2857,8 @@
"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>"
+ "signature": "let mergeU: (\n t<'v>,\n t<'v2>,\n (key, option<'v>, option<'v2>) => option<'c>,\n) => t<'c>",
+ "deprecated": "Use `merge` instead"
},
{
"id": "Belt.Map.String.merge",
@@ -2819,7 +2881,8 @@
"kind": "value",
"name": "keepU",
"docstrings": [],
- "signature": "let keepU: (t<'v>, (key, 'v) => bool) => t<'v>"
+ "signature": "let keepU: (t<'v>, (key, 'v) => bool) => t<'v>",
+ "deprecated": "Use `keep` instead"
},
{
"id": "Belt.Map.String.keep",
@@ -2835,7 +2898,8 @@
"kind": "value",
"name": "partitionU",
"docstrings": [],
- "signature": "let partitionU: (t<'v>, (key, 'v) => bool) => (t<'v>, t<'v>)"
+ "signature": "let partitionU: (t<'v>, (key, 'v) => bool) => (t<'v>, t<'v>)",
+ "deprecated": "Use `partition` instead"
},
{
"id": "Belt.Map.String.partition",
@@ -2860,7 +2924,8 @@
"kind": "value",
"name": "mapU",
"docstrings": [],
- "signature": "let mapU: (t<'v>, 'v => 'v2) => t<'v2>"
+ "signature": "let mapU: (t<'v>, 'v => 'v2) => t<'v2>",
+ "deprecated": "Use `map` instead"
},
{
"id": "Belt.Map.String.map",
@@ -2876,7 +2941,8 @@
"kind": "value",
"name": "mapWithKeyU",
"docstrings": [],
- "signature": "let mapWithKeyU: (t<'v>, (key, 'v) => 'v2) => t<'v2>"
+ "signature": "let mapWithKeyU: (t<'v>, (key, 'v) => 'v2) => t<'v2>",
+ "deprecated": "Use `mapWithKey` instead"
},
{
"id": "Belt.Map.String.mapWithKey",
@@ -2936,7 +3002,8 @@
"kind": "value",
"name": "cmpU",
"docstrings": [],
- "signature": "let cmpU: (t<'v>, t<'v>, ('v, 'v) => int) => int"
+ "signature": "let cmpU: (t<'v>, t<'v>, ('v, 'v) => int) => int",
+ "deprecated": "Use `cmp` instead"
},
{
"id": "Belt.Map.Int.cmp",
@@ -2950,7 +3017,8 @@
"kind": "value",
"name": "eqU",
"docstrings": [],
- "signature": "let eqU: (t<'v>, t<'v>, ('v, 'v) => bool) => bool"
+ "signature": "let eqU: (t<'v>, t<'v>, ('v, 'v) => bool) => bool",
+ "deprecated": "Use `eq` instead"
},
{
"id": "Belt.Map.Int.eq",
@@ -2966,14 +3034,15 @@
"kind": "value",
"name": "findFirstByU",
"docstrings": [],
- "signature": "let findFirstByU: (t<'v>, (key, 'v) => bool) => option<(key, 'v)>"
+ "signature": "let findFirstByU: (t<'v>, (key, 'v) => bool) => option<(key, 'v)>",
+ "deprecated": "Use `findFirstBy` instead"
},
{
"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```"
+ "`findFirstBy(m, p)` uses funcion `f` to find the first key value pair\nto match predicate `p`.\n\n## Examples\n\n```rescript\nlet mapInt = Belt.Map.Int.fromArray([(1, \"one\"), (2, \"two\"), (3, \"three\")])\n\nmapInt->\nBelt.Map.Int.findFirstBy((k, v) => k == 1 && v == \"one\")\n->assertEqual(Some(1, \"one\"))\n```"
],
"signature": "let findFirstBy: (t<'v>, (key, 'v) => bool) => option<(key, 'v)>"
},
@@ -2982,7 +3051,8 @@
"kind": "value",
"name": "forEachU",
"docstrings": [],
- "signature": "let forEachU: (t<'v>, (key, 'v) => unit) => unit"
+ "signature": "let forEachU: (t<'v>, (key, 'v) => unit) => unit",
+ "deprecated": "Use `forEach` instead"
},
{
"id": "Belt.Map.Int.forEach",
@@ -2998,7 +3068,8 @@
"kind": "value",
"name": "reduceU",
"docstrings": [],
- "signature": "let reduceU: (t<'v>, 'v2, ('v2, key, 'v) => 'v2) => 'v2"
+ "signature": "let reduceU: (t<'v>, 'v2, ('v2, key, 'v) => 'v2) => 'v2",
+ "deprecated": "Use `reduce` instead"
},
{
"id": "Belt.Map.Int.reduce",
@@ -3014,7 +3085,8 @@
"kind": "value",
"name": "everyU",
"docstrings": [],
- "signature": "let everyU: (t<'v>, (key, 'v) => bool) => bool"
+ "signature": "let everyU: (t<'v>, (key, 'v) => bool) => bool",
+ "deprecated": "Use `every` instead"
},
{
"id": "Belt.Map.Int.every",
@@ -3030,7 +3102,8 @@
"kind": "value",
"name": "someU",
"docstrings": [],
- "signature": "let someU: (t<'v>, (key, 'v) => bool) => bool"
+ "signature": "let someU: (t<'v>, (key, 'v) => bool) => bool",
+ "deprecated": "Use `some` instead"
},
{
"id": "Belt.Map.Int.some",
@@ -3208,7 +3281,8 @@
"kind": "value",
"name": "updateU",
"docstrings": [],
- "signature": "let updateU: (t<'v>, key, option<'v> => option<'v>) => t<'v>"
+ "signature": "let updateU: (t<'v>, key, option<'v> => option<'v>) => t<'v>",
+ "deprecated": "Use `update` instead"
},
{
"id": "Belt.Map.Int.update",
@@ -3222,7 +3296,8 @@
"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>"
+ "signature": "let mergeU: (\n t<'v>,\n t<'v2>,\n (key, option<'v>, option<'v2>) => option<'c>,\n) => t<'c>",
+ "deprecated": "Use `merge` instead"
},
{
"id": "Belt.Map.Int.merge",
@@ -3245,7 +3320,8 @@
"kind": "value",
"name": "keepU",
"docstrings": [],
- "signature": "let keepU: (t<'v>, (key, 'v) => bool) => t<'v>"
+ "signature": "let keepU: (t<'v>, (key, 'v) => bool) => t<'v>",
+ "deprecated": "Use `keep` instead"
},
{
"id": "Belt.Map.Int.keep",
@@ -3261,7 +3337,8 @@
"kind": "value",
"name": "partitionU",
"docstrings": [],
- "signature": "let partitionU: (t<'v>, (key, 'v) => bool) => (t<'v>, t<'v>)"
+ "signature": "let partitionU: (t<'v>, (key, 'v) => bool) => (t<'v>, t<'v>)",
+ "deprecated": "Use `partition` instead"
},
{
"id": "Belt.Map.Int.partition",
@@ -3286,7 +3363,8 @@
"kind": "value",
"name": "mapU",
"docstrings": [],
- "signature": "let mapU: (t<'v>, 'v => 'v2) => t<'v2>"
+ "signature": "let mapU: (t<'v>, 'v => 'v2) => t<'v2>",
+ "deprecated": "Use `map` instead"
},
{
"id": "Belt.Map.Int.map",
@@ -3302,7 +3380,8 @@
"kind": "value",
"name": "mapWithKeyU",
"docstrings": [],
- "signature": "let mapWithKeyU: (t<'v>, (key, 'v) => 'v2) => t<'v2>"
+ "signature": "let mapWithKeyU: (t<'v>, (key, 'v) => 'v2) => t<'v2>",
+ "deprecated": "Use `mapWithKey` instead"
},
{
"id": "Belt.Map.Int.mapWithKey",
@@ -3353,7 +3432,7 @@
"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```"
+ "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\nassertEqual(s0->Belt.Set.Dict.toArray, [1, 2, 3, 4])\n```"
],
"signature": "let fromArray: (array<'value>, ~cmp: cmp<'value, 'id>) => t<'value, 'id>"
},
@@ -3371,7 +3450,7 @@
"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```"
+ "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\nassertEqual(Belt.Set.Dict.isEmpty(empty), true)\nassertEqual(Belt.Set.Dict.isEmpty(notEmpty), false)\n```"
],
"signature": "let isEmpty: t<'a, 'b> => bool"
},
@@ -3380,7 +3459,7 @@
"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```"
+ "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\nassertEqual(set->Belt.Set.Dict.has(3, ~cmp=IntCmp.cmp), false)\nassertEqual(set->Belt.Set.Dict.has(1, ~cmp=IntCmp.cmp), true)\n```"
],
"signature": "let has: (t<'value, 'id>, 'value, ~cmp: cmp<'value, 'id>) => bool"
},
@@ -3389,7 +3468,7 @@
"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```"
+ "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)\nassertEqual(s0->Belt.Set.Dict.toArray, [])\nassertEqual(s1->Belt.Set.Dict.toArray, [1])\nassertEqual(s2->Belt.Set.Dict.toArray, [1, 2])\nassertEqual(s3->Belt.Set.Dict.toArray, [1, 2])\nassertEqual(s2, s3)\n```"
],
"signature": "let add: (\n t<'value, 'id>,\n 'value,\n ~cmp: cmp<'value, 'id>,\n) => t<'value, 'id>"
},
@@ -3398,7 +3477,7 @@
"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```"
+ "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)\nassertEqual(newSet->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>"
},
@@ -3407,7 +3486,7 @@
"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```"
+ "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\nassertEqual(s1->Belt.Set.Dict.toArray, [2,3,4,5])\nassertEqual(s2->Belt.Set.Dict.toArray, [2,4,5])\nassertEqual(s2, s3)\n```"
],
"signature": "let remove: (\n t<'value, 'id>,\n 'value,\n ~cmp: cmp<'value, 'id>,\n) => t<'value, 'id>"
},
@@ -3416,7 +3495,7 @@
"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```"
+ "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)\nassertEqual(newSet->Belt.Set.Dict.toArray, [])\n```"
],
"signature": "let removeMany: (\n t<'value, 'id>,\n array<'value>,\n ~cmp: cmp<'value, 'id>,\n) => t<'value, 'id>"
},
@@ -3425,7 +3504,7 @@
"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```"
+ "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)\nassertEqual(union->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>"
},
@@ -3434,7 +3513,7 @@
"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```"
+ "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)\nassertEqual(intersect->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>"
},
@@ -3443,7 +3522,7 @@
"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```"
+ "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\nassertEqual(diff1->Belt.Set.Dict.toArray, [6])\nassertEqual(diff2->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>"
},
@@ -3452,7 +3531,7 @@
"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```"
+ "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)\nassertEqual(Belt.Set.Dict.subset(s2, s0, ~cmp=IntCmp.cmp), true)\nassertEqual(Belt.Set.Dict.subset(s2, s1, ~cmp=IntCmp.cmp), true)\nassertEqual(Belt.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"
},
@@ -3470,7 +3549,7 @@
"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```"
+ "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\nassertEqual(Belt.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"
},
@@ -3481,14 +3560,15 @@
"docstrings": [
"Same as [forEach](##forEach) but takes uncurried functon."
],
- "signature": "let forEachU: (t<'value, 'id>, 'value => unit) => unit"
+ "signature": "let forEachU: (t<'value, 'id>, 'value => unit) => unit",
+ "deprecated": "Use `forEach` instead"
},
{
"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```"
+ "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))\nassertEqual(acc.contents, list{6, 5, 3, 2})\n```"
],
"signature": "let forEach: (t<'value, 'id>, 'value => unit) => unit"
},
@@ -3497,14 +3577,15 @@
"kind": "value",
"name": "reduceU",
"docstrings": [],
- "signature": "let reduceU: (t<'value, 'id>, 'a, ('a, 'value) => 'a) => 'a"
+ "signature": "let reduceU: (t<'value, 'id>, 'a, ('a, 'value) => 'a) => 'a",
+ "deprecated": "Use `reduce` instead"
},
{
"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```"
+ "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)\nassertEqual(\n s0->Belt.Set.Dict.reduce(list{}, (acc, element) => acc->Belt.List.add(element)),\n list{6, 5, 3, 2}\n)\n```"
],
"signature": "let reduce: (t<'value, 'id>, 'a, ('a, 'value) => 'a) => 'a"
},
@@ -3513,14 +3594,15 @@
"kind": "value",
"name": "everyU",
"docstrings": [],
- "signature": "let everyU: (t<'value, 'id>, 'value => bool) => bool"
+ "signature": "let everyU: (t<'value, 'id>, 'value => bool) => bool",
+ "deprecated": "Use `every` instead"
},
{
"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```"
+ "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)\nassertEqual(s0->Belt.Set.Dict.every(isEven), true)\n```"
],
"signature": "let every: (t<'value, 'id>, 'value => bool) => bool"
},
@@ -3529,14 +3611,15 @@
"kind": "value",
"name": "someU",
"docstrings": [],
- "signature": "let someU: (t<'value, 'id>, 'value => bool) => bool"
+ "signature": "let someU: (t<'value, 'id>, 'value => bool) => bool",
+ "deprecated": "Use `some` instead"
},
{
"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```"
+ "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)\nassertEqual(s0->Belt.Set.Dict.some(isOdd), true)\n```"
],
"signature": "let some: (t<'value, 'id>, 'value => bool) => bool"
},
@@ -3545,14 +3628,15 @@
"kind": "value",
"name": "keepU",
"docstrings": [],
- "signature": "let keepU: (t<'value, 'id>, 'value => bool) => t<'value, 'id>"
+ "signature": "let keepU: (t<'value, 'id>, 'value => bool) => t<'value, 'id>",
+ "deprecated": "Use `keep` instead"
},
{
"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```"
+ "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\nassertEqual(s1->Belt.Set.Dict.toArray, [2,4])\n```"
],
"signature": "let keep: (t<'value, 'id>, 'value => bool) => t<'value, 'id>"
},
@@ -3561,14 +3645,15 @@
"kind": "value",
"name": "partitionU",
"docstrings": [],
- "signature": "let partitionU: (\n t<'value, 'id>,\n 'value => bool,\n) => (t<'value, 'id>, t<'value, 'id>)"
+ "signature": "let partitionU: (\n t<'value, 'id>,\n 'value => bool,\n) => (t<'value, 'id>, t<'value, 'id>)",
+ "deprecated": "Use `partition` instead"
},
{
"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```"
+ "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\nassertEqual(s1->Belt.Set.Dict.toArray, [1,3,5])\nassertEqual(s2->Belt.Set.Dict.toArray, [2,4])\n```"
],
"signature": "let partition: (\n t<'value, 'id>,\n 'value => bool,\n) => (t<'value, 'id>, t<'value, 'id>)"
},
@@ -3577,7 +3662,7 @@
"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```"
+ "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\nassertEqual(s0->Belt.Set.Dict.size, 4)\n```"
],
"signature": "let size: t<'value, 'id> => int"
},
@@ -3586,7 +3671,7 @@
"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```"
+ "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\nassertEqual(s0->Belt.Set.Dict.toList, list{1, 2, 3, 5})\n```"
],
"signature": "let toList: t<'value, 'id> => list<'value>"
},
@@ -3595,7 +3680,7 @@
"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```"
+ "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\nassertEqual(s0->Belt.Set.Dict.toArray, [1,2,3,5])\n```"
],
"signature": "let toArray: t<'value, 'id> => array<'value>"
},
@@ -3604,7 +3689,7 @@
"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```"
+ "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\nassertEqual(s0->Belt.Set.Dict.minimum, None)\nassertEqual(s1->Belt.Set.Dict.minimum, Some(1))\n```"
],
"signature": "let minimum: t<'value, 'id> => option<'value>"
},
@@ -3613,7 +3698,7 @@
"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```"
+ "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\nassertEqual(s0->Belt.Set.Dict.minUndefined, Js.undefined)\nassertEqual(s1->Belt.Set.Dict.minUndefined, Js.Undefined.return(1))\n```"
],
"signature": "let minUndefined: t<'value, 'id> => Js.undefined<'value>"
},
@@ -3622,7 +3707,7 @@
"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```"
+ "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\nassertEqual(s0->Belt.Set.Dict.maximum, None)\nassertEqual(s1->Belt.Set.Dict.maximum, Some(5))\n```"
],
"signature": "let maximum: t<'value, 'id> => option<'value>"
},
@@ -3631,7 +3716,7 @@
"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```"
+ "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\nassertEqual(s0->Belt.Set.Dict.maxUndefined, Js.undefined)\nassertEqual(s1->Belt.Set.Dict.maxUndefined, Js.Undefined.return(5))\n```"
],
"signature": "let maxUndefined: t<'value, 'id> => Js.undefined<'value>"
},
@@ -3640,7 +3725,7 @@
"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```"
+ "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\nassertEqual(s0->Belt.Set.Dict.get(3, ~cmp=IntCmp.cmp), Some(3))\nassertEqual(s0->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>"
},
@@ -3667,7 +3752,7 @@
"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```"
+ "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\nassertEqual(present, true)\nassertEqual(smaller->Belt.Set.Dict.toArray, [1,2])\nassertEqual(larger->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)"
},
@@ -3687,7 +3772,7 @@
"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`]()"
+ "This module is [`Belt.Set`]() specialized with value type to be a primitive type.\nIt is more efficient in general, the API is the same with [`Belt_Set`]() except its value type is fixed,\nand identity is not needed(using the built-in one)\n\n**See** [`Belt.Set`]()"
],
"items": [
{
@@ -3828,7 +3913,8 @@
"kind": "value",
"name": "forEachU",
"docstrings": [],
- "signature": "let forEachU: (t, value => unit) => unit"
+ "signature": "let forEachU: (t, value => unit) => unit",
+ "deprecated": "Use `forEach` instead"
},
{
"id": "Belt.Set.String.forEach",
@@ -3844,7 +3930,8 @@
"kind": "value",
"name": "reduceU",
"docstrings": [],
- "signature": "let reduceU: (t, 'a, ('a, value) => 'a) => 'a"
+ "signature": "let reduceU: (t, 'a, ('a, value) => 'a) => 'a",
+ "deprecated": "Use `reduce` instead"
},
{
"id": "Belt.Set.String.reduce",
@@ -3860,7 +3947,8 @@
"kind": "value",
"name": "everyU",
"docstrings": [],
- "signature": "let everyU: (t, value => bool) => bool"
+ "signature": "let everyU: (t, value => bool) => bool",
+ "deprecated": "Use `every` instead"
},
{
"id": "Belt.Set.String.every",
@@ -3876,7 +3964,8 @@
"kind": "value",
"name": "someU",
"docstrings": [],
- "signature": "let someU: (t, value => bool) => bool"
+ "signature": "let someU: (t, value => bool) => bool",
+ "deprecated": "Use `some` instead"
},
{
"id": "Belt.Set.String.some",
@@ -3892,7 +3981,8 @@
"kind": "value",
"name": "keepU",
"docstrings": [],
- "signature": "let keepU: (t, value => bool) => t"
+ "signature": "let keepU: (t, value => bool) => t",
+ "deprecated": "Use `keep` instead"
},
{
"id": "Belt.Set.String.keep",
@@ -3908,7 +3998,8 @@
"kind": "value",
"name": "partitionU",
"docstrings": [],
- "signature": "let partitionU: (t, value => bool) => (t, t)"
+ "signature": "let partitionU: (t, value => bool) => (t, t)",
+ "deprecated": "Use `partition` instead"
},
{
"id": "Belt.Set.String.partition",
@@ -4016,7 +4107,7 @@
"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`]()"
+ "This module is [`Belt.Set`]() specialized with value type to be a primitive type.\nIt is more efficient in general, the API is the same with [`Belt_Set`]() except its value type is fixed,\nand identity is not needed(using the built-in one)\n\n**See** [`Belt.Set`]()"
],
"items": [
{
@@ -4157,7 +4248,8 @@
"kind": "value",
"name": "forEachU",
"docstrings": [],
- "signature": "let forEachU: (t, value => unit) => unit"
+ "signature": "let forEachU: (t, value => unit) => unit",
+ "deprecated": "Use `forEach` instead"
},
{
"id": "Belt.Set.Int.forEach",
@@ -4173,7 +4265,8 @@
"kind": "value",
"name": "reduceU",
"docstrings": [],
- "signature": "let reduceU: (t, 'a, ('a, value) => 'a) => 'a"
+ "signature": "let reduceU: (t, 'a, ('a, value) => 'a) => 'a",
+ "deprecated": "Use `reduce` instead"
},
{
"id": "Belt.Set.Int.reduce",
@@ -4189,7 +4282,8 @@
"kind": "value",
"name": "everyU",
"docstrings": [],
- "signature": "let everyU: (t, value => bool) => bool"
+ "signature": "let everyU: (t, value => bool) => bool",
+ "deprecated": "Use `every` instead"
},
{
"id": "Belt.Set.Int.every",
@@ -4205,7 +4299,8 @@
"kind": "value",
"name": "someU",
"docstrings": [],
- "signature": "let someU: (t, value => bool) => bool"
+ "signature": "let someU: (t, value => bool) => bool",
+ "deprecated": "Use `some` instead"
},
{
"id": "Belt.Set.Int.some",
@@ -4221,7 +4316,8 @@
"kind": "value",
"name": "keepU",
"docstrings": [],
- "signature": "let keepU: (t, value => bool) => t"
+ "signature": "let keepU: (t, value => bool) => t",
+ "deprecated": "Use `keep` instead"
},
{
"id": "Belt.Set.Int.keep",
@@ -4237,7 +4333,8 @@
"kind": "value",
"name": "partitionU",
"docstrings": [],
- "signature": "let partitionU: (t, value => bool) => (t, t)"
+ "signature": "let partitionU: (t, value => bool) => (t, t)",
+ "deprecated": "Use `partition` instead"
},
{
"id": "Belt.Set.Int.partition",
@@ -4649,7 +4746,7 @@
"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```"
+ "Converts a given `float` to an `int`.\n\n## Examples\n\n```rescript\nassertEqual(Belt.Float.toInt(1.0), 1)\n```"
],
"signature": "let toInt: float => int"
},
@@ -4658,7 +4755,7 @@
"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```"
+ "Converts a given `int` to a `float`.\n\n## Examples\n\n```rescript\nassertEqual(Belt.Float.fromInt(1), 1.0)\n```"
],
"signature": "let fromInt: int => float"
},
@@ -4667,7 +4764,7 @@
"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```"
+ "Converts a given `string` to a `float`. Returns `Some(float)` when the input is a number, `None` otherwise.\n\n## Examples\n\n```rescript\nassertEqual(Belt.Float.fromString(\"1.0\"), Some(1.0))\n```"
],
"signature": "let fromString: string => option"
},
@@ -4676,7 +4773,7 @@
"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```"
+ "Converts a given `float` to a `string`. Uses the JavaScript `String` constructor under the hood.\n\n## Examples\n\n```rescript\nassertEqual(Belt.Float.toString(1.0), \"1\")\n```"
],
"signature": "let toString: float => string"
},
@@ -4685,7 +4782,7 @@
"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```"
+ "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\nassertEqual(2.0 + 2.0, 4.0)\n```"
],
"signature": "let +: (float, float) => float"
},
@@ -4694,7 +4791,7 @@
"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```"
+ "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\nassertEqual(2.0 - 1.0, 1.0)\n```"
],
"signature": "let -: (float, float) => float"
},
@@ -4703,7 +4800,7 @@
"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```"
+ "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\nassertEqual(2.0 * 2.0, 4.0)\n```"
],
"signature": "let *: (float, float) => float"
},
@@ -4712,7 +4809,7 @@
"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```"
+ "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\nassertEqual(4.0 / 2.0, 2.0)\n```"
],
"signature": "let /: (float, float) => float"
}
@@ -4731,7 +4828,7 @@
"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```"
+ "Converts a given `int` to a `float`.\n\n## Examples\n\n```rescript\nBelt.Int.toFloat(1)->assertEqual(1.0)\n```"
],
"signature": "let toFloat: int => float"
},
@@ -4740,7 +4837,7 @@
"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```"
+ "Converts a given `float` to an `int`.\n\n## Examples\n\n```rescript\nBelt.Int.fromFloat(1.0)->assertEqual(1)\n```"
],
"signature": "let fromFloat: float => int"
},
@@ -4749,7 +4846,7 @@
"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```"
+ "Converts a given `string` to an `int`. Returns `Some(int)` when the input is a number, `None` otherwise.\n\n## Examples\n\n```rescript\nBelt.Int.fromString(\"1\")->assertEqual(Some(1))\n```"
],
"signature": "let fromString: string => option"
},
@@ -4758,7 +4855,7 @@
"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```"
+ "Converts a given `int` to a `string`. Uses the JavaScript `String` constructor under the hood.\n\n## Examples\n\n```rescript\nBelt.Int.toString(1)->assertEqual(\"1\")\n```"
],
"signature": "let toString: int => string"
},
@@ -4767,7 +4864,7 @@
"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```"
+ "Addition of two `int` values. Same as the addition from `Pervasives`.\n\n## Examples\n\n```rescript\nopen Belt.Int\nassertEqual(2 + 2, 4)\n```"
],
"signature": "let +: (int, int) => int"
},
@@ -4776,7 +4873,7 @@
"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```"
+ "Subtraction of two `int` values. Same as the subtraction from `Pervasives`.\n\n## Examples\n\n```rescript\nopen Belt.Int\nassertEqual(2 - 1, 1)\n```"
],
"signature": "let -: (int, int) => int"
},
@@ -4785,7 +4882,7 @@
"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```"
+ "Multiplication of two `int` values. Same as the multiplication from `Pervasives`.\n\n## Examples\n\n```rescript\nopen Belt.Int\nassertEqual(2 * 2, 4)\n```"
],
"signature": "let *: (int, int) => int"
},
@@ -4794,7 +4891,7 @@
"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```"
+ "Division of two `int` values. Same as the division from `Pervasives`.\n\n## Examples\n\n```rescript\nopen Belt.Int\nassertEqual(4 / 2, 2)\n```"
],
"signature": "let /: (int, int) => int"
}
@@ -4820,7 +4917,7 @@
"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```"
+ "`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.Ok(42)\n->Belt.Result.getExn\n->assertEqual(42)\n\n\nswitch Belt.Result.getExn(Belt.Result.Error(\"Invalid data\")) { // raise a exception\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```"
],
"signature": "let getExn: t<'a, 'b> => 'a"
},
@@ -4829,14 +4926,15 @@
"kind": "value",
"name": "mapWithDefaultU",
"docstrings": [],
- "signature": "let mapWithDefaultU: (t<'a, 'c>, 'b, 'a => 'b) => 'b"
+ "signature": "let mapWithDefaultU: (t<'a, 'c>, 'b, 'a => 'b) => 'b",
+ "deprecated": "Use `mapWithDefault` instead"
},
{
"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```"
+ "`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)\nassertEqual(Belt.Result.mapWithDefault(ok, 0, (x) => x / 2), 21)\n\nlet error = Belt.Result.Error(\"Invalid data\")\nassertEqual(Belt.Result.mapWithDefault(error, 0, (x) => x / 2), 0)\n```"
],
"signature": "let mapWithDefault: (t<'a, 'c>, 'b, 'a => 'b) => 'b"
},
@@ -4845,14 +4943,15 @@
"kind": "value",
"name": "mapU",
"docstrings": [],
- "signature": "let mapU: (t<'a, 'c>, 'a => 'b) => t<'b, 'c>"
+ "signature": "let mapU: (t<'a, 'c>, 'a => 'b) => t<'b, 'c>",
+ "deprecated": "Use `map` instead"
},
{
"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```"
+ "`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\nassertEqual(Belt.Result.map(Ok(64), f), Ok(8.0))\n\nassertEqual(Belt.Result.map(Error(\"Invalid data\"), f), Error(\"Invalid data\"))\n```"
],
"signature": "let map: (t<'a, 'c>, 'a => 'b) => t<'b, 'c>"
},
@@ -4861,14 +4960,15 @@
"kind": "value",
"name": "flatMapU",
"docstrings": [],
- "signature": "let flatMapU: (t<'a, 'c>, 'a => t<'b, 'c>) => t<'b, 'c>"
+ "signature": "let flatMapU: (t<'a, 'c>, 'a => t<'b, 'c>) => t<'b, 'c>",
+ "deprecated": "Use `flatMap` instead"
},
{
"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```"
+ "`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\nassertEqual(Belt.Result.flatMap(Ok(2.0), recip), Ok(0.5))\n\nassertEqual(Belt.Result.flatMap(Ok(0.0), recip), Error(\"Divide by zero\"))\n\nassertEqual(Belt.Result.flatMap(Error(\"Already bad\"), recip), Error(\"Already bad\"))\n```"
],
"signature": "let flatMap: (t<'a, 'c>, 'a => t<'b, 'c>) => t<'b, 'c>"
},
@@ -4877,7 +4977,7 @@
"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```"
+ "`getWithDefault(res, defaultValue)`: If `res` is `Ok(n)`, returns `n`,\notherwise `default`\n\n## Examples\n\n```rescript\nassertEqual(Belt.Result.getWithDefault(Ok(42), 0), 42)\n\nassertEqual(Belt.Result.getWithDefault(Error(\"Invalid Data\"), 0), 0)\n```"
],
"signature": "let getWithDefault: (t<'a, 'b>, 'a) => 'a"
},
@@ -4904,14 +5004,15 @@
"kind": "value",
"name": "eqU",
"docstrings": [],
- "signature": "let eqU: (t<'a, 'c>, t<'b, 'd>, ('a, 'b) => bool) => bool"
+ "signature": "let eqU: (t<'a, 'c>, t<'b, 'd>, ('a, 'b) => bool) => bool",
+ "deprecated": "Use `eq` instead"
},
{
"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```"
+ "`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\nassertEqual(Belt.Result.eq(good1, good2, mod10equal), true)\n\nassertEqual(Belt.Result.eq(good1, bad1, mod10equal), false)\n\nassertEqual(Belt.Result.eq(bad2, good2, mod10equal), false)\n\nassertEqual(Belt.Result.eq(bad1, bad2, mod10equal), true)\n```"
],
"signature": "let eq: (t<'a, 'c>, t<'b, 'd>, ('a, 'b) => bool) => bool"
},
@@ -4920,14 +5021,15 @@
"kind": "value",
"name": "cmpU",
"docstrings": [],
- "signature": "let cmpU: (t<'a, 'c>, t<'b, 'd>, ('a, 'b) => int) => int"
+ "signature": "let cmpU: (t<'a, 'c>, t<'b, 'd>, ('a, 'b) => int) => int",
+ "deprecated": "Use `cmp` instead"
},
{
"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```"
+ "`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\nassertEqual(Belt.Result.cmp(Ok(39), Ok(57), mod10cmp), 1)\n\nassertEqual(Belt.Result.cmp(Ok(57), Ok(39), mod10cmp), (-1))\n\nassertEqual(Belt.Result.cmp(Ok(39), Error(\"y\"), mod10cmp), 1)\n\nassertEqual(Belt.Result.cmp(Error(\"x\"), Ok(57), mod10cmp), (-1))\n\nassertEqual(Belt.Result.cmp(Error(\"x\"), Error(\"y\"), mod10cmp), 0)\n```"
],
"signature": "let cmp: (t<'a, 'c>, t<'b, 'd>, ('a, 'b) => int) => int"
}
@@ -4948,14 +5050,15 @@
"docstrings": [
"Uncurried version of `keep`"
],
- "signature": "let keepU: (option<'a>, 'a => bool) => option<'a>"
+ "signature": "let keepU: (option<'a>, 'a => bool) => option<'a>",
+ "deprecated": "Use `keep` instead"
},
{
"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```"
+ "If `optionValue` is `Some(value)` and `p(value) = true`, it returns `Some(value)`; otherwise returns `None`\n\n## Examples\n\n```rescript\nassertEqual(Belt.Option.keep(Some(10), x => x > 5), Some(10))\nassertEqual(Belt.Option.keep(Some(4), x => x > 5), None)\nassertEqual(Belt.Option.keep(None, x => x > 5), None)\n```"
],
"signature": "let keep: (option<'a>, 'a => bool) => option<'a>"
},
@@ -4966,7 +5069,8 @@
"docstrings": [
"Uncurried version of `forEach`"
],
- "signature": "let forEachU: (option<'a>, 'a => unit) => unit"
+ "signature": "let forEachU: (option<'a>, 'a => unit) => unit",
+ "deprecated": "Use `forEach` instead"
},
{
"id": "Belt.Option.forEach",
@@ -4982,7 +5086,7 @@
"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```"
+ "Raises an Error in case `None` is provided. Use with care.\n\n## Examples\n\n```rescript\nSome(3)\n->Belt.Option.getExn\n->assertEqual(3)\n\nswitch Belt.Option.getExn(None) { // Raises an exception\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```"
],
"signature": "let getExn: option<'a> => 'a"
},
@@ -5002,14 +5106,15 @@
"docstrings": [
"Uncurried version of `mapWithDefault`"
],
- "signature": "let mapWithDefaultU: (option<'a>, 'b, 'a => 'b) => 'b"
+ "signature": "let mapWithDefaultU: (option<'a>, 'b, 'a => 'b) => 'b",
+ "deprecated": "Use `mapWithDefault` instead"
},
{
"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```"
+ "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)\nassertEqual(someValue->Belt.Option.mapWithDefault(0, x => x + 5), 8)\n\nlet noneValue = None\nassertEqual(noneValue->Belt.Option.mapWithDefault(0, x => x + 5), 0)\n```"
],
"signature": "let mapWithDefault: (option<'a>, 'b, 'a => 'b) => 'b"
},
@@ -5020,14 +5125,15 @@
"docstrings": [
"Uncurried version of `map`"
],
- "signature": "let mapU: (option<'a>, 'a => 'b) => option<'b>"
+ "signature": "let mapU: (option<'a>, 'a => 'b) => option<'b>",
+ "deprecated": "Use `map` instead"
},
{
"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```"
+ "If `optionValue` is `Some(value)` this returns `f(value)`, otherwise it returns `None`.\n\n## Examples\n\n```rescript\nassertEqual(Belt.Option.map(Some(3), x => x * x), Some(9))\n\nassertEqual(Belt.Option.map(None, x => x * x), None)\n```"
],
"signature": "let map: (option<'a>, 'a => 'b) => option<'b>"
},
@@ -5038,14 +5144,15 @@
"docstrings": [
"Uncurried version of `flatMap`"
],
- "signature": "let flatMapU: (option<'a>, 'a => option<'b>) => option<'b>"
+ "signature": "let flatMapU: (option<'a>, 'a => option<'b>) => option<'b>",
+ "deprecated": "Use `flatMap` instead"
},
{
"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```"
+ "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\nassertEqual(Belt.Option.flatMap(Some(2), addIfAboveOne), Some(3))\n\nassertEqual(Belt.Option.flatMap(Some(-4), addIfAboveOne), None)\n\nassertEqual(Belt.Option.flatMap(None, addIfAboveOne), None)\n```"
],
"signature": "let flatMap: (option<'a>, 'a => option<'b>) => option<'b>"
},
@@ -5054,7 +5161,7 @@
"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```"
+ "If `optionalValue` is `Some(value)`, returns `value`, otherwise default.\n\n## Examples\n\n```rescript\nassertEqual(Belt.Option.getWithDefault(None, \"Banana\"), \"Banana\")\n\nassertEqual(Belt.Option.getWithDefault(Some(\"Apple\"), \"Banana\"), \"Apple\")\n```\n\n```rescript\nlet greet = (firstName: option) =>\n \"Greetings \" ++ firstName->Belt.Option.getWithDefault(\"Anonymous\")\n\nassertEqual(Some(\"Jane\")->greet, \"Greetings Jane\")\n\nassertEqual(None->greet, \"Greetings Anonymous\")\n```"
],
"signature": "let getWithDefault: (option<'a>, 'a) => 'a"
},
@@ -5063,7 +5170,7 @@
"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```"
+ "`orElse(optionalValue, otherOptional)` if `optionalValue` is `Some(value)`,\nreturns `Some(value)`, otherwise `otherOptional`\n\n## Examples\n\n```rescript\nassertEqual(Belt.Option.orElse(Some(1812), Some(1066)), Some(1812))\nassertEqual(Belt.Option.orElse(None, Some(1066)), Some(1066))\nassertEqual(Belt.Option.orElse(None, None), None)\n```"
],
"signature": "let orElse: (option<'a>, option<'a>) => option<'a>"
},
@@ -5072,7 +5179,7 @@
"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```"
+ "Returns `true` if the argument is `Some(value)`, `false` otherwise.\n\n## Examples\n\n```rescript\nassertEqual(Belt.Option.isSome(None), false)\n\nassertEqual(Belt.Option.isSome(Some(1)), true)\n```"
],
"signature": "let isSome: option<'a> => bool"
},
@@ -5081,7 +5188,7 @@
"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```"
+ "Returns `true` if the argument is `None`, `false` otherwise.\n\n## Examples\n\n```rescript\nassertEqual(Belt.Option.isNone(None), true)\n\nassertEqual(Belt.Option.isNone(Some(1)), false)\n```"
],
"signature": "let isNone: option<'a> => bool"
},
@@ -5092,14 +5199,15 @@
"docstrings": [
"Uncurried version of `eq`"
],
- "signature": "let eqU: (option<'a>, option<'b>, ('a, 'b) => bool) => bool"
+ "signature": "let eqU: (option<'a>, option<'b>, ('a, 'b) => bool) => bool",
+ "deprecated": "Use `eq` instead"
},
{
"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```"
+ "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\nassertEqual(eq(Some(3), Some(15), clockEqual), true)\n\nassertEqual(eq(Some(3), None, clockEqual), false)\n\nassertEqual(eq(None, Some(3), clockEqual), false)\n\nassertEqual(eq(None, None, clockEqual), true)\n```"
],
"signature": "let eq: (option<'a>, option<'b>, ('a, 'b) => bool) => bool"
},
@@ -5110,14 +5218,15 @@
"docstrings": [
"Uncurried version of `cmp`"
],
- "signature": "let cmpU: (option<'a>, option<'b>, ('a, 'b) => int) => int"
+ "signature": "let cmpU: (option<'a>, option<'b>, ('a, 'b) => int) => int",
+ "deprecated": "Use `cmp` instead"
},
{
"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```"
+ "`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\nassertEqual(cmp(Some(3), Some(15), clockCompare), 0)\n\nassertEqual(cmp(Some(3), Some(14), clockCompare), 1)\n\nassertEqual(cmp(Some(2), Some(15), clockCompare), (-1))\n\nassertEqual(cmp(None, Some(15), clockCompare), (-1))\n\nassertEqual(cmp(Some(14), None, clockCompare), 1)\n\nassertEqual(cmp(None, None, clockCompare), 0)\n```"
],
"signature": "let cmp: (option<'a>, option<'b>, ('a, 'b) => int) => int"
}
@@ -5128,7 +5237,7 @@
"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."
+ "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.hashable(~hash=(_: t) => 0xff_ff, ~eq=(a, b) => a == b))\nlet s0: Belt.HashMap.t = Belt.HashMap.make(~hintSize=40, ~id=module(I0))\n\nmodule I1 = unpack(Belt.Id.hashable(~hash=(_: t) => 0xff, ~eq=(a, b) => a == b))\nlet s1: Belt.HashMap.t = Belt.HashMap.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```\nlet s0: t\nlet s1: t\n```\n\nWe can add elements to the collection:\n\n## Examples\n\n```rescript\nlet () = {\n Belt.HashMap.set(s0, 0, 3)\n Belt.HashMap.set(s1, 1, \"3\")\n}\n```\n\nSince this is an mutable data strucure, `s1` will contain two pairs."
],
"items": [
{
@@ -5163,7 +5272,7 @@
"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```"
+ "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)\nassertEqual(Belt.HashMap.isEmpty(hMap), true)\n```"
],
"signature": "let clear: t<'key, 'value, 'id> => unit"
},
@@ -5172,7 +5281,7 @@
"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```"
+ "`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\nassertEqual(Belt.HashMap.isEmpty(Belt.HashMap.fromArray([(1, \"1\")], ~id=module(IntHash))), false)\n```"
],
"signature": "let isEmpty: t<'a, 'b, 'c> => bool"
},
@@ -5181,7 +5290,7 @@
"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```"
+ "`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\nassertEqual(Belt.HashMap.valuesToArray(s0), [\"1\", \"3\", \"3\"])\n```"
],
"signature": "let set: (t<'key, 'value, 'id>, 'key, 'value) => unit"
},
@@ -5190,7 +5299,7 @@
"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```"
+ "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\nassertEqual(Belt.HashMap.get(s0, 2) != Belt.HashMap.get(s1, 2), true)\n```"
],
"signature": "let copy: t<'key, 'value, 'id> => t<'key, 'value, 'id>"
},
@@ -5199,7 +5308,7 @@
"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```"
+ "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\nassertEqual(Belt.HashMap.get(s0, 1), Some(\"value1\"))\nassertEqual(Belt.HashMap.get(s0, 2), None)\n```"
],
"signature": "let get: (t<'key, 'value, 'id>, 'key) => option<'value>"
},
@@ -5208,7 +5317,7 @@
"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```"
+ "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\nassertEqual(Belt.HashMap.has(s0, 1), true)\nassertEqual(Belt.HashMap.has(s0, 2), false)\n```"
],
"signature": "let has: (t<'key, 'value, 'id>, 'key) => bool"
},
@@ -5217,7 +5326,7 @@
"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```"
+ "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)\nassertEqual(Belt.HashMap.has(s0, 1), false)\n```"
],
"signature": "let remove: (t<'key, 'value, 'id>, 'key) => unit"
},
@@ -5228,7 +5337,8 @@
"docstrings": [
"Same as [forEach](#forEach) but takes uncurried function."
],
- "signature": "let forEachU: (t<'key, 'value, 'id>, ('key, 'value) => unit) => unit"
+ "signature": "let forEachU: (t<'key, 'value, 'id>, ('key, 'value) => unit) => unit",
+ "deprecated": "Use `forEach` instead"
},
{
"id": "Belt.HashMap.forEach",
@@ -5244,14 +5354,15 @@
"kind": "value",
"name": "reduceU",
"docstrings": [],
- "signature": "let reduceU: (t<'key, 'value, 'id>, 'c, ('c, 'key, 'value) => 'c) => 'c"
+ "signature": "let reduceU: (t<'key, 'value, 'id>, 'c, ('c, 'key, 'value) => 'c) => 'c",
+ "deprecated": "Use `reduce` instead"
},
{
"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```"
+ "`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))\n\nBelt.HashMap.set(s0, 1, \"value1\")\nBelt.HashMap.set(s0, 2, \"value2\")\n\ns0\n->Belt.HashMap.reduce(\"\", (acc, _, value) => acc ++ (\", \" ++ value))\n->assertEqual(\", value1, value2\")\n```\n\n## More Examples\n\n```rescript\nConsole.log(\"lol\")\n```"
],
"signature": "let reduce: (t<'key, 'value, 'id>, 'c, ('c, 'key, 'value) => 'c) => 'c"
},
@@ -5262,7 +5373,8 @@
"docstrings": [
"Same as [keepMapInPlace](#keepMapInPlace) but takes uncurried function."
],
- "signature": "let keepMapInPlaceU: (\n t<'key, 'value, 'id>,\n ('key, 'value) => option<'value>,\n) => unit"
+ "signature": "let keepMapInPlaceU: (\n t<'key, 'value, 'id>,\n ('key, 'value) => option<'value>,\n) => unit",
+ "deprecated": "Use `keepMapInPlace` instead"
},
{
"id": "Belt.HashMap.keepMapInPlace",
@@ -5278,7 +5390,7 @@
"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```"
+ "`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\nassertEqual(Belt.HashMap.size(s0), 2)\n```"
],
"signature": "let size: t<'a, 'b, 'c> => int"
},
@@ -5287,7 +5399,7 @@
"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```"
+ "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\nassertEqual(Belt.HashMap.toArray(s0), [(1, \"value1\"), (2, \"value2\")])\n```"
],
"signature": "let toArray: t<'key, 'value, 'id> => array<('key, 'value)>"
},
@@ -5296,7 +5408,7 @@
"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```"
+ "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\nassertEqual(Belt.HashMap.keysToArray(s0), [1, 2])\n```"
],
"signature": "let keysToArray: t<'key, 'a, 'b> => array<'key>"
},
@@ -5305,7 +5417,7 @@
"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```"
+ "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\nassertEqual(Belt.HashMap.valuesToArray(s0), [\"value1\", \"value2\"])\n```"
],
"signature": "let valuesToArray: t<'a, 'value, 'b> => array<'value>"
},
@@ -5314,7 +5426,7 @@
"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```"
+ "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))\nassertEqual(Belt.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>"
},
@@ -5352,7 +5464,7 @@
"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."
+ "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.hashable(\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.hashable(\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\nSignatures:\n\n```\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": [
{
@@ -5425,7 +5537,8 @@
"kind": "value",
"name": "forEachU",
"docstrings": [],
- "signature": "let forEachU: (t<'a, 'id>, 'a => unit) => unit"
+ "signature": "let forEachU: (t<'a, 'id>, 'a => unit) => unit",
+ "deprecated": "Use `forEach` instead"
},
{
"id": "Belt.HashSet.forEach",
@@ -5441,7 +5554,8 @@
"kind": "value",
"name": "reduceU",
"docstrings": [],
- "signature": "let reduceU: (t<'a, 'id>, 'c, ('c, 'a) => 'c) => 'c"
+ "signature": "let reduceU: (t<'a, 'id>, 'c, ('c, 'a) => 'c) => 'c",
+ "deprecated": "Use `reduce` instead"
},
{
"id": "Belt.HashSet.reduce",
@@ -5550,7 +5664,8 @@
"kind": "value",
"name": "cmpU",
"docstrings": [],
- "signature": "let cmpU: (t<'k, 'a, 'id>, t<'k, 'a, 'id>, ('a, 'a) => int) => int"
+ "signature": "let cmpU: (t<'k, 'a, 'id>, t<'k, 'a, 'id>, ('a, 'a) => int) => int",
+ "deprecated": "Use `cmp` instead"
},
{
"id": "Belt.MutableMap.cmp",
@@ -5566,7 +5681,8 @@
"kind": "value",
"name": "eqU",
"docstrings": [],
- "signature": "let eqU: (t<'k, 'a, 'id>, t<'k, 'a, 'id>, ('a, 'a) => bool) => bool"
+ "signature": "let eqU: (t<'k, 'a, 'id>, t<'k, 'a, 'id>, ('a, 'a) => bool) => bool",
+ "deprecated": "Use `eq` instead"
},
{
"id": "Belt.MutableMap.eq",
@@ -5582,7 +5698,8 @@
"kind": "value",
"name": "forEachU",
"docstrings": [],
- "signature": "let forEachU: (t<'k, 'a, 'id>, ('k, 'a) => unit) => unit"
+ "signature": "let forEachU: (t<'k, 'a, 'id>, ('k, 'a) => unit) => unit",
+ "deprecated": "Use `forEach` instead"
},
{
"id": "Belt.MutableMap.forEach",
@@ -5598,7 +5715,8 @@
"kind": "value",
"name": "reduceU",
"docstrings": [],
- "signature": "let reduceU: (t<'k, 'a, 'id>, 'b, ('b, 'k, 'a) => 'b) => 'b"
+ "signature": "let reduceU: (t<'k, 'a, 'id>, 'b, ('b, 'k, 'a) => 'b) => 'b",
+ "deprecated": "Use `reduce` instead"
},
{
"id": "Belt.MutableMap.reduce",
@@ -5614,7 +5732,8 @@
"kind": "value",
"name": "everyU",
"docstrings": [],
- "signature": "let everyU: (t<'k, 'a, 'id>, ('k, 'a) => bool) => bool"
+ "signature": "let everyU: (t<'k, 'a, 'id>, ('k, 'a) => bool) => bool",
+ "deprecated": "Use `every` instead"
},
{
"id": "Belt.MutableMap.every",
@@ -5630,7 +5749,8 @@
"kind": "value",
"name": "someU",
"docstrings": [],
- "signature": "let someU: (t<'k, 'a, 'id>, ('k, 'a) => bool) => bool"
+ "signature": "let someU: (t<'k, 'a, 'id>, ('k, 'a) => bool) => bool",
+ "deprecated": "Use `some` instead"
},
{
"id": "Belt.MutableMap.some",
@@ -5808,7 +5928,8 @@
"kind": "value",
"name": "updateU",
"docstrings": [],
- "signature": "let updateU: (t<'k, 'a, 'id>, 'k, option<'a> => option<'a>) => unit"
+ "signature": "let updateU: (t<'k, 'a, 'id>, 'k, option<'a> => option<'a>) => unit",
+ "deprecated": "Use `update` instead"
},
{
"id": "Belt.MutableMap.update",
@@ -5829,7 +5950,8 @@
"kind": "value",
"name": "mapU",
"docstrings": [],
- "signature": "let mapU: (t<'k, 'a, 'id>, 'a => 'b) => t<'k, 'b, 'id>"
+ "signature": "let mapU: (t<'k, 'a, 'id>, 'a => 'b) => t<'k, 'b, 'id>",
+ "deprecated": "Use `map` instead"
},
{
"id": "Belt.MutableMap.map",
@@ -5845,7 +5967,8 @@
"kind": "value",
"name": "mapWithKeyU",
"docstrings": [],
- "signature": "let mapWithKeyU: (t<'k, 'a, 'id>, ('k, 'a) => 'b) => t<'k, 'b, 'id>"
+ "signature": "let mapWithKeyU: (t<'k, 'a, 'id>, ('k, 'a) => 'b) => t<'k, 'b, 'id>",
+ "deprecated": "Use `mapWithKey` instead"
},
{
"id": "Belt.MutableMap.mapWithKey",
@@ -5896,7 +6019,7 @@
"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```"
+ "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\nassertEqual(s0->Belt.MutableSet.toArray, [1, 2, 3, 4])\n```"
],
"signature": "let fromArray: (array<'value>, ~id: id<'value, 'id>) => t<'value, 'id>"
},
@@ -5914,7 +6037,7 @@
"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```"
+ "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\nassertEqual(copied->Belt.MutableSet.toArray, [1, 2, 3, 4])\n```"
],
"signature": "let copy: t<'value, 'id> => t<'value, 'id>"
},
@@ -5923,7 +6046,7 @@
"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```"
+ "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\nassertEqual(Belt.MutableSet.isEmpty(empty), true)\nassertEqual(Belt.MutableSet.isEmpty(notEmpty), false)\n```"
],
"signature": "let isEmpty: t<'a, 'b> => bool"
},
@@ -5932,7 +6055,7 @@
"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```"
+ "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\nassertEqual(set->Belt.MutableSet.has(3), false)\nassertEqual(set->Belt.MutableSet.has(1), true)\n```"
],
"signature": "let has: (t<'value, 'id>, 'value) => bool"
},
@@ -5941,7 +6064,7 @@
"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```"
+ "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\nassertEqual(s0->Belt.MutableSet.toArray, [1, 2])\n```"
],
"signature": "let add: (t<'value, 'id>, 'value) => unit"
},
@@ -5957,7 +6080,7 @@
"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```"
+ "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])\nassertEqual(set->Belt.MutableSet.toArray, [1, 2, 3, 4, 5])\n```"
],
"signature": "let mergeMany: (t<'value, 'id>, array<'value>) => unit"
},
@@ -5966,7 +6089,7 @@
"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```"
+ "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\nassertEqual(s0->Belt.MutableSet.toArray, [2,4,5])\n```"
],
"signature": "let remove: (t<'value, 'id>, 'value) => unit"
},
@@ -5982,7 +6105,7 @@
"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```"
+ "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])\nassertEqual(set->Belt.MutableSet.toArray, [])\n```"
],
"signature": "let removeMany: (t<'value, 'id>, array<'value>) => unit"
},
@@ -5991,7 +6114,7 @@
"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```"
+ "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)\nassertEqual(union->Belt.MutableSet.toArray, [1,2,3,4,5,6])\n```"
],
"signature": "let union: (t<'value, 'id>, t<'value, 'id>) => t<'value, 'id>"
},
@@ -6000,7 +6123,7 @@
"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```"
+ "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)\nassertEqual(intersect->Belt.MutableSet.toArray, [2,3,5])\n```"
],
"signature": "let intersect: (t<'value, 'id>, t<'value, 'id>) => t<'value, 'id>"
},
@@ -6009,7 +6132,7 @@
"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```"
+ "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))\nassertEqual(Belt.MutableSet.toArray(Belt.MutableSet.diff(s0, s1)), [6])\nassertEqual(Belt.MutableSet.toArray(Belt.MutableSet.diff(s1, s0)), [1,4])\n```"
],
"signature": "let diff: (t<'value, 'id>, t<'value, 'id>) => t<'value, 'id>"
},
@@ -6018,7 +6141,7 @@
"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```"
+ "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)\nassertEqual(Belt.MutableSet.subset(s2, s0), true)\nassertEqual(Belt.MutableSet.subset(s2, s1), true)\nassertEqual(Belt.MutableSet.subset(s1, s0), false)\n```"
],
"signature": "let subset: (t<'value, 'id>, t<'value, 'id>) => bool"
},
@@ -6036,7 +6159,7 @@
"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```"
+ "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\nassertEqual(Belt.MutableSet.eq(s0, s1), true)\n```"
],
"signature": "let eq: (t<'value, 'id>, t<'value, 'id>) => bool"
},
@@ -6047,14 +6170,15 @@
"docstrings": [
"Same as `Belt.MutableSet.forEach` but takes uncurried functon."
],
- "signature": "let forEachU: (t<'value, 'id>, 'value => unit) => unit"
+ "signature": "let forEachU: (t<'value, 'id>, 'value => unit) => unit",
+ "deprecated": "Use `forEach` instead"
},
{
"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```"
+ "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))\nassertEqual(acc.contents, list{6, 5, 3, 2})\n```"
],
"signature": "let forEach: (t<'value, 'id>, 'value => unit) => unit"
},
@@ -6063,14 +6187,15 @@
"kind": "value",
"name": "reduceU",
"docstrings": [],
- "signature": "let reduceU: (t<'value, 'id>, 'a, ('a, 'value) => 'a) => 'a"
+ "signature": "let reduceU: (t<'value, 'id>, 'a, ('a, 'value) => 'a) => 'a",
+ "deprecated": "Use `reduce` instead"
},
{
"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```"
+ "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))\nassertEqual(\n s0->Belt.MutableSet.reduce(list{}, (acc, element) => acc->Belt.List.add(element)),\n list{6, 5, 3, 2}\n)\n```"
],
"signature": "let reduce: (t<'value, 'id>, 'a, ('a, 'value) => 'a) => 'a"
},
@@ -6079,14 +6204,15 @@
"kind": "value",
"name": "everyU",
"docstrings": [],
- "signature": "let everyU: (t<'value, 'id>, 'value => bool) => bool"
+ "signature": "let everyU: (t<'value, 'id>, 'value => bool) => bool",
+ "deprecated": "Use `every` instead"
},
{
"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```"
+ "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))\nassertEqual(s0->Belt.MutableSet.every(isEven), true)\n```"
],
"signature": "let every: (t<'value, 'id>, 'value => bool) => bool"
},
@@ -6095,14 +6221,15 @@
"kind": "value",
"name": "someU",
"docstrings": [],
- "signature": "let someU: (t<'value, 'id>, 'value => bool) => bool"
+ "signature": "let someU: (t<'value, 'id>, 'value => bool) => bool",
+ "deprecated": "Use `some` instead"
},
{
"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```"
+ "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))\nassertEqual(s0->Belt.MutableSet.some(isOdd), true)\n```"
],
"signature": "let some: (t<'value, 'id>, 'value => bool) => bool"
},
@@ -6111,14 +6238,15 @@
"kind": "value",
"name": "keepU",
"docstrings": [],
- "signature": "let keepU: (t<'value, 'id>, 'value => bool) => t<'value, 'id>"
+ "signature": "let keepU: (t<'value, 'id>, 'value => bool) => t<'value, 'id>",
+ "deprecated": "Use `keep` instead"
},
{
"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```"
+ "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\nassertEqual(s1->Belt.MutableSet.toArray, [2, 4])\n```"
],
"signature": "let keep: (t<'value, 'id>, 'value => bool) => t<'value, 'id>"
},
@@ -6127,14 +6255,15 @@
"kind": "value",
"name": "partitionU",
"docstrings": [],
- "signature": "let partitionU: (\n t<'value, 'id>,\n 'value => bool,\n) => (t<'value, 'id>, t<'value, 'id>)"
+ "signature": "let partitionU: (\n t<'value, 'id>,\n 'value => bool,\n) => (t<'value, 'id>, t<'value, 'id>)",
+ "deprecated": "Use `partition` instead"
},
{
"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```"
+ "## 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\nassertEqual(s1->Belt.MutableSet.toArray, [1,3,5])\nassertEqual(s2->Belt.MutableSet.toArray, [2,4])\n```"
],
"signature": "let partition: (\n t<'value, 'id>,\n 'value => bool,\n) => (t<'value, 'id>, t<'value, 'id>)"
},
@@ -6143,7 +6272,7 @@
"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```"
+ "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\nassertEqual(s0->Belt.MutableSet.size, 4)\n```"
],
"signature": "let size: t<'value, 'id> => int"
},
@@ -6152,7 +6281,7 @@
"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```"
+ "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\nassertEqual(s0->Belt.MutableSet.toList, list{1, 2, 3, 5})\n```"
],
"signature": "let toList: t<'value, 'id> => list<'value>"
},
@@ -6161,7 +6290,7 @@
"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```"
+ "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\nassertEqual(s0->Belt.MutableSet.toArray, [1,2,3,5])\n```"
],
"signature": "let toArray: t<'value, 'id> => array<'value>"
},
@@ -6170,7 +6299,7 @@
"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```"
+ "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\nassertEqual(s0->Belt.MutableSet.minimum, None)\nassertEqual(s1->Belt.MutableSet.minimum, Some(1))\n```"
],
"signature": "let minimum: t<'value, 'id> => option<'value>"
},
@@ -6179,7 +6308,7 @@
"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```"
+ "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\nassertEqual(s0->Belt.MutableSet.minUndefined, Js.undefined)\nassertEqual(s1->Belt.MutableSet.minUndefined, Js.Undefined.return(1))\n```"
],
"signature": "let minUndefined: t<'value, 'id> => Js.undefined<'value>"
},
@@ -6188,7 +6317,7 @@
"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```"
+ "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\nassertEqual(s0->Belt.MutableSet.maximum, None)\nassertEqual(s1->Belt.MutableSet.maximum, Some(5))\n```"
],
"signature": "let maximum: t<'value, 'id> => option<'value>"
},
@@ -6197,7 +6326,7 @@
"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```"
+ "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\nassertEqual(s0->Belt.MutableSet.maxUndefined, Js.undefined)\nassertEqual(s1->Belt.MutableSet.maxUndefined, Js.Undefined.return(5))\n```"
],
"signature": "let maxUndefined: t<'value, 'id> => Js.undefined<'value>"
},
@@ -6206,7 +6335,7 @@
"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```"
+ "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\nassertEqual(s0->Belt.MutableSet.get(3), Some(3))\nassertEqual(s0->Belt.MutableSet.get(20), None)\n```"
],
"signature": "let get: (t<'value, 'id>, 'value) => option<'value>"
},
@@ -6233,7 +6362,7 @@
"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```"
+ "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\nassertEqual(present, true)\nassertEqual(smaller->Belt.MutableSet.toArray, [1,2])\nassertEqual(larger->Belt.MutableSet.toArray, [4,5])\n```"
],
"signature": "let split: (\n t<'value, 'id>,\n 'value,\n) => ((t<'value, 'id>, t<'value, 'id>), bool)"
},
@@ -6288,7 +6417,7 @@
"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```"
+ "`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\nassertEqual(Belt.Map.isEmpty(Belt.Map.fromArray([(1, \"1\")], ~id=module(IntCmp))), false)\n```"
],
"signature": "let isEmpty: t<'a, 'b, 'c> => bool"
},
@@ -6297,7 +6426,7 @@
"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```"
+ "`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\nassertEqual(Belt.Map.has(Belt.Map.fromArray([(1, \"1\")], ~id=module(IntCmp)), 1), true)\n```"
],
"signature": "let has: (t<'k, 'v, 'id>, 'k) => bool"
},
@@ -6306,7 +6435,8 @@
"kind": "value",
"name": "cmpU",
"docstrings": [],
- "signature": "let cmpU: (t<'k, 'v, 'id>, t<'k, 'v, 'id>, ('v, 'v) => int) => int"
+ "signature": "let cmpU: (t<'k, 'v, 'id>, t<'k, 'v, 'id>, ('v, 'v) => int) => int",
+ "deprecated": "Use `cmp` instead"
},
{
"id": "Belt.Map.cmp",
@@ -6322,7 +6452,8 @@
"kind": "value",
"name": "eqU",
"docstrings": [],
- "signature": "let eqU: (t<'k, 'v, 'id>, t<'k, 'v, 'id>, ('v, 'v) => bool) => bool"
+ "signature": "let eqU: (t<'k, 'v, 'id>, t<'k, 'v, 'id>, ('v, 'v) => bool) => bool",
+ "deprecated": "Use `eq` instead"
},
{
"id": "Belt.Map.eq",
@@ -6338,14 +6469,15 @@
"kind": "value",
"name": "findFirstByU",
"docstrings": [],
- "signature": "let findFirstByU: (t<'k, 'v, 'id>, ('k, 'v) => bool) => option<('k, 'v)>"
+ "signature": "let findFirstByU: (t<'k, 'v, 'id>, ('k, 'v) => bool) => option<('k, 'v)>",
+ "deprecated": "Use `findFirstBy` instead"
},
{
"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```"
+ "`\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\ns0\n->Belt.Map.findFirstBy((k, _) => k == 4)\n->assertEqual(Some(4, \"4\"))\n```"
],
"signature": "let findFirstBy: (t<'k, 'v, 'id>, ('k, 'v) => bool) => option<('k, 'v)>"
},
@@ -6354,14 +6486,15 @@
"kind": "value",
"name": "forEachU",
"docstrings": [],
- "signature": "let forEachU: (t<'k, 'v, 'id>, ('k, 'v) => unit) => unit"
+ "signature": "let forEachU: (t<'k, 'v, 'id>, ('k, 'v) => unit) => unit",
+ "deprecated": "Use `forEach` instead"
},
{
"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```"
+ "`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, \"3\")])\n\nlet acc = ref(list{})\n\nBelt.Map.forEach(s0, (k, v) => acc := list{(k, v), ...acc.contents})\n\nassertEqual(acc.contents, list{(4, \"4\"), (3, \"3\"), (2, \"2\"), (1, \"1\")})\n```"
],
"signature": "let forEach: (t<'k, 'v, 'id>, ('k, 'v) => unit) => unit"
},
@@ -6370,14 +6503,15 @@
"kind": "value",
"name": "reduceU",
"docstrings": [],
- "signature": "let reduceU: (t<'k, 'v, 'id>, 'acc, ('acc, 'k, 'v) => 'acc) => 'acc"
+ "signature": "let reduceU: (t<'k, 'v, 'id>, 'acc, ('acc, 'k, 'v) => 'acc) => 'acc",
+ "deprecated": "Use `reduce` instead"
},
{
"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```"
+ "`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\nassertEqual(\n Belt.Map.reduce(s0, list{}, (acc, k, v) => list{\n (k, v),\n ...acc,\n }),\n list{(4, \"4\"), (3, \"3\"), (2, \"2\"), (1, \"1\")}\n)\n```"
],
"signature": "let reduce: (t<'k, 'v, 'id>, 'acc, ('acc, 'k, 'v) => 'acc) => 'acc"
},
@@ -6386,7 +6520,8 @@
"kind": "value",
"name": "everyU",
"docstrings": [],
- "signature": "let everyU: (t<'k, 'v, 'id>, ('k, 'v) => bool) => bool"
+ "signature": "let everyU: (t<'k, 'v, 'id>, ('k, 'v) => bool) => bool",
+ "deprecated": "Use `every` instead"
},
{
"id": "Belt.Map.every",
@@ -6402,7 +6537,8 @@
"kind": "value",
"name": "someU",
"docstrings": [],
- "signature": "let someU: (t<'k, 'v, 'id>, ('k, 'v) => bool) => bool"
+ "signature": "let someU: (t<'k, 'v, 'id>, ('k, 'v) => bool) => bool",
+ "deprecated": "Use `some` instead"
},
{
"id": "Belt.Map.some",
@@ -6418,7 +6554,7 @@
"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```"
+ "`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\nassertEqual(\n Belt.Map.size(Belt.Map.fromArray([(2, \"2\"), (2, \"1\"), (3, \"3\")], ~id=module(IntCmp))),\n 2\n)\n```"
],
"signature": "let size: t<'k, 'v, 'id> => int"
},
@@ -6427,7 +6563,7 @@
"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```"
+ "`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\nassertEqual(\n Belt.Map.toArray(Belt.Map.fromArray([(2, \"2\"), (1, \"1\"), (3, \"3\")], ~id=module(IntCmp))),\n [\n (1, \"1\"),\n (2, \"2\"),\n (3, \"3\"),\n ]\n)\n```"
],
"signature": "let toArray: t<'k, 'v, 'id> => array<('k, 'v)>"
},
@@ -6445,7 +6581,7 @@
"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```"
+ "`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\nassertEqual(\n Belt.Map.toArray(Belt.Map.fromArray([(2, \"2\"), (1, \"1\"), (3, \"3\")], ~id=module(IntCmp))),\n [\n (1, \"1\"),\n (2, \"2\"),\n (3, \"3\"),\n ]\n)\n```"
],
"signature": "let fromArray: (array<('k, 'v)>, ~id: id<'k, 'id>) => t<'k, 'v, 'id>"
},
@@ -6454,7 +6590,7 @@
"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```"
+ "`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\nassertEqual(\n Belt.Map.keysToArray(Belt.Map.fromArray([(2, \"2\"), (1, \"1\"), (3, \"3\")], ~id=module(IntCmp))),\n [1, 2, 3]\n)\n```"
],
"signature": "let keysToArray: t<'k, 'v, 'id> => array<'k>"
},
@@ -6463,7 +6599,7 @@
"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```"
+ "`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\nassertEqual(\n Belt.Map.valuesToArray(\n Belt.Map.fromArray([(2, \"2\"), (1, \"1\"), (3, \"3\")], ~id=module(IntCmp)),\n ),\n [\"1\", \"2\", \"3\"]\n)\n```"
],
"signature": "let valuesToArray: t<'k, 'v, 'id> => array<'v>"
},
@@ -6544,7 +6680,7 @@
"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```"
+ "`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\nassertEqual(\n Belt.Map.get(Belt.Map.fromArray([(2, \"2\"), (1, \"1\"), (3, \"3\")], ~id=module(IntCmp)), 2),\n Some(\"2\")\n)\n\nassertEqual(\n Belt.Map.get(Belt.Map.fromArray([(2, \"2\"), (1, \"1\"), (3, \"3\")], ~id=module(IntCmp)), 4),\n None\n)\n```"
],
"signature": "let get: (t<'k, 'v, 'id>, 'k) => option<'v>"
},
@@ -6580,7 +6716,7 @@
"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```"
+ "`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\nassertEqual(s1, s2)\n\nassertEqual(Belt.Map.keysToArray(s1), [2, 3])\n```"
],
"signature": "let remove: (t<'k, 'v, 'id>, 'k) => t<'k, 'v, 'id>"
},
@@ -6598,7 +6734,7 @@
"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```"
+ "`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\nassertEqual(Belt.Map.valuesToArray(s1), [\"1\", \"3\", \"3\"])\n```"
],
"signature": "let set: (t<'k, 'v, 'id>, 'k, 'v) => t<'k, 'v, 'id>"
},
@@ -6607,7 +6743,8 @@
"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>"
+ "signature": "let updateU: (\n t<'k, 'v, 'id>,\n 'k,\n option<'v> => option<'v>,\n) => t<'k, 'v, 'id>",
+ "deprecated": "Use `update` instead"
},
{
"id": "Belt.Map.update",
@@ -6632,7 +6769,8 @@
"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>"
+ "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>",
+ "deprecated": "Use `merge` instead"
},
{
"id": "Belt.Map.merge",
@@ -6648,7 +6786,8 @@
"kind": "value",
"name": "keepU",
"docstrings": [],
- "signature": "let keepU: (t<'k, 'v, 'id>, ('k, 'v) => bool) => t<'k, 'v, 'id>"
+ "signature": "let keepU: (t<'k, 'v, 'id>, ('k, 'v) => bool) => t<'k, 'v, 'id>",
+ "deprecated": "Use `keep` instead"
},
{
"id": "Belt.Map.keep",
@@ -6664,7 +6803,8 @@
"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>)"
+ "signature": "let partitionU: (\n t<'k, 'v, 'id>,\n ('k, 'v) => bool,\n) => (t<'k, 'v, 'id>, t<'k, 'v, 'id>)",
+ "deprecated": "Use `partition` instead"
},
{
"id": "Belt.Map.partition",
@@ -6689,7 +6829,8 @@
"kind": "value",
"name": "mapU",
"docstrings": [],
- "signature": "let mapU: (t<'k, 'v, 'id>, 'v => 'v2) => t<'k, 'v2, 'id>"
+ "signature": "let mapU: (t<'k, 'v, 'id>, 'v => 'v2) => t<'k, 'v2, 'id>",
+ "deprecated": "Use `map` instead"
},
{
"id": "Belt.Map.map",
@@ -6705,7 +6846,8 @@
"kind": "value",
"name": "mapWithKeyU",
"docstrings": [],
- "signature": "let mapWithKeyU: (t<'k, 'v, 'id>, ('k, 'v) => 'v2) => t<'k, 'v2, 'id>"
+ "signature": "let mapWithKeyU: (t<'k, 'v, 'id>, ('k, 'v) => 'v2) => t<'k, 'v2, 'id>",
+ "deprecated": "Use `mapWithKey` instead"
},
{
"id": "Belt.Map.mapWithKey",
@@ -6785,7 +6927,7 @@
"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```"
+ "Creates a new set by taking in the comparator\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.make(~id=module(IntCmp))\n\nBelt.Set.isEmpty(set)->assertEqual(true)\n```"
],
"signature": "let make: (~id: id<'value, 'id>) => t<'value, 'id>"
},
@@ -6794,7 +6936,7 @@
"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```"
+ "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.fromArray([1, 3, 2, 4], ~id=module(IntCmp))\n\ns0->Belt.Set.toArray->assertEqual([1, 2, 3, 4])\n```"
],
"signature": "let fromArray: (array<'value>, ~id: id<'value, 'id>) => t<'value, 'id>"
},
@@ -6812,7 +6954,7 @@
"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```"
+ "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.fromArray([], ~id=module(IntCmp))\nlet notEmpty = Belt.Set.fromArray([1], ~id=module(IntCmp))\n\nBelt.Set.isEmpty(empty)->assertEqual(true)\nBelt.Set.isEmpty(notEmpty)->assertEqual(false)\n```"
],
"signature": "let isEmpty: t<'a, 'b> => bool"
},
@@ -6821,7 +6963,7 @@
"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```"
+ "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.Set.fromArray([1, 4, 2, 5], ~id=module(IntCmp))\n\nset->Belt.Set.has(3)->assertEqual(false)\nset->Belt.Set.has(1)->assertEqual(true)\n```"
],
"signature": "let has: (t<'value, 'id>, 'value) => bool"
},
@@ -6830,7 +6972,7 @@
"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```"
+ "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.make(~id=module(IntCmp))\n\nlet s1 = s0->Belt.Set.add(1)\nlet s2 = s1->Belt.Set.add(2)\nlet s3 = s2->Belt.Set.add(2)\n\ns0->Belt.Set.toArray->assertEqual([])\ns1->Belt.Set.toArray->assertEqual([1])\ns2->Belt.Set.toArray->assertEqual([1, 2])\ns3->Belt.Set.toArray->assertEqual([1, 2])\nassertEqual(s2, s3)\n```"
],
"signature": "let add: (t<'value, 'id>, 'value) => t<'value, 'id>"
},
@@ -6839,7 +6981,7 @@
"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```"
+ "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\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet set = Belt.Set.make(~id=module(IntCmp))\n\nlet newSet = set->Belt.Set.mergeMany([5, 4, 3, 2, 1])\n\nnewSet\n->Belt.Set.toArray\n->assertEqual([1, 2, 3, 4, 5])\n```"
],
"signature": "let mergeMany: (t<'value, 'id>, array<'value>) => t<'value, 'id>"
},
@@ -6848,7 +6990,7 @@
"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```"
+ "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.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->assertEqual([2,3,4,5])\ns2->Belt.Set.toArray->assertEqual([2,4,5])\nassertEqual(s2, s3)\n```"
],
"signature": "let remove: (t<'value, 'id>, 'value) => t<'value, 'id>"
},
@@ -6857,7 +6999,7 @@
"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```"
+ "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\nmodule IntCmp = Belt.Id.MakeComparable({\n type t = int\n let cmp = Pervasives.compare\n})\n\nlet set = Belt.Set.fromArray([1, 2, 3, 4],~id=module(IntCmp))\n\nlet newSet = set->Belt.Set.removeMany([5, 4, 3, 2, 1])\n\nnewSet\n->Belt.Set.toArray\n->assertEqual([])\n```"
],
"signature": "let removeMany: (t<'value, 'id>, array<'value>) => t<'value, 'id>"
},
@@ -6866,7 +7008,7 @@
"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```"
+ "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.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)\n\nunion\n->Belt.Set.toArray\n->assertEqual([1,2,3,4,5,6])\n```"
],
"signature": "let union: (t<'value, 'id>, t<'value, 'id>) => t<'value, 'id>"
},
@@ -6875,7 +7017,7 @@
"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```"
+ "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.fromArray([5,2,3,5,6], ~id=module(IntCmp))\nlet s1 = Belt.Set.fromArray([5,2,3,1,5,4], ~id=module(IntCmp))\n\nlet intersect = Belt.Set.intersect(s0, s1)\n\nintersect\n->Belt.Set.toArray\n->assertEqual([2,3,5])\n```"
],
"signature": "let intersect: (t<'value, 'id>, t<'value, 'id>) => t<'value, 'id>"
},
@@ -6884,7 +7026,7 @@
"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```"
+ "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.fromArray([5,2,3,5,6], ~id=module(IntCmp))\nlet s1 = Belt.Set.fromArray([5,2,3,1,5,4], ~id=module(IntCmp))\n\nBelt.Set.diff(s0, s1)\n->Belt.Set.toArray\n->assertEqual([6])\n\nBelt.Set.diff(s1,s0)\n->Belt.Set.toArray\n->assertEqual([1,4])\n```"
],
"signature": "let diff: (t<'value, 'id>, t<'value, 'id>) => t<'value, 'id>"
},
@@ -6893,7 +7035,7 @@
"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```"
+ "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.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)\n\nBelt.Set.subset(s2, s0)->assertEqual(true)\nBelt.Set.subset(s2, s1)->assertEqual(true)\nBelt.Set.subset(s1, s0)->assertEqual(false)\n```"
],
"signature": "let subset: (t<'value, 'id>, t<'value, 'id>) => bool"
},
@@ -6911,7 +7053,7 @@
"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```"
+ "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.fromArray([5,2,3], ~id=module(IntCmp))\nlet s1 = Belt.Set.fromArray([3,2,5], ~id=module(IntCmp))\n\nBelt.Set.eq(s0, s1)->assertEqual(true)\n```"
],
"signature": "let eq: (t<'value, 'id>, t<'value, 'id>) => bool"
},
@@ -6922,14 +7064,15 @@
"docstrings": [
"Same as [forEach](#forEach) but takes uncurried functon."
],
- "signature": "let forEachU: (t<'value, 'id>, 'value => unit) => unit"
+ "signature": "let forEachU: (t<'value, 'id>, 'value => unit) => unit",
+ "deprecated": "Use `forEach` instead"
},
{
"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```"
+ "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.fromArray([5,2,3,5,6], ~id=module(IntCmp))\n\nlet acc = ref(list{})\n\ns0->Belt.Set.forEach(x => {\n acc := Belt.List.add(acc.contents, x)\n})\n\nacc.contents->assertEqual(list{6,5,3,2})\n```"
],
"signature": "let forEach: (t<'value, 'id>, 'value => unit) => unit"
},
@@ -6938,14 +7081,15 @@
"kind": "value",
"name": "reduceU",
"docstrings": [],
- "signature": "let reduceU: (t<'value, 'id>, 'a, ('a, 'value) => 'a) => 'a"
+ "signature": "let reduceU: (t<'value, 'id>, 'a, ('a, 'value) => 'a) => 'a",
+ "deprecated": "Use `reduce` instead"
},
{
"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```"
+ "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.fromArray([5,2,3,5,6], ~id=module(IntCmp))\ns0\n->Belt.Set.reduce(list{}, (acc, element) =>\n acc->Belt.List.add(element)\n)->assertEqual(list{6,5,3,2})\n```"
],
"signature": "let reduce: (t<'value, 'id>, 'a, ('a, 'value) => 'a) => 'a"
},
@@ -6954,14 +7098,15 @@
"kind": "value",
"name": "everyU",
"docstrings": [],
- "signature": "let everyU: (t<'value, 'id>, 'value => bool) => bool"
+ "signature": "let everyU: (t<'value, 'id>, 'value => bool) => bool",
+ "deprecated": "Use `every` instead"
},
{
"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```"
+ "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.fromArray([2,4,6,8], ~id=module(IntCmp))\ns0->Belt.Set.every(isEven)->assertEqual(true)\n```"
],
"signature": "let every: (t<'value, 'id>, 'value => bool) => bool"
},
@@ -6970,14 +7115,15 @@
"kind": "value",
"name": "someU",
"docstrings": [],
- "signature": "let someU: (t<'value, 'id>, 'value => bool) => bool"
+ "signature": "let someU: (t<'value, 'id>, 'value => bool) => bool",
+ "deprecated": "Use `some` instead"
},
{
"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```"
+ "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.fromArray([1,2,4,6,8], ~id=module(IntCmp))\ns0->Belt.Set.some(isOdd)->assertEqual(true)\n```"
],
"signature": "let some: (t<'value, 'id>, 'value => bool) => bool"
},
@@ -6986,14 +7132,15 @@
"kind": "value",
"name": "keepU",
"docstrings": [],
- "signature": "let keepU: (t<'value, 'id>, 'value => bool) => t<'value, 'id>"
+ "signature": "let keepU: (t<'value, 'id>, 'value => bool) => t<'value, 'id>",
+ "deprecated": "Use `keep` instead"
},
{
"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```"
+ "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.fromArray([1,2,3,4,5], ~id=module(IntCmp))\nlet s1 = s0->Belt.Set.keep(isEven)\n\ns1->Belt.Set.toArray->assertEqual([2, 4])\n```"
],
"signature": "let keep: (t<'value, 'id>, 'value => bool) => t<'value, 'id>"
},
@@ -7002,14 +7149,15 @@
"kind": "value",
"name": "partitionU",
"docstrings": [],
- "signature": "let partitionU: (\n t<'value, 'id>,\n 'value => bool,\n) => (t<'value, 'id>, t<'value, 'id>)"
+ "signature": "let partitionU: (\n t<'value, 'id>,\n 'value => bool,\n) => (t<'value, 'id>, t<'value, 'id>)",
+ "deprecated": "Use `partition` instead"
},
{
"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```"
+ "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.fromArray([1,2,3,4,5], ~id=module(IntCmp))\nlet (s1, s2) = s0->Belt.Set.partition(isOdd)\n\ns1->Belt.Set.toArray->assertEqual([1,3,5])\ns2->Belt.Set.toArray->assertEqual([2,4])\n```"
],
"signature": "let partition: (\n t<'value, 'id>,\n 'value => bool,\n) => (t<'value, 'id>, t<'value, 'id>)"
},
@@ -7018,7 +7166,7 @@
"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```"
+ "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.fromArray([1,2,3,4], ~id=module(IntCmp))\n\ns0->Belt.Set.size->assertEqual(4)\n```"
],
"signature": "let size: t<'value, 'id> => int"
},
@@ -7027,7 +7175,7 @@
"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```"
+ "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.fromArray([3,2,1,5], ~id=module(IntCmp))\n\ns0->Belt.Set.toArray->assertEqual([1,2,3,5])\n```"
],
"signature": "let toArray: t<'value, 'id> => array<'value>"
},
@@ -7036,7 +7184,7 @@
"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```"
+ "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.fromArray([3,2,1,5], ~id=module(IntCmp))\n\ns0->Belt.Set.toList->assertEqual(list{1,2,3,5})\n```"
],
"signature": "let toList: t<'value, 'id> => list<'value>"
},
@@ -7045,7 +7193,7 @@
"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```"
+ "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.make(~id=module(IntCmp))\nlet s1 = Belt.Set.fromArray([3,2,1,5], ~id=module(IntCmp))\n\ns0->Belt.Set.minimum->assertEqual(None)\ns1->Belt.Set.minimum->assertEqual(Some(1))\n```"
],
"signature": "let minimum: t<'value, 'id> => option<'value>"
},
@@ -7054,7 +7202,7 @@
"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```"
+ "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.make(~id=module(IntCmp))\nlet s1 = Belt.Set.fromArray([3,2,1,5], ~id=module(IntCmp))\n\ns0->Belt.Set.minUndefined->Js.Undefined.toOption->assertEqual(None)\ns1->Belt.Set.minUndefined->Js.Undefined.toOption->assertEqual(Some(1))\n```"
],
"signature": "let minUndefined: t<'value, 'id> => Js.undefined<'value>"
},
@@ -7063,7 +7211,7 @@
"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```"
+ "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.make(~id=module(IntCmp))\nlet s1 = Belt.Set.fromArray([3,2,1,5], ~id=module(IntCmp))\n\ns0->Belt.Set.maximum->assertEqual(None)\ns1->Belt.Set.maximum->assertEqual(Some(5))\n```"
],
"signature": "let maximum: t<'value, 'id> => option<'value>"
},
@@ -7072,7 +7220,7 @@
"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```"
+ "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.make(~id=module(IntCmp))\nlet s1 = Belt.Set.fromArray([3,2,1,5], ~id=module(IntCmp))\n\ns0\n->Belt.Set.maxUndefined\n->Js.Undefined.toOption\n->assertEqual(None)\n\ns1\n->Belt.Set.maxUndefined\n->Js.Undefined.toOption\n->assertEqual(Some(5))\n```"
],
"signature": "let maxUndefined: t<'value, 'id> => Js.undefined<'value>"
},
@@ -7081,7 +7229,7 @@
"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```"
+ "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.Set.fromArray([1,2,3,4,5], ~id=module(IntCmp))\n\ns0->Belt.Set.get(3)->assertEqual(Some(3))\ns0->Belt.Set.get(20)->assertEqual(None)\n```"
],
"signature": "let get: (t<'value, 'id>, 'value) => option<'value>"
},
@@ -7108,7 +7256,7 @@
"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```"
+ "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.fromArray([1, 2, 3, 4, 5], ~id=module(IntCmp))\n\nlet ((smaller, larger), present) = s0->Belt.Set.split(3)\n\npresent->assertEqual(true)\nsmaller->Belt.Set.toArray->assertEqual([1,2])\nlarger->Belt.Set.toArray->assertEqual([4,5])\n```"
],
"signature": "let split: (\n t<'value, 'id>,\n 'value,\n) => ((t<'value, 'id>, t<'value, 'id>), bool)"
},
@@ -7163,7 +7311,8 @@
"kind": "value",
"name": "forEachU",
"docstrings": [],
- "signature": "let forEachU: (int, int, int => unit) => unit"
+ "signature": "let forEachU: (int, int, int => unit) => unit",
+ "deprecated": "Use `forEach` instead"
},
{
"id": "Belt.Range.forEach",
@@ -7179,14 +7328,15 @@
"kind": "value",
"name": "everyU",
"docstrings": [],
- "signature": "let everyU: (int, int, int => bool) => bool"
+ "signature": "let everyU: (int, int, int => bool) => bool",
+ "deprecated": "Use `every` instead"
},
{
"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```"
+ "`every(start, finish, p)` equivalent to `Belt.Array.every(Belt.Array.range(start, finish), p)`\n## Examples\n\n```rescript\nassertEqual(Belt.Range.every(0, 4, (i) => i < 5), true)\n\nassertEqual(Belt.Range.every(0, 4, (i) => i < 4), false)\n```"
],
"signature": "let every: (int, int, int => bool) => bool"
},
@@ -7195,14 +7345,15 @@
"kind": "value",
"name": "everyByU",
"docstrings": [],
- "signature": "let everyByU: (int, int, ~step: int, int => bool) => bool"
+ "signature": "let everyByU: (int, int, ~step: int, int => bool) => bool",
+ "deprecated": "Use `everyBy` instead"
},
{
"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```"
+ "`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\nassertEqual(Belt.Range.everyBy(0, 4, ~step=1, (i) => mod(i, 2) === 0), false)\n\nassertEqual(Belt.Range.everyBy(0, 4, ~step=2, (i) => mod(i, 2) === 0), true)\n```"
],
"signature": "let everyBy: (int, int, ~step: int, int => bool) => bool"
},
@@ -7211,14 +7362,15 @@
"kind": "value",
"name": "someU",
"docstrings": [],
- "signature": "let someU: (int, int, int => bool) => bool"
+ "signature": "let someU: (int, int, int => bool) => bool",
+ "deprecated": "Use `some` instead"
},
{
"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```"
+ "`some(start, finish, p)` equivalent to `Belt.Array.some(Belt.Array.range(start, finish), p)`\n\n## Examples\n\n```rescript\nassertEqual(Belt.Range.some(0, 4, (i) => i > 5), false)\n\nassertEqual(Belt.Range.some(0, 4, (i) => i > 2), true)\n```"
],
"signature": "let some: (int, int, int => bool) => bool"
},
@@ -7227,14 +7379,15 @@
"kind": "value",
"name": "someByU",
"docstrings": [],
- "signature": "let someByU: (int, int, ~step: int, int => bool) => bool"
+ "signature": "let someByU: (int, int, ~step: int, int => bool) => bool",
+ "deprecated": "Use `someBy` instead"
},
{
"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```"
+ "`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\nassertEqual(Belt.Range.someBy(1, 5, ~step=2, (i) => mod(i, 2) === 0), false)\nassertEqual(Belt.Range.someBy(0, 4, ~step=2, (i) => mod(i, 2) === 0), true)\n```"
],
"signature": "let someBy: (int, int, ~step: int, int => bool) => bool"
}
@@ -7262,7 +7415,7 @@
"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```"
+ "Returns the length of a list.\n\n## Examples\n\n```rescript\nassertEqual(Belt.List.length(list{1, 2, 3}), 3)\n```"
],
"signature": "let length: t<'a> => int"
},
@@ -7280,7 +7433,7 @@
"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```"
+ "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\nassertEqual(Belt.List.head(list{}), None)\nassertEqual(Belt.List.head(list{1, 2, 3}), Some(1))\n```"
],
"signature": "let head: t<'a> => option<'a>"
},
@@ -7289,7 +7442,7 @@
"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```"
+ "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})->assertEqual(1)\n\nswitch Belt.List.headExn(list{}) { // Raises an Error\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```"
],
"signature": "let headExn: t<'a> => 'a"
},
@@ -7298,7 +7451,7 @@
"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```"
+ "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\nassertEqual(Belt.List.tail(list{1, 2, 3}), Some(list{2, 3}))\n\nassertEqual(Belt.List.tail(list{}), None)\n```"
],
"signature": "let tail: t<'a> => option>"
},
@@ -7307,7 +7460,7 @@
"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```"
+ "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})->assertEqual(list{2, 3})\n\nswitch Belt.List.tailExn(list{}) { // Raises an Error\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```"
],
"signature": "let tailExn: t<'a> => t<'a>"
},
@@ -7316,7 +7469,7 @@
"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```"
+ "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\nassertEqual(Belt.List.add(list{\"World\", \"!\"}, \"Hello\"), list{\"Hello\", \"World\", \"!\"})\n```"
],
"signature": "let add: (t<'a>, 'a) => t<'a>"
},
@@ -7325,7 +7478,7 @@
"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```"
+ "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\nassertEqual(abc->Belt.List.get(1), Some(\"B\"))\n\nassertEqual(abc->Belt.List.get(4), None)\n```"
],
"signature": "let get: (t<'a>, int) => option<'a>"
},
@@ -7334,7 +7487,7 @@
"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```"
+ "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)->assertEqual(\"B\")\n\nswitch abc->Belt.List.getExn(4) { // Raises an Error\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```"
],
"signature": "let getExn: (t<'a>, int) => 'a"
},
@@ -7343,7 +7496,7 @@
"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```"
+ "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\nassertEqual(Belt.List.make(3, 1), list{1, 1, 1})\n```"
],
"signature": "let make: (int, 'a) => t<'a>"
},
@@ -7354,14 +7507,15 @@
"docstrings": [
"Uncurried version of [makeBy](#makeBy)"
],
- "signature": "let makeByU: (int, int => 'a) => t<'a>"
+ "signature": "let makeByU: (int, int => 'a) => t<'a>",
+ "deprecated": "Use `makeBy` instead"
},
{
"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```"
+ "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\nassertEqual(Belt.List.makeBy(5, i => i), list{0, 1, 2, 3, 4})\n\nassertEqual(Belt.List.makeBy(5, i => i * i), list{0, 1, 4, 9, 16})\n```"
],
"signature": "let makeBy: (int, int => 'a) => t<'a>"
},
@@ -7379,7 +7533,7 @@
"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```"
+ "Return a new list, dropping the first `n` elements. Returns `None` if `someList` has fewer than `n` elements.\n\n## Examples\n\n```rescript\nassertEqual(list{1, 2, 3}->Belt.List.drop(2), Some(list{3}))\n\nassertEqual(list{1, 2, 3}->Belt.List.drop(3), Some(list{}))\n\nassertEqual(list{1, 2, 3}->Belt.List.drop(4), None)\n```"
],
"signature": "let drop: (t<'a>, int) => option>"
},
@@ -7388,7 +7542,7 @@
"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```"
+ "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\nassertEqual(list{1, 2, 3}->Belt.List.take(1), Some(list{1}))\n\nassertEqual(list{1, 2, 3}->Belt.List.take(2), Some(list{1, 2}))\n\nassertEqual(list{1, 2, 3}->Belt.List.take(4), None)\n```"
],
"signature": "let take: (t<'a>, int) => option>"
},
@@ -7397,7 +7551,7 @@
"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```"
+ "Split the list `someList` at `index`. Returns `None` when the length of `someList` is less than `index`.\n\n## Examples\n\n```rescript\nassertEqual(list{\"Hello\", \"World\"}->Belt.List.splitAt(1), Some((list{\"Hello\"}, list{\"World\"})))\n\nassertEqual(list{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>)>"
},
@@ -7406,7 +7560,7 @@
"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```"
+ "Returns the list obtained by adding `secondList` after `firstList`.\n\n## Examples\n\n```rescript\nassertEqual(Belt.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>"
},
@@ -7415,7 +7569,7 @@
"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```"
+ "Returns the list obtained by concatenating all the lists in array `a`, in\norder.\n\n## Examples\n\n```rescript\nassertEqual(Belt.List.concatMany([list{1, 2, 3}, list{}, list{3}]), list{1, 2, 3, 3})\n```"
],
"signature": "let concatMany: array> => t<'a>"
},
@@ -7424,7 +7578,7 @@
"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```"
+ "Equivalent to writing: `concat(reverse(firstList, secondList)`\n\n## Examples\n\n```rescript\nassertEqual(Belt.List.reverseConcat(list{1, 2}, list{3, 4}), list{2, 1, 3, 4})\n```"
],
"signature": "let reverseConcat: (t<'a>, t<'a>) => t<'a>"
},
@@ -7433,7 +7587,7 @@
"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```"
+ "Return the list obtained by concatenating all the lists in list `ls`, in order.\n\n## Examples\n\n```rescript\nassertEqual(Belt.List.flatten(list{list{1, 2, 3}, list{}, list{3}}), list{1, 2, 3, 3})\n```"
],
"signature": "let flatten: t> => t<'a>"
},
@@ -7444,14 +7598,15 @@
"docstrings": [
"Uncurried version of [map](#map)."
],
- "signature": "let mapU: (t<'a>, 'a => 'b) => t<'b>"
+ "signature": "let mapU: (t<'a>, 'a => 'b) => t<'b>",
+ "deprecated": "Use `map` instead"
},
{
"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```"
+ "Returns a new list with `f` applied to each element of `someList`.\n\n## Examples\n\n```rescript\nassertEqual(list{1, 2}->Belt.List.map(x => x + 1), list{2, 3})\n```"
],
"signature": "let map: (t<'a>, 'a => 'b) => t<'b>"
},
@@ -7460,7 +7615,7 @@
"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```"
+ "Returns a list of pairs from the two lists with the length of the shorter list.\n\n## Examples\n\n```rescript\nassertEqual(Belt.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)>"
},
@@ -7471,14 +7626,15 @@
"docstrings": [
"Uncurried version of [zipBy](#zipBy)."
],
- "signature": "let zipByU: (t<'a>, t<'b>, ('a, 'b) => 'c) => t<'c>"
+ "signature": "let zipByU: (t<'a>, t<'b>, ('a, 'b) => 'c) => t<'c>",
+ "deprecated": "Use `zipBy` instead"
},
{
"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```"
+ "See [Belt.List.zip](#zip)\n\n## Examples\n\n```rescript\nassertEqual(Belt.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>"
},
@@ -7489,14 +7645,15 @@
"docstrings": [
"Uncurried version of [mapWithIndex](#mapWithIndex)."
],
- "signature": "let mapWithIndexU: (t<'a>, (int, 'a) => 'b) => t<'b>"
+ "signature": "let mapWithIndexU: (t<'a>, (int, 'a) => 'b) => t<'b>",
+ "deprecated": "Use `mapWithIndex` instead"
},
{
"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```"
+ "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\nassertEqual(list{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>"
},
@@ -7505,7 +7662,7 @@
"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```"
+ "Converts the given array to a list.\n\n## Examples\n\n```rescript\nassertEqual(Belt.List.fromArray([1, 2, 3]), list{1, 2, 3})\n```"
],
"signature": "let fromArray: array<'a> => t<'a>"
},
@@ -7514,7 +7671,7 @@
"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```"
+ "Converts the given list to an array.\n\n## Examples\n\n```rescript\nassertEqual(Belt.List.toArray(list{1, 2, 3}), [1, 2, 3])\n```"
],
"signature": "let toArray: t<'a> => array<'a>"
},
@@ -7523,7 +7680,7 @@
"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```"
+ "Returns a new list whose elements are those of `someList` in reversed order.\n\n## Examples\n\n```rescript\nassertEqual(Belt.List.reverse(list{1, 2, 3}), list{3, 2, 1})\n```"
],
"signature": "let reverse: t<'a> => t<'a>"
},
@@ -7534,14 +7691,15 @@
"docstrings": [
"Uncurried version of [mapReverse](#mapReverse)."
],
- "signature": "let mapReverseU: (t<'a>, 'a => 'b) => t<'b>"
+ "signature": "let mapReverseU: (t<'a>, 'a => 'b) => t<'b>",
+ "deprecated": "Use `mapReverse` instead"
},
{
"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```"
+ "Equivalent to `Belt.List.map(someList, f)->Belt.List.reverse`\n\n## Examples\n\n```rescript\nlist{3, 4, 5}\n->Belt.List.mapReverse(x => x * x)\n->assertEqual(list{25, 16, 9})\n```"
],
"signature": "let mapReverse: (t<'a>, 'a => 'b) => t<'b>"
},
@@ -7552,7 +7710,8 @@
"docstrings": [
"Uncurried version of [forEach](#forEach)."
],
- "signature": "let forEachU: (t<'a>, 'a => 'b) => unit"
+ "signature": "let forEachU: (t<'a>, 'a => 'b) => unit",
+ "deprecated": "Use `forEach` instead"
},
{
"id": "Belt.List.forEach",
@@ -7570,7 +7729,8 @@
"docstrings": [
"Uncurried version of [forEachWithIndex](#forEachWithIndex)."
],
- "signature": "let forEachWithIndexU: (t<'a>, (int, 'a) => 'b) => unit"
+ "signature": "let forEachWithIndexU: (t<'a>, (int, 'a) => 'b) => unit",
+ "deprecated": "Use `forEachWithIndex` instead"
},
{
"id": "Belt.List.forEachWithIndex",
@@ -7588,14 +7748,15 @@
"docstrings": [
"Uncurried version of [reduce](#reduce)."
],
- "signature": "let reduceU: (t<'a>, 'b, ('b, 'a) => 'b) => 'b"
+ "signature": "let reduceU: (t<'a>, 'b, ('b, 'a) => 'b) => 'b",
+ "deprecated": "Use `reduce` instead"
},
{
"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```"
+ "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\nassertEqual(list{1, 2, 3, 4}->Belt.List.reduce(0, (a, b) => a + b), 10)\n\n/* same as */\n\nassertEqual(list{1, 2, 3, 4}->Belt.List.reduce(0, (acc, item) => acc + item), 10)\n```"
],
"signature": "let reduce: (t<'a>, 'b, ('b, 'a) => 'b) => 'b"
},
@@ -7606,14 +7767,15 @@
"docstrings": [
"Uncurried version of [reduceWithIndex](#reduceWithIndex)."
],
- "signature": "let reduceWithIndexU: (t<'a>, 'b, ('b, 'a, int) => 'b) => 'b"
+ "signature": "let reduceWithIndexU: (t<'a>, 'b, ('b, 'a, int) => 'b) => 'b",
+ "deprecated": "Use `reduceWithIndex` instead"
},
{
"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```"
+ "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\nassertEqual(\n list{1, 2, 3, 4}->Belt.List.reduceWithIndex(0, (acc, item, index) => acc + item + index),\n 16\n)\n```"
],
"signature": "let reduceWithIndex: (t<'a>, 'b, ('b, 'a, int) => 'b) => 'b"
},
@@ -7624,14 +7786,15 @@
"docstrings": [
"Uncurried version of [reduceReverse](#reduceReverse)."
],
- "signature": "let reduceReverseU: (t<'a>, 'b, ('b, 'a) => 'b) => 'b"
+ "signature": "let reduceReverseU: (t<'a>, 'b, ('b, 'a) => 'b) => 'b",
+ "deprecated": "Use `reduceReverse` instead"
},
{
"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```"
+ "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\nassertEqual(list{1, 2, 3, 4}->Belt.List.reduceReverse(0, (a, b) => a + b), 10)\n\nassertEqual(list{1, 2, 3, 4}->Belt.List.reduceReverse(10, (a, b) => a - b), 0)\n\nassertEqual(list{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"
},
@@ -7642,14 +7805,15 @@
"docstrings": [
"Uncurried version of [mapReverse2](#mapReverse2)."
],
- "signature": "let mapReverse2U: (t<'a>, t<'b>, ('a, 'b) => 'c) => t<'c>"
+ "signature": "let mapReverse2U: (t<'a>, t<'b>, ('a, 'b) => 'c) => t<'c>",
+ "deprecated": "Use `mapReverse2` instead"
},
{
"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```"
+ "Equivalent to: `zipBy(xs, ys, f)->reverse`\n\n## Examples\n\n```rescript\nassertEqual(Belt.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>"
},
@@ -7660,7 +7824,8 @@
"docstrings": [
"Uncurried version of [forEach2](#forEach2)."
],
- "signature": "let forEach2U: (t<'a>, t<'b>, ('a, 'b) => 'c) => unit"
+ "signature": "let forEach2U: (t<'a>, t<'b>, ('a, 'b) => 'c) => unit",
+ "deprecated": "Use `forEach2` instead"
},
{
"id": "Belt.List.forEach2",
@@ -7678,14 +7843,15 @@
"docstrings": [
"Uncurried version of [reduce2](#reduce2)."
],
- "signature": "let reduce2U: (t<'b>, t<'c>, 'a, ('a, 'b, 'c) => 'a) => 'a"
+ "signature": "let reduce2U: (t<'b>, t<'c>, 'a, ('a, 'b, 'c) => 'a) => 'a",
+ "deprecated": "Use `reduce2` instead"
},
{
"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```"
+ "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\nassertEqual(\n Belt.List.reduce2(list{1, 2, 3}, list{4, 5}, 0, (acc, x, y) => acc + x * x + y),\n 0 + (1 * 1 + 4) + (2 * 2 + 5)\n)\n```"
],
"signature": "let reduce2: (t<'b>, t<'c>, 'a, ('a, 'b, 'c) => 'a) => 'a"
},
@@ -7696,14 +7862,15 @@
"docstrings": [
"Uncurried version of [reduceReverse2](#reduceReverse2)."
],
- "signature": "let reduceReverse2U: (t<'a>, t<'b>, 'c, ('c, 'a, 'b) => 'c) => 'c"
+ "signature": "let reduceReverse2U: (t<'a>, t<'b>, 'c, ('c, 'a, 'b) => 'c) => 'c",
+ "deprecated": "Use `reduceReverse2` instead"
},
{
"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```"
+ "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\nassertEqual(\n Belt.List.reduceReverse2(list{1, 2, 3}, list{4, 5}, 0, (acc, x, y) => acc + x * x + y),\n 0 + (1 * 1 + 4) + (2 * 2 + 5)\n)\n```"
],
"signature": "let reduceReverse2: (t<'a>, t<'b>, 'c, ('c, 'a, 'b) => 'c) => 'c"
},
@@ -7714,14 +7881,15 @@
"docstrings": [
"Uncurried version of [every](#every)."
],
- "signature": "let everyU: (t<'a>, 'a => bool) => bool"
+ "signature": "let everyU: (t<'a>, 'a => bool) => bool",
+ "deprecated": "Use `every` instead"
},
{
"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```"
+ "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\nassertEqual(list{1, 9, 8, 2}->Belt.List.every(isBelow10), true)\n\nassertEqual(list{1, 99, 8, 2}->Belt.List.every(isBelow10), false)\n```"
],
"signature": "let every: (t<'a>, 'a => bool) => bool"
},
@@ -7732,14 +7900,15 @@
"docstrings": [
"Uncurried version of [some](#some)."
],
- "signature": "let someU: (t<'a>, 'a => bool) => bool"
+ "signature": "let someU: (t<'a>, 'a => bool) => bool",
+ "deprecated": "Use `some` instead"
},
{
"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```"
+ "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\nassertEqual(list{101, 1, 2, 3}->Belt.List.some(isAbove100), true)\n\nassertEqual(list{1, 2, 3, 4}->Belt.List.some(isAbove100), false)\n```"
],
"signature": "let some: (t<'a>, 'a => bool) => bool"
},
@@ -7750,14 +7919,15 @@
"docstrings": [
"Uncurried version of [every2](#every2)."
],
- "signature": "let every2U: (t<'a>, t<'b>, ('a, 'b) => bool) => bool"
+ "signature": "let every2U: (t<'a>, t<'b>, ('a, 'b) => bool) => bool",
+ "deprecated": "Use `every2` instead"
},
{
"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```"
+ "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\nassertEqual(Belt.List.every2(list{1, 2, 3}, list{0, 1}, (a, b) => a > b), true)\n\nassertEqual(Belt.List.every2(list{}, list{1}, (a, b) => a > b), true)\n\nassertEqual(Belt.List.every2(list{2, 3}, list{1}, (a, b) => a > b), true)\n\nassertEqual(Belt.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"
},
@@ -7768,14 +7938,15 @@
"docstrings": [
"Uncurried version of [some2](#some2)."
],
- "signature": "let some2U: (t<'a>, t<'b>, ('a, 'b) => bool) => bool"
+ "signature": "let some2U: (t<'a>, t<'b>, ('a, 'b) => bool) => bool",
+ "deprecated": "Use `some2` instead"
},
{
"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```"
+ "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\nassertEqual(Belt.List.some2(list{1, 2, 3}, list{0, 1}, (a, b) => a > b), true)\n\nassertEqual(Belt.List.some2(list{}, list{1}, (a, b) => a > b), false)\n\nassertEqual(Belt.List.some2(list{2, 3}, list{1}, (a, b) => a > b), true)\n\nassertEqual(Belt.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"
},
@@ -7784,7 +7955,7 @@
"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```"
+ "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\nassertEqual(Belt.List.cmpByLength(list{1, 2}, list{3, 4, 5, 6}), -1)\n\nassertEqual(Belt.List.cmpByLength(list{1, 2, 3}, list{4, 5, 6}), 0)\n\nassertEqual(Belt.List.cmpByLength(list{1, 2, 3, 4}, list{5, 6}), 1)\n```"
],
"signature": "let cmpByLength: (t<'a>, t<'a>) => int"
},
@@ -7795,14 +7966,15 @@
"docstrings": [
"Uncurried version of [cmp](#cmp)."
],
- "signature": "let cmpU: (t<'a>, t<'a>, ('a, 'a) => int) => int"
+ "signature": "let cmpU: (t<'a>, t<'a>, ('a, 'a) => int) => int",
+ "deprecated": "Use `cmp` instead"
},
{
"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."
+ "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\nassertEqual(Belt.List.cmp(list{3}, list{3, 7}, (a, b) => compare(a, b)), (-1))\n\nassertEqual(Belt.List.cmp(list{5, 3}, list{5}, (a, b) => compare(a, b)), 1)\n\nassertEqual(Belt.List.cmp(list{1, 3, 5}, list{1, 4, 2}, (a, b) => compare(a, b)), (-1))\n\nassertEqual(Belt.List.cmp(list{1, 3, 5}, list{1, 2, 3}, (a, b) => compare(a, b)), 1)\n\nassertEqual(Belt.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"
},
@@ -7813,14 +7985,15 @@
"docstrings": [
"Uncurried version of [eq](#eq)."
],
- "signature": "let eqU: (t<'a>, t<'a>, ('a, 'a) => bool) => bool"
+ "signature": "let eqU: (t<'a>, t<'a>, ('a, 'a) => bool) => bool",
+ "deprecated": "Use `eq` instead"
},
{
"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```"
+ "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\nassertEqual(Belt.List.eq(list{1, 2, 3}, list{1, 2}, (a, b) => a == b), false)\n\nassertEqual(Belt.List.eq(list{1, 2}, list{1, 2}, (a, b) => a == b), true)\n\nassertEqual(Belt.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"
},
@@ -7831,14 +8004,15 @@
"docstrings": [
"Uncurried version of [has](#has)."
],
- "signature": "let hasU: (t<'a>, 'b, ('a, 'b) => bool) => bool"
+ "signature": "let hasU: (t<'a>, 'b, ('a, 'b) => bool) => bool",
+ "deprecated": "Use `has` instead"
},
{
"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```"
+ "Returns `true` if the list contains at least one element for which\n`eqFunction(x)` returns true.\n\n## Examples\n\n```rescript\nassertEqual(list{1, 2, 3}->Belt.List.has(2, (a, b) => a == b), true)\n\nassertEqual(list{1, 2, 3}->Belt.List.has(4, (a, b) => a == b), false)\n\nassertEqual(list{(-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"
},
@@ -7849,14 +8023,15 @@
"docstrings": [
"Uncurried version of [getBy](#getBy)."
],
- "signature": "let getByU: (t<'a>, 'a => bool) => option<'a>"
+ "signature": "let getByU: (t<'a>, 'a => bool) => option<'a>",
+ "deprecated": "Use `getBy` instead"
},
{
"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```"
+ "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\nassertEqual(Belt.List.getBy(list{1, 4, 3, 2}, x => x > 3), Some(4))\n\nassertEqual(Belt.List.getBy(list{1, 4, 3, 2}, x => x > 4), None)\n```"
],
"signature": "let getBy: (t<'a>, 'a => bool) => option<'a>"
},
@@ -7867,14 +8042,15 @@
"docstrings": [
"Uncurried version of [keep](#keep)."
],
- "signature": "let keepU: (t<'a>, 'a => bool) => t<'a>"
+ "signature": "let keepU: (t<'a>, 'a => bool) => t<'a>",
+ "deprecated": "Use `keep` instead"
},
{
"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```"
+ "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\nassertEqual(Belt.List.keep(list{1, 2, 3, 4}, isEven), list{2, 4})\n\nassertEqual(Belt.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>"
},
@@ -7883,7 +8059,7 @@
"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```"
+ "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\nassertEqual(Belt.List.filter(list{1, 2, 3, 4}, isEven), list{2, 4})\n\nassertEqual(Belt.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."
@@ -7895,14 +8071,15 @@
"docstrings": [
"Uncurried version of [keepWithIndex](#keepWithIndex)."
],
- "signature": "let keepWithIndexU: (t<'a>, ('a, int) => bool) => t<'a>"
+ "signature": "let keepWithIndexU: (t<'a>, ('a, int) => bool) => t<'a>",
+ "deprecated": "Use `keepWithIndex` instead"
},
{
"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```"
+ "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\nassertEqual(Belt.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>"
},
@@ -7911,7 +8088,7 @@
"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```"
+ "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\nassertEqual(Belt.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."
@@ -7923,14 +8100,15 @@
"docstrings": [
"Uncurried version of [keepMap](#keepMap)."
],
- "signature": "let keepMapU: (t<'a>, 'a => option<'b>) => t<'b>"
+ "signature": "let keepMapU: (t<'a>, 'a => option<'b>) => t<'b>",
+ "deprecated": "Use `keepMap` instead"
},
{
"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```"
+ "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\nassertEqual(list{Some(1), Some(2), None}->Belt.List.keepMap(x => x), list{1, 2})\n```"
],
"signature": "let keepMap: (t<'a>, 'a => option<'b>) => t<'b>"
},
@@ -7941,14 +8119,15 @@
"docstrings": [
"Uncurried version of [partition](#partition)."
],
- "signature": "let partitionU: (t<'a>, 'a => bool) => (t<'a>, t<'a>)"
+ "signature": "let partitionU: (t<'a>, 'a => bool) => (t<'a>, t<'a>)",
+ "deprecated": "Use `partition` instead"
},
{
"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```"
+ "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```\n(elementsThatSatisfies, elementsThatDoesNotSatisfy)\n```\n\n## Examples\n\n```rescript\nlist{1, 2, 3, 4}\n->Belt.List.partition(x => x > 2)\n->assertEqual((list{3, 4}, list{1, 2}))\n```"
],
"signature": "let partition: (t<'a>, 'a => bool) => (t<'a>, t<'a>)"
},
@@ -7957,7 +8136,7 @@
"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```"
+ "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\nassertEqual(Belt.List.unzip(list{(1, 2), (3, 4)}), (list{1, 3}, list{2, 4}))\n\nassertEqual(\n Belt.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)\n```"
],
"signature": "let unzip: t<('a, 'b)> => (t<'a>, t<'b>)"
},
@@ -7968,14 +8147,15 @@
"docstrings": [
"Uncurried version of [getAssoc](#getAssoc)."
],
- "signature": "let getAssocU: (t<('a, 'c)>, 'b, ('a, 'b) => bool) => option<'c>"
+ "signature": "let getAssocU: (t<('a, 'c)>, 'b, ('a, 'b) => bool) => option<'c>",
+ "deprecated": "Use `getAssoc` instead"
},
{
"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```"
+ "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\nassertEqual(\n list{(9, \"morning\"), (15, \"afternoon\"), (22, \"night\")}\n ->Belt.List.getAssoc(15, (k, item) => k /* 15 */ == item /* 9, 5, 22 */),\n Some(\"afternoon\")\n)\n```"
],
"signature": "let getAssoc: (t<('a, 'c)>, 'b, ('a, 'b) => bool) => option<'c>"
},
@@ -7986,14 +8166,15 @@
"docstrings": [
"Uncurried version of [hasAssoc](#hasAssoc)."
],
- "signature": "let hasAssocU: (t<('a, 'c)>, 'b, ('a, 'b) => bool) => bool"
+ "signature": "let hasAssocU: (t<('a, 'c)>, 'b, ('a, 'b) => bool) => bool",
+ "deprecated": "Use `hasAssoc` instead"
},
{
"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```"
+ "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\nassertEqual(\n list{(1, \"a\"), (2, \"b\"), (3, \"c\")}->Belt.List.hasAssoc(1, (a, b) => a == b),\n true\n)\n\nassertEqual(\n list{(9, \"morning\"), (15, \"afternoon\"), (22, \"night\")}->Belt.List.hasAssoc(25, (k, item) => k /* 25 */ == item /* 9, 5, 22 */),\n false\n)\n```"
],
"signature": "let hasAssoc: (t<('a, 'c)>, 'b, ('a, 'b) => bool) => bool"
},
@@ -8004,14 +8185,15 @@
"docstrings": [
"Uncurried version of [removeAssoc](#removeAssoc)."
],
- "signature": "let removeAssocU: (t<('a, 'c)>, 'b, ('a, 'b) => bool) => t<('a, 'c)>"
+ "signature": "let removeAssocU: (t<('a, 'c)>, 'b, ('a, 'b) => bool) => t<('a, 'c)>",
+ "deprecated": "Use `removeAssoc` instead"
},
{
"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```"
+ "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\nassertEqual(\n list{(1, \"a\"), (2, \"b\"), (3, \"c\")}->Belt.List.removeAssoc(1, (a, b) => a == b),\n list{(2, \"b\"), (3, \"c\")}\n)\n\nassertEqual(\n list{(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)\n```"
],
"signature": "let removeAssoc: (t<('a, 'c)>, 'b, ('a, 'b) => bool) => t<('a, 'c)>"
},
@@ -8022,14 +8204,15 @@
"docstrings": [
"Uncurried version of [setAssoc](#setAssoc)."
],
- "signature": "let setAssocU: (t<('a, 'c)>, 'a, 'c, ('a, 'a) => bool) => t<('a, 'c)>"
+ "signature": "let setAssocU: (t<('a, 'c)>, 'a, 'c, ('a, 'a) => bool) => t<('a, 'c)>",
+ "deprecated": "Use `setAssoc` instead"
},
{
"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."
+ "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\nassertEqual(\n list{(1, \"a\"), (2, \"b\"), (3, \"c\")}->Belt.List.setAssoc(2, \"x\", (a, b) => a == b),\n list{(1, \"a\"), (2, \"x\"), (3, \"c\")}\n)\n\nassertEqual(\n list{(1, \"a\"), (3, \"c\")}->Belt.List.setAssoc(2, \"b\", (a, b) => a == b),\n list{(2, \"b\"), (1, \"a\"), (3, \"c\")}\n)\n\nassertEqual(\n list{(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\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)>"
},
@@ -8040,14 +8223,15 @@
"docstrings": [
"Uncurried version of [sort](#sort)."
],
- "signature": "let sortU: (t<'a>, ('a, 'a) => int) => t<'a>"
+ "signature": "let sortU: (t<'a>, ('a, 'a) => int) => t<'a>",
+ "deprecated": "Use `sort` instead"
},
{
"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```"
+ "Returns a sorted list.\n\n## Examples\n\n```rescript\nassertEqual(\n Belt.List.sort(list{5, 4, 9, 3, 7}, (a, b) => a - b),\n list{3, 4, 5, 7, 9}\n)\n```"
],
"signature": "let sort: (t<'a>, ('a, 'a) => int) => t<'a>"
}
@@ -8149,7 +8333,8 @@
"kind": "value",
"name": "forEachU",
"docstrings": [],
- "signature": "let forEachU: (t<'a>, 'a => unit) => unit"
+ "signature": "let forEachU: (t<'a>, 'a => unit) => unit",
+ "deprecated": "Use `forEach` instead"
},
{
"id": "Belt.MutableStack.forEach",
@@ -8163,7 +8348,8 @@
"kind": "value",
"name": "dynamicPopIterU",
"docstrings": [],
- "signature": "let dynamicPopIterU: (t<'a>, 'a => unit) => unit"
+ "signature": "let dynamicPopIterU: (t<'a>, 'a => unit) => unit",
+ "deprecated": "Use `dynamicPopIter` instead"
},
{
"id": "Belt.MutableStack.dynamicPopIter",
@@ -8315,7 +8501,8 @@
"kind": "value",
"name": "mapU",
"docstrings": [],
- "signature": "let mapU: (t<'a>, 'a => 'b) => t<'b>"
+ "signature": "let mapU: (t<'a>, 'a => 'b) => t<'b>",
+ "deprecated": "Use `map` instead"
},
{
"id": "Belt.MutableQueue.map",
@@ -8329,7 +8516,8 @@
"kind": "value",
"name": "forEachU",
"docstrings": [],
- "signature": "let forEachU: (t<'a>, 'a => unit) => unit"
+ "signature": "let forEachU: (t<'a>, 'a => unit) => unit",
+ "deprecated": "Use `forEach` instead"
},
{
"id": "Belt.MutableQueue.forEach",
@@ -8345,7 +8533,8 @@
"kind": "value",
"name": "reduceU",
"docstrings": [],
- "signature": "let reduceU: (t<'a>, 'b, ('b, 'a) => 'b) => 'b"
+ "signature": "let reduceU: (t<'a>, 'b, ('b, 'a) => 'b) => 'b",
+ "deprecated": "Use `reduce` instead"
},
{
"id": "Belt.MutableQueue.reduce",
@@ -8389,14 +8578,15 @@
"kind": "value",
"name": "strictlySortedLengthU",
"docstrings": [],
- "signature": "let strictlySortedLengthU: (array<'a>, ('a, 'a) => bool) => int"
+ "signature": "let strictlySortedLengthU: (array<'a>, ('a, 'a) => bool) => int",
+ "deprecated": "Use `strictlySortedLength` instead"
},
{
"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```"
+ "`strictlySortedLenght(xs, cmp);` return `+n` means increasing order `-n` means negative order\n\n## Examples\n\n```rescript\nassertEqual(Belt.SortArray.strictlySortedLength([1, 2, 3, 4, 3], (x, y) => x < y), 4)\n\nassertEqual(Belt.SortArray.strictlySortedLength([], (x, y) => x < y), 0)\n\nassertEqual(Belt.SortArray.strictlySortedLength([1], (x, y) => x < y), 1)\n\nassertEqual(Belt.SortArray.strictlySortedLength([4, 3, 2, 1], (x, y) => x < y), -4)\n```"
],
"signature": "let strictlySortedLength: (array<'a>, ('a, 'a) => bool) => int"
},
@@ -8405,7 +8595,8 @@
"kind": "value",
"name": "isSortedU",
"docstrings": [],
- "signature": "let isSortedU: (array<'a>, ('a, 'a) => int) => bool"
+ "signature": "let isSortedU: (array<'a>, ('a, 'a) => int) => bool",
+ "deprecated": "Use `isSorted` instead"
},
{
"id": "Belt.SortArray.isSorted",
@@ -8421,7 +8612,8 @@
"kind": "value",
"name": "stableSortInPlaceByU",
"docstrings": [],
- "signature": "let stableSortInPlaceByU: (array<'a>, ('a, 'a) => int) => unit"
+ "signature": "let stableSortInPlaceByU: (array<'a>, ('a, 'a) => int) => unit",
+ "deprecated": "Use `stableSortInPlaceBy` instead"
},
{
"id": "Belt.SortArray.stableSortInPlaceBy",
@@ -8435,7 +8627,8 @@
"kind": "value",
"name": "stableSortByU",
"docstrings": [],
- "signature": "let stableSortByU: (array<'a>, ('a, 'a) => int) => array<'a>"
+ "signature": "let stableSortByU: (array<'a>, ('a, 'a) => int) => array<'a>",
+ "deprecated": "Use `stableSortBy` instead"
},
{
"id": "Belt.SortArray.stableSortBy",
@@ -8451,14 +8644,15 @@
"kind": "value",
"name": "binarySearchByU",
"docstrings": [],
- "signature": "let binarySearchByU: (array<'a>, 'a, ('a, 'a) => int) => int"
+ "signature": "let binarySearchByU: (array<'a>, 'a, ('a, 'a) => int) => int",
+ "deprecated": "Use `binarySearchBy` instead"
},
{
"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```"
+ "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\nassertEqual(Belt.SortArray.binarySearchBy([1, 2, 3, 4, 33, 35, 36], 33, Pervasives.compare), 4)\n\nassertEqual(lnot(Belt.SortArray.binarySearchBy([1, 3, 5, 7], 4, Pervasives.compare)), 2)\n```"
],
"signature": "let binarySearchBy: (array<'a>, 'a, ('a, 'a) => int) => int"
},
@@ -8467,7 +8661,8 @@
"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"
+ "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",
+ "deprecated": "Use `union` instead"
},
{
"id": "Belt.SortArray.union",
@@ -8483,7 +8678,8 @@
"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"
+ "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",
+ "deprecated": "Use `intersect` instead"
},
{
"id": "Belt.SortArray.intersect",
@@ -8499,7 +8695,8 @@
"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"
+ "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",
+ "deprecated": "Use `diff` instead"
},
{
"id": "Belt.SortArray.diff",
@@ -8530,7 +8727,7 @@
"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```"
+ "Return the size of the array\n\n## Examples\n\n```rescript\nassertEqual(Belt.Array.length([\"test\"]), 1)\n```"
],
"signature": "let length: t<'a> => int"
},
@@ -8548,7 +8745,7 @@
"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```"
+ "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\nassertEqual(Belt.Array.get([\"a\", \"b\", \"c\"], 0), Some(\"a\"))\nassertEqual(Belt.Array.get([\"a\", \"b\", \"c\"], 3), None)\nassertEqual(Belt.Array.get([\"a\", \"b\", \"c\"], -1), None)\n```"
],
"signature": "let get: (t<'a>, int) => option<'a>"
},
@@ -8627,7 +8824,7 @@
"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```"
+ "`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\nassertEqual(arr, [14, 13, 12, 11, 10])\n```"
],
"signature": "let reverseInPlace: t<'a> => unit"
},
@@ -8636,7 +8833,7 @@
"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```"
+ "`reverse(arr)` returns a fresh array with items in arr in reverse order.\n\n## Examples\n\n```rescript\nassertEqual(Belt.Array.reverse([10, 11, 12, 13, 14]), [14, 13, 12, 11, 10])\n```"
],
"signature": "let reverse: t<'a> => t<'a>"
},
@@ -8645,7 +8842,7 @@
"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```"
+ "`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\nassertEqual(Belt.Array.getExn(arr, 0), Js.undefined)\n```"
],
"signature": "let makeUninitialized: int => array>"
},
@@ -8654,7 +8851,7 @@
"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```"
+ "**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\nassertEqual(Belt.Array.getExn(arr, 0), \"example\")\n```"
],
"signature": "let makeUninitializedUnsafe: int => t<'a>"
},
@@ -8672,7 +8869,7 @@
"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```"
+ "`range(start, finish)` create an inclusive array.\n\n## Examples\n\n```rescript\nassertEqual(Belt.Array.range(0, 3), [0, 1, 2, 3])\n\nassertEqual(Belt.Array.range(3, 0), [])\n\nassertEqual(Belt.Array.range(3, 3), [3])\n```"
],
"signature": "let range: (int, int) => array"
},
@@ -8681,7 +8878,7 @@
"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```"
+ "`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\nassertEqual(Belt.Array.rangeBy(0, 10, ~step=3), [0, 3, 6, 9])\n\nassertEqual(Belt.Array.rangeBy(0, 12, ~step=3), [0, 3, 6, 9, 12])\n\nassertEqual(Belt.Array.rangeBy(33, 0, ~step=1), [])\n\nassertEqual(Belt.Array.rangeBy(33, 0, ~step=-1), [])\n\nassertEqual(Belt.Array.rangeBy(3, 12, ~step=-1), [])\n\nassertEqual(Belt.Array.rangeBy(3, 3, ~step=0), [])\n\nassertEqual(Belt.Array.rangeBy(3, 3, ~step=1), [3])\n```"
],
"signature": "let rangeBy: (int, int, ~step: int) => array"
},
@@ -8690,14 +8887,15 @@
"kind": "value",
"name": "makeByU",
"docstrings": [],
- "signature": "let makeByU: (int, int => 'a) => t<'a>"
+ "signature": "let makeByU: (int, int => 'a) => t<'a>",
+ "deprecated": "Use `makeBy` instead"
},
{
"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```"
+ "`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\nassertEqual(Belt.Array.makeBy(5, (i) => i), [0, 1, 2, 3, 4])\n\nassertEqual(Belt.Array.makeBy(5, (i) => i * i), [0, 1, 4, 9, 16])\n```"
],
"signature": "let makeBy: (int, int => 'a) => t<'a>"
},
@@ -8706,7 +8904,8 @@
"kind": "value",
"name": "makeByAndShuffleU",
"docstrings": [],
- "signature": "let makeByAndShuffleU: (int, int => 'a) => t<'a>"
+ "signature": "let makeByAndShuffleU: (int, int => 'a) => t<'a>",
+ "deprecated": "Use `makeByAndShuffle` instead"
},
{
"id": "Belt.Array.makeByAndShuffle",
@@ -8722,7 +8921,7 @@
"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```"
+ "`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\nassertEqual(Belt.Array.zip([1, 2], [3, 4, 5]), [(1, 3), (2, 4)])\n```"
],
"signature": "let zip: (t<'a>, array<'b>) => array<('a, 'b)>"
},
@@ -8731,14 +8930,15 @@
"kind": "value",
"name": "zipByU",
"docstrings": [],
- "signature": "let zipByU: (t<'a>, array<'b>, ('a, 'b) => 'c) => array<'c>"
+ "signature": "let zipByU: (t<'a>, array<'b>, ('a, 'b) => 'c) => array<'c>",
+ "deprecated": "Use `zipBy` instead"
},
{
"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```"
+ "`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\nassertEqual(Belt.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>"
},
@@ -8747,7 +8947,7 @@
"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```"
+ "`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\nassertEqual(Belt.Array.unzip([(1, 2), (3, 4)]), ([1, 3], [2, 4]))\n\nassertEqual(Belt.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>)"
},
@@ -8756,7 +8956,7 @@
"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```"
+ "`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\nassertEqual(Belt.Array.concat([1, 2, 3], [4, 5]), [1, 2, 3, 4, 5])\n\nassertEqual(Belt.Array.concat([], [\"a\", \"b\", \"c\"]), [\"a\", \"b\", \"c\"])\n```"
],
"signature": "let concat: (t<'a>, t<'a>) => t<'a>"
},
@@ -8765,7 +8965,7 @@
"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```"
+ "`concatMany(xss)` returns a fresh array as the concatenation of `xss` (an array of arrays)\n\n## Examples\n\n```rescript\nassertEqual(Belt.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>"
},
@@ -8774,7 +8974,7 @@
"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```"
+ "`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\nassertEqual(Belt.Array.slice([10, 11, 12, 13, 14, 15, 16], ~offset=2, ~len=3), [12, 13, 14])\n\nassertEqual(Belt.Array.slice([10, 11, 12, 13, 14, 15, 16], ~offset=-4, ~len=3), [13, 14, 15])\n\nassertEqual(Belt.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>"
},
@@ -8783,7 +8983,7 @@
"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```"
+ "`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\nassertEqual(Belt.Array.sliceToEnd([10, 11, 12, 13, 14, 15, 16], 2), [12, 13, 14, 15, 16])\n\nassertEqual(Belt.Array.sliceToEnd([10, 11, 12, 13, 14, 15, 16], -4), [13, 14, 15, 16])\n```"
],
"signature": "let sliceToEnd: (t<'a>, int) => t<'a>"
},
@@ -8801,7 +9001,7 @@
"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]"
+ "`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\nassertEqual(arr, [0, 1, 9, 9, 4])\n\nBelt.Array.fill(arr, ~offset=7, ~len=2, 8)\n\nassertEqual(arr, [0, 1, 9, 9, 4])\n```"
],
"signature": "let fill: (t<'a>, ~offset: int, ~len: int, 'a) => unit"
},
@@ -8810,7 +9010,7 @@
"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```"
+ "`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)\nassertEqual(v2, [20, 21, 14, 15, 16, 25, 26, 27])\n\nBelt.Array.blit(~src=v1, ~srcOffset=4, ~dst=v1, ~dstOffset=2, ~len=3)\nassertEqual(v1, [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"
},
@@ -8828,14 +9028,15 @@
"kind": "value",
"name": "forEachU",
"docstrings": [],
- "signature": "let forEachU: (t<'a>, 'a => unit) => unit"
+ "signature": "let forEachU: (t<'a>, 'a => unit) => unit",
+ "deprecated": "Use `forEach` instead"
},
{
"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```"
+ "`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\nassertEqual(total.contents, 1 + 2 + 3 + 4)\n```"
],
"signature": "let forEach: (t<'a>, 'a => unit) => unit"
},
@@ -8844,14 +9045,15 @@
"kind": "value",
"name": "mapU",
"docstrings": [],
- "signature": "let mapU: (t<'a>, 'a => 'b) => array<'b>"
+ "signature": "let mapU: (t<'a>, 'a => 'b) => array<'b>",
+ "deprecated": "Use `map` instead"
},
{
"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```"
+ "`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\nassertEqual(Belt.Array.map([1, 2], (x) => x + 1), [2, 3])\n```"
],
"signature": "let map: (t<'a>, 'a => 'b) => array<'b>"
},
@@ -8860,14 +9062,15 @@
"kind": "value",
"name": "flatMapU",
"docstrings": [],
- "signature": "let flatMapU: (t<'a>, 'a => array<'b>) => array<'b>"
+ "signature": "let flatMapU: (t<'a>, 'a => array<'b>) => array<'b>",
+ "deprecated": "Use `flatMap` instead"
},
{
"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```"
+ "`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\nassertEqual(Belt.Array.flatMap([1, 2], x => [x + 10, x + 20]), [11, 21, 12, 22])\n```"
],
"signature": "let flatMap: (t<'a>, 'a => array<'b>) => array<'b>"
},
@@ -8876,14 +9079,15 @@
"kind": "value",
"name": "getByU",
"docstrings": [],
- "signature": "let getByU: (t<'a>, 'a => bool) => option<'a>"
+ "signature": "let getByU: (t<'a>, 'a => bool) => option<'a>",
+ "deprecated": "Use `getBy` instead"
},
{
"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```"
+ "`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\nassertEqual(Belt.Array.getBy([1, 4, 3, 2], (x) => mod(x, 2) == 0), Some(4))\nassertEqual(Belt.Array.getBy([15, 13, 11], (x) => mod(x, 2) == 0), None)\n```"
],
"signature": "let getBy: (t<'a>, 'a => bool) => option<'a>"
},
@@ -8892,14 +9096,15 @@
"kind": "value",
"name": "getIndexByU",
"docstrings": [],
- "signature": "let getIndexByU: (t<'a>, 'a => bool) => option"
+ "signature": "let getIndexByU: (t<'a>, 'a => bool) => option",
+ "deprecated": "Use `getIndexBy` instead"
},
{
"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```"
+ "`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\nassertEqual(Belt.Array.getIndexBy([1, 4, 3, 2], (x) => mod(x, 2) == 0), Some(1))\nassertEqual(Belt.Array.getIndexBy([15, 13, 11], (x) => mod(x, 2) == 0), None)\n```"
],
"signature": "let getIndexBy: (t<'a>, 'a => bool) => option"
},
@@ -8908,7 +9113,8 @@
"kind": "value",
"name": "keepU",
"docstrings": [],
- "signature": "let keepU: (t<'a>, 'a => bool) => t<'a>"
+ "signature": "let keepU: (t<'a>, 'a => bool) => t<'a>",
+ "deprecated": "Use `keep` instead"
},
{
"id": "Belt.Array.keep",
@@ -8924,14 +9130,15 @@
"kind": "value",
"name": "keepWithIndexU",
"docstrings": [],
- "signature": "let keepWithIndexU: (t<'a>, ('a, int) => bool) => t<'a>"
+ "signature": "let keepWithIndexU: (t<'a>, ('a, int) => bool) => t<'a>",
+ "deprecated": "Use `keepWithIndex` instead"
},
{
"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```"
+ "`keepWithIndex(xs, p)` returns a new array that keep all elements satisfy `p`.\n\n## Examples\n\n```rescript\nassertEqual(Belt.Array.keepWithIndex([1, 2, 3], (_x, i) => i == 1), [2])\n```"
],
"signature": "let keepWithIndex: (t<'a>, ('a, int) => bool) => t<'a>"
},
@@ -8940,14 +9147,15 @@
"kind": "value",
"name": "keepMapU",
"docstrings": [],
- "signature": "let keepMapU: (t<'a>, 'a => option<'b>) => array<'b>"
+ "signature": "let keepMapU: (t<'a>, 'a => option<'b>) => array<'b>",
+ "deprecated": "Use `keepMap` instead"
},
{
"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```"
+ "`keepMap(xs, p)` returns a new array that keep all elements that return a non\nNone applied `p`.\n\n## Examples\n\n```rescript\nassertEqual(\n Belt.Array.keepMap([1, 2, 3], x =>\n if mod(x, 2) == 0 {\n Some(x)\n } else {\n None\n }\n ),\n [2]\n)\n```"
],
"signature": "let keepMap: (t<'a>, 'a => option<'b>) => array<'b>"
},
@@ -8956,14 +9164,15 @@
"kind": "value",
"name": "forEachWithIndexU",
"docstrings": [],
- "signature": "let forEachWithIndexU: (t<'a>, (int, 'a) => unit) => unit"
+ "signature": "let forEachWithIndexU: (t<'a>, (int, 'a) => unit) => unit",
+ "deprecated": "Use `forEachWithIndex` instead"
},
{
"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```"
+ "`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\nassertEqual(total.contents, 0 + 10 + 1 + 11 + 2 + 12 + 3 + 13)\n```"
],
"signature": "let forEachWithIndex: (t<'a>, (int, 'a) => unit) => unit"
},
@@ -8972,14 +9181,15 @@
"kind": "value",
"name": "mapWithIndexU",
"docstrings": [],
- "signature": "let mapWithIndexU: (t<'a>, (int, 'a) => 'b) => array<'b>"
+ "signature": "let mapWithIndexU: (t<'a>, (int, 'a) => 'b) => array<'b>",
+ "deprecated": "Use `mapWithIndex` instead"
},
{
"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```"
+ "`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\nassertEqual(Belt.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>"
},
@@ -8988,14 +9198,15 @@
"kind": "value",
"name": "partitionU",
"docstrings": [],
- "signature": "let partitionU: (t<'a>, 'a => bool) => (t<'a>, t<'a>)"
+ "signature": "let partitionU: (t<'a>, 'a => bool) => (t<'a>, t<'a>)",
+ "deprecated": "Use `partition` instead"
},
{
"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```"
+ "`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\nassertEqual(Belt.Array.partition([1, 2, 3, 4, 5], (x) => mod(x, 2) == 0), ([2, 4], [1, 3, 5]))\n\nassertEqual(Belt.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>)"
},
@@ -9004,14 +9215,15 @@
"kind": "value",
"name": "reduceU",
"docstrings": [],
- "signature": "let reduceU: (array<'b>, 'a, ('a, 'b) => 'a) => 'a"
+ "signature": "let reduceU: (array<'b>, 'a, ('a, 'b) => 'a) => 'a",
+ "deprecated": "Use `reduce` instead"
},
{
"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```"
+ "`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\nassertEqual(Belt.Array.reduce([2, 3, 4], 1, (a, b) => a + b), 10)\n\nassertEqual(Belt.Array.reduce([\"a\", \"b\", \"c\", \"d\"], \"\", (a, b) => a ++ b), \"abcd\")\n```"
],
"signature": "let reduce: (array<'b>, 'a, ('a, 'b) => 'a) => 'a"
},
@@ -9020,14 +9232,15 @@
"kind": "value",
"name": "reduceReverseU",
"docstrings": [],
- "signature": "let reduceReverseU: (array<'b>, 'a, ('a, 'b) => 'a) => 'a"
+ "signature": "let reduceReverseU: (array<'b>, 'a, ('a, 'b) => 'a) => 'a",
+ "deprecated": "Use `reduceReverse` instead"
},
{
"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```"
+ "`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\nassertEqual(Belt.Array.reduceReverse([\"a\", \"b\", \"c\", \"d\"], \"\", (a, b) => a ++ b), \"dcba\")\n```"
],
"signature": "let reduceReverse: (array<'b>, 'a, ('a, 'b) => 'a) => 'a"
},
@@ -9036,14 +9249,15 @@
"kind": "value",
"name": "reduceReverse2U",
"docstrings": [],
- "signature": "let reduceReverse2U: (t<'a>, array<'b>, 'c, ('c, 'a, 'b) => 'c) => 'c"
+ "signature": "let reduceReverse2U: (t<'a>, array<'b>, 'c, ('c, 'a, 'b) => 'c) => 'c",
+ "deprecated": "Use `reduceReverse2` instead"
},
{
"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```"
+ "`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\nassertEqual(Belt.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"
},
@@ -9052,14 +9266,15 @@
"kind": "value",
"name": "reduceWithIndexU",
"docstrings": [],
- "signature": "let reduceWithIndexU: (t<'a>, 'b, ('b, 'a, int) => 'b) => 'b"
+ "signature": "let reduceWithIndexU: (t<'a>, 'b, ('b, 'a, int) => 'b) => 'b",
+ "deprecated": "Use `reduceWithIndex` instead"
},
{
"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```"
+ "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\nassertEqual(Belt.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"
},
@@ -9068,14 +9283,15 @@
"kind": "value",
"name": "joinWithU",
"docstrings": [],
- "signature": "let joinWithU: (t<'a>, string, 'a => string) => string"
+ "signature": "let joinWithU: (t<'a>, string, 'a => string) => string",
+ "deprecated": "Use `joinWith` instead"
},
{
"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```"
+ "`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\nassertEqual(Belt.Array.joinWith([0, 1], \", \", Js.Int.toString), \"0, 1\")\nassertEqual(Belt.Array.joinWith([], \" \", Js.Int.toString), \"\")\nassertEqual(Belt.Array.joinWith([1], \" \", Js.Int.toString), \"1\")\n```"
],
"signature": "let joinWith: (t<'a>, string, 'a => string) => string"
},
@@ -9084,14 +9300,15 @@
"kind": "value",
"name": "someU",
"docstrings": [],
- "signature": "let someU: (t<'a>, 'a => bool) => bool"
+ "signature": "let someU: (t<'a>, 'a => bool) => bool",
+ "deprecated": "Use `some` instead"
},
{
"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```"
+ "`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\nassertEqual(Belt.Array.some([2, 3, 4], (x) => mod(x, 2) == 1), true)\n\nassertEqual(Belt.Array.some([(-1), (-3), (-5)], (x) => x > 0), false)\n```"
],
"signature": "let some: (t<'a>, 'a => bool) => bool"
},
@@ -9100,14 +9317,15 @@
"kind": "value",
"name": "everyU",
"docstrings": [],
- "signature": "let everyU: (t<'a>, 'a => bool) => bool"
+ "signature": "let everyU: (t<'a>, 'a => bool) => bool",
+ "deprecated": "Use `every` instead"
},
{
"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```"
+ "`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\nassertEqual(Belt.Array.every([1, 3, 5], (x) => mod(x, 2) == 1), true)\n\nassertEqual(Belt.Array.every([1, (-3), 5], (x) => x > 0), false)\n```"
],
"signature": "let every: (t<'a>, 'a => bool) => bool"
},
@@ -9116,14 +9334,15 @@
"kind": "value",
"name": "every2U",
"docstrings": [],
- "signature": "let every2U: (t<'a>, array<'b>, ('a, 'b) => bool) => bool"
+ "signature": "let every2U: (t<'a>, array<'b>, ('a, 'b) => bool) => bool",
+ "deprecated": "Use `every2` instead"
},
{
"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```"
+ "`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\nassertEqual(Belt.Array.every2([1, 2, 3], [0, 1], (a, b) => a > b), true)\n\nassertEqual(Belt.Array.every2([], [1], (x, y) => x > y), true)\n\nassertEqual(Belt.Array.every2([2, 3], [1], (x, y) => x > y), true)\n\nassertEqual(Belt.Array.every2([0, 1], [5, 0], (x, y) => x > y), false)\n```"
],
"signature": "let every2: (t<'a>, array<'b>, ('a, 'b) => bool) => bool"
},
@@ -9132,14 +9351,15 @@
"kind": "value",
"name": "some2U",
"docstrings": [],
- "signature": "let some2U: (t<'a>, array<'b>, ('a, 'b) => bool) => bool"
+ "signature": "let some2U: (t<'a>, array<'b>, ('a, 'b) => bool) => bool",
+ "deprecated": "Use `some2` instead"
},
{
"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```"
+ "`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\nassertEqual(Belt.Array.some2([0, 2], [1, 0, 3], (a, b) => a > b), true)\n\nassertEqual(Belt.Array.some2([], [1], (x, y) => x > y), false)\n\nassertEqual(Belt.Array.some2([2, 3], [1, 4], (x, y) => x > y), true)\n```"
],
"signature": "let some2: (t<'a>, array<'b>, ('a, 'b) => bool) => bool"
},
@@ -9148,14 +9368,15 @@
"kind": "value",
"name": "cmpU",
"docstrings": [],
- "signature": "let cmpU: (t<'a>, t<'a>, ('a, 'a) => int) => int"
+ "signature": "let cmpU: (t<'a>, t<'a>, ('a, 'a) => int) => int",
+ "deprecated": "Use `cmp` instead"
},
{
"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```"
+ "`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\nassertEqual(Belt.Array.cmp([1, 3, 5], [1, 4, 2], (a, b) => compare(a, b)), -1)\n\nassertEqual(Belt.Array.cmp([1, 3, 5], [1, 2, 3], (a, b) => compare(a, b)), 1)\n\nassertEqual(Belt.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"
},
@@ -9164,14 +9385,15 @@
"kind": "value",
"name": "eqU",
"docstrings": [],
- "signature": "let eqU: (t<'a>, t<'a>, ('a, 'a) => bool) => bool"
+ "signature": "let eqU: (t<'a>, t<'a>, ('a, 'a) => bool) => bool",
+ "deprecated": "Use `eq` instead"
},
{
"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```"
+ "`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\nassertEqual(Belt.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"
},
@@ -9180,7 +9402,7 @@
"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```"
+ "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\nassertEqual(arr, [\"ant\", \"bee\", \"cat\"])\n```"
],
"signature": "let truncateToLengthUnsafe: (t<'a>, int) => unit"
},
@@ -9189,7 +9411,8 @@
"kind": "value",
"name": "initU",
"docstrings": [],
- "signature": "let initU: (int, int => 'a) => t<'a>"
+ "signature": "let initU: (int, int => 'a) => t<'a>",
+ "deprecated": "Use `init` instead"
},
{
"id": "Belt.Array.init",
@@ -9258,15 +9481,14 @@
"kind": "value",
"name": "comparableU",
"docstrings": [],
- "signature": "let comparableU: (\n ~cmp: ('a, 'a) => int,\n) => module(Comparable with type t = 'a)"
+ "signature": "let comparableU: (\n ~cmp: ('a, 'a) => int,\n) => module(Comparable with type t = 'a)",
+ "deprecated": "Use `comparable` instead"
},
{
"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"
- ],
+ "docstrings": [],
"signature": "let comparable: (\n ~cmp: ('a, 'a) => int,\n) => module(Comparable with type t = 'a)"
},
{
@@ -9283,7 +9505,8 @@
"kind": "value",
"name": "hashableU",
"docstrings": [],
- "signature": "let hashableU: (\n ~hash: 'a => int,\n ~eq: ('a, 'a) => bool,\n) => module(Hashable with type t = 'a)"
+ "signature": "let hashableU: (\n ~hash: 'a => int,\n ~eq: ('a, 'a) => bool,\n) => module(Hashable with type t = 'a)",
+ "deprecated": "Use `hashable` instead"
},
{
"id": "Belt.Id.hashable",
diff --git a/data/api/v12.0.0/dom.json b/data/api/v12.0.0/dom.json
index 3d1372099..2bf0f3038 100644
--- a/data/api/v12.0.0/dom.json
+++ b/data/api/v12.0.0/dom.json
@@ -1901,13 +1901,6 @@
"docstrings": [],
"signature": "type t = Dom_storage2.t"
},
- {
- "id": "Dom.Storage.getItem",
- "kind": "value",
- "name": "getItem",
- "docstrings": [],
- "signature": "let getItem: (t, string) => option"
- },
{
"id": "Dom.Storage.getItem",
"kind": "value",
@@ -1915,13 +1908,6 @@
"docstrings": [],
"signature": "let getItem: (string, t) => option"
},
- {
- "id": "Dom.Storage.setItem",
- "kind": "value",
- "name": "setItem",
- "docstrings": [],
- "signature": "let setItem: (t, string, string) => unit"
- },
{
"id": "Dom.Storage.setItem",
"kind": "value",
@@ -1929,13 +1915,6 @@
"docstrings": [],
"signature": "let setItem: (string, string, t) => unit"
},
- {
- "id": "Dom.Storage.removeItem",
- "kind": "value",
- "name": "removeItem",
- "docstrings": [],
- "signature": "let removeItem: (t, string) => unit"
- },
{
"id": "Dom.Storage.removeItem",
"kind": "value",
@@ -1950,13 +1929,6 @@
"docstrings": [],
"signature": "let clear: t => unit"
},
- {
- "id": "Dom.Storage.key",
- "kind": "value",
- "name": "key",
- "docstrings": [],
- "signature": "let key: (t, int) => option"
- },
{
"id": "Dom.Storage.key",
"kind": "value",
diff --git a/data/api/v12.0.0/js.json b/data/api/v12.0.0/js.json
index c9b052ef9..ea56e3913 100644
--- a/data/api/v12.0.0/js.json
+++ b/data/api/v12.0.0/js.json
@@ -3,7 +3,7 @@
"id": "Js",
"name": "Js",
"docstrings": [
- "The Js module mostly contains ReScript bindings to _standard JavaScript APIs_\nlike [console.log](https://developer.mozilla.org/en-US/docs/Web/API/Console/log),\nor the JavaScript\n[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String),\n[Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date), and\n[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)\nclasses.\n\nIt is meant as a zero-abstraction interop layer and directly exposes JavaScript functions as they are. If you can find your API in this module, prefer this over an equivalent Belt helper. For example, prefer [Js.Array2](js/array2) over [Belt.Array](belt/array)\n\n## Argument Order\n\nFor historical reasons, some APIs in the Js namespace (e.g. [Js.String](js/string)) are\nusing the data-last argument order whereas others (e.g. [Js.Date](js/date)) are using data-first.\n\nFor more information about these argument orders and the trade-offs between them, see\n[this blog post](https://www.javierchavarri.com/data-first-and-data-last-a-comparison/).\n\n_Eventually, all modules in the Js namespace are going to be migrated to data-first though._\n\nIn the meantime, there are several options for dealing with the data-last APIs:\n\n## Examples\n\n```rescript\n/* Js.String (data-last API used with pipe last operator) */\nJs.log(\"2019-11-10\" |> Js.String.split(\"-\"))\nJs.log(\"ReScript\" |> Js.String.startsWith(\"Re\"))\n\n/* Js.String (data-last API used with pipe first operator) */\nJs.log(\"2019-11-10\"->Js.String.split(\"-\", _))\nJs.log(\"ReScript\"->Js.String.startsWith(\"Re\", _))\n\n/* Js.String (data-last API used without any piping) */\nJs.log(Js.String.split(\"-\", \"2019-11-10\"))\nJs.log(Js.String.startsWith(\"Re\", \"ReScript\"))\n```\n## Js.Xxx2 Modules\n\nPrefer `Js.Array2` over `Js.Array`, `Js.String2` over `Js.String`, etc. The latters are old modules."
+ "The Js module mostly contains ReScript bindings to _standard JavaScript APIs_\nlike [console.log](https://developer.mozilla.org/en-US/docs/Web/API/Console/log),\nor the JavaScript\n[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String),\n[Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date), and\n[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)\nclasses.\n\nIt is meant as a zero-abstraction interop layer and directly exposes JavaScript functions as they are. If you can find your API in this module, prefer this over an equivalent Belt helper. For example, prefer [Js.Array2](js/array2) over [Belt.Array](belt/array)\n\n## Argument Order\n\nFor historical reasons, some APIs in the Js namespace (e.g. [Js.String](js/string)) are\nusing the data-last argument order whereas others (e.g. [Js.Date](js/date)) are using data-first.\n\nFor more information about these argument orders and the trade-offs between them, see\n[this blog post](https://www.javierchavarri.com/data-first-and-data-last-a-comparison/).\n\n_Eventually, all modules in the Js namespace are going to be migrated to data-first though._\n\nIn the meantime, there are several options for dealing with the data-last APIs:\n\n## Examples\n\n```rescript\n/* Js.String (data-last API used with pipe last operator) */\nJs.log(\\\"2019-11-10\\\" |> Js.String.split(\\\"-\\\"))\nJs.log(\\\"ReScript\\\" |> Js.String.startsWith(\\\"Re\\\"))\n\n/* Js.String (data-last API used with pipe first operator) */\nJs.log(\\\"2019-11-10\\\"->Js.String.split(\\\"-\\\", _))\nJs.log(\\\"ReScript\\\"->Js.String.startsWith(\\\"Re\\\", _))\n\n/* Js.String (data-last API used without any piping) */\nJs.log(Js.String.split(\\\"-\\\", \\\"2019-11-10\\\"))\nJs.log(Js.String.startsWith(\\\"Re\\\", \\\"ReScript\\\"))\n```\n## Js.Xxx2 Modules\n\nPrefer `Js.Array2` over `Js.Array`, `Js.String2` over `Js.String`, etc. The latters are old modules."
],
"items": [
{
@@ -15,30 +15,35 @@
],
"signature": "type t<'a> = 'a\n constraint 'a = {..}"
},
+ {
+ "id": "Js.globalThis",
+ "kind": "value",
+ "name": "globalThis",
+ "docstrings": [
+ "JS global object reference"
+ ],
+ "signature": "let globalThis: t<{..}>"
+ },
{
"id": "Js.null",
"kind": "type",
"name": "null",
- "docstrings": [
- "Nullable value of this type can be either null or 'a. This type is equivalent to Js.Null.t."
- ],
- "signature": "type null<'a> = Value('a) | Null"
+ "docstrings": [],
+ "signature": "@unboxed\ntype null<'a> = Js_null.t<'a> = Value('a) | @as(null) Null"
},
{
"id": "Js.undefined",
"kind": "type",
"name": "undefined",
- "docstrings": [
- "A value of this type can be either undefined or 'a. This type is equivalent to Js.Undefined.t."
- ],
- "signature": "type undefined<+'a>"
+ "docstrings": [],
+ "signature": "type undefined<'a> = Js_undefined.t<'a>"
},
{
"id": "Js.nullable",
"kind": "type",
"name": "nullable",
"docstrings": [],
- "signature": "type nullable<'a> = Value('a) | Null | Undefined"
+ "signature": "@unboxed\ntype nullable<'a> = Js_null_undefined.t<'a> =\n | Value('a)\n | @as(null) Null\n | @as(undefined) Undefined"
},
{
"id": "Js.null_undefined",
@@ -768,14 +773,14 @@
"kind": "value",
"name": "find",
"docstrings": [],
- "signature": "let find: (t, elt => bool) => Js.undefined"
+ "signature": "let find: (t, elt => bool) => Js_undefined.t"
},
{
"id": "Js.TypedArray2.Float64Array.findi",
"kind": "value",
"name": "findi",
"docstrings": [],
- "signature": "let findi: (t, (elt, int) => bool) => Js.undefined"
+ "signature": "let findi: (t, (elt, int) => bool) => Js_undefined.t"
},
{
"id": "Js.TypedArray2.Float64Array.findIndex",
@@ -1200,14 +1205,14 @@
"kind": "value",
"name": "find",
"docstrings": [],
- "signature": "let find: (t, elt => bool) => Js.undefined"
+ "signature": "let find: (t, elt => bool) => Js_undefined.t"
},
{
"id": "Js.TypedArray2.Float32Array.findi",
"kind": "value",
"name": "findi",
"docstrings": [],
- "signature": "let findi: (t, (elt, int) => bool) => Js.undefined"
+ "signature": "let findi: (t, (elt, int) => bool) => Js_undefined.t"
},
{
"id": "Js.TypedArray2.Float32Array.findIndex",
@@ -1632,14 +1637,14 @@
"kind": "value",
"name": "find",
"docstrings": [],
- "signature": "let find: (t, elt => bool) => Js.undefined"
+ "signature": "let find: (t, elt => bool) => Js_undefined.t"
},
{
"id": "Js.TypedArray2.Uint32Array.findi",
"kind": "value",
"name": "findi",
"docstrings": [],
- "signature": "let findi: (t, (elt, int) => bool) => Js.undefined"
+ "signature": "let findi: (t, (elt, int) => bool) => Js_undefined.t"
},
{
"id": "Js.TypedArray2.Uint32Array.findIndex",
@@ -2064,14 +2069,14 @@
"kind": "value",
"name": "find",
"docstrings": [],
- "signature": "let find: (t, elt => bool) => Js.undefined"
+ "signature": "let find: (t, elt => bool) => Js_undefined.t"
},
{
"id": "Js.TypedArray2.Int32Array.findi",
"kind": "value",
"name": "findi",
"docstrings": [],
- "signature": "let findi: (t, (elt, int) => bool) => Js.undefined"
+ "signature": "let findi: (t, (elt, int) => bool) => Js_undefined.t"
},
{
"id": "Js.TypedArray2.Int32Array.findIndex",
@@ -2496,14 +2501,14 @@
"kind": "value",
"name": "find",
"docstrings": [],
- "signature": "let find: (t, elt => bool) => Js.undefined"
+ "signature": "let find: (t, elt => bool) => Js_undefined.t"
},
{
"id": "Js.TypedArray2.Uint16Array.findi",
"kind": "value",
"name": "findi",
"docstrings": [],
- "signature": "let findi: (t, (elt, int) => bool) => Js.undefined"
+ "signature": "let findi: (t, (elt, int) => bool) => Js_undefined.t"
},
{
"id": "Js.TypedArray2.Uint16Array.findIndex",
@@ -2928,14 +2933,14 @@
"kind": "value",
"name": "find",
"docstrings": [],
- "signature": "let find: (t, elt => bool) => Js.undefined"
+ "signature": "let find: (t, elt => bool) => Js_undefined.t"
},
{
"id": "Js.TypedArray2.Int16Array.findi",
"kind": "value",
"name": "findi",
"docstrings": [],
- "signature": "let findi: (t, (elt, int) => bool) => Js.undefined"
+ "signature": "let findi: (t, (elt, int) => bool) => Js_undefined.t"
},
{
"id": "Js.TypedArray2.Int16Array.findIndex",
@@ -3360,14 +3365,14 @@
"kind": "value",
"name": "find",
"docstrings": [],
- "signature": "let find: (t, elt => bool) => Js.undefined"
+ "signature": "let find: (t, elt => bool) => Js_undefined.t"
},
{
"id": "Js.TypedArray2.Uint8ClampedArray.findi",
"kind": "value",
"name": "findi",
"docstrings": [],
- "signature": "let findi: (t, (elt, int) => bool) => Js.undefined"
+ "signature": "let findi: (t, (elt, int) => bool) => Js_undefined.t"
},
{
"id": "Js.TypedArray2.Uint8ClampedArray.findIndex",
@@ -3792,14 +3797,14 @@
"kind": "value",
"name": "find",
"docstrings": [],
- "signature": "let find: (t, elt => bool) => Js.undefined"
+ "signature": "let find: (t, elt => bool) => Js_undefined.t"
},
{
"id": "Js.TypedArray2.Uint8Array.findi",
"kind": "value",
"name": "findi",
"docstrings": [],
- "signature": "let findi: (t, (elt, int) => bool) => Js.undefined"
+ "signature": "let findi: (t, (elt, int) => bool) => Js_undefined.t"
},
{
"id": "Js.TypedArray2.Uint8Array.findIndex",
@@ -4224,14 +4229,14 @@
"kind": "value",
"name": "find",
"docstrings": [],
- "signature": "let find: (t, elt => bool) => Js.undefined"
+ "signature": "let find: (t, elt => bool) => Js_undefined.t"
},
{
"id": "Js.TypedArray2.Int8Array.findi",
"kind": "value",
"name": "findi",
"docstrings": [],
- "signature": "let findi: (t, (elt, int) => bool) => Js.undefined"
+ "signature": "let findi: (t, (elt, int) => bool) => Js_undefined.t"
},
{
"id": "Js.TypedArray2.Int8Array.findIndex",
@@ -4750,20 +4755,6 @@
"docstrings": [],
"signature": "let byteOffset: t => int"
},
- {
- "id": "Js.Typed_array.Float64Array.setArray",
- "kind": "value",
- "name": "setArray",
- "docstrings": [],
- "signature": "let setArray: (array, t) => unit"
- },
- {
- "id": "Js.Typed_array.Float64Array.setArrayOffset",
- "kind": "value",
- "name": "setArrayOffset",
- "docstrings": [],
- "signature": "let setArrayOffset: (array, int, t) => unit"
- },
{
"id": "Js.Typed_array.Float64Array.length",
"kind": "value",
@@ -4771,292 +4762,26 @@
"docstrings": [],
"signature": "let length: t => int"
},
- {
- "id": "Js.Typed_array.Float64Array.copyWithin",
- "kind": "value",
- "name": "copyWithin",
- "docstrings": [],
- "signature": "let copyWithin: (~to_: int, t) => t"
- },
- {
- "id": "Js.Typed_array.Float64Array.copyWithinFrom",
- "kind": "value",
- "name": "copyWithinFrom",
- "docstrings": [],
- "signature": "let copyWithinFrom: (~to_: int, ~from: int, t) => t"
- },
{
"id": "Js.Typed_array.Float64Array.copyWithinFromRange",
"kind": "value",
"name": "copyWithinFromRange",
"docstrings": [],
- "signature": "let copyWithinFromRange: (~to_: int, ~start: int, ~end_: int, t) => t"
- },
- {
- "id": "Js.Typed_array.Float64Array.fillInPlace",
- "kind": "value",
- "name": "fillInPlace",
- "docstrings": [],
- "signature": "let fillInPlace: (elt, t) => t"
- },
- {
- "id": "Js.Typed_array.Float64Array.fillFromInPlace",
- "kind": "value",
- "name": "fillFromInPlace",
- "docstrings": [],
- "signature": "let fillFromInPlace: (elt, ~from: int, t) => t"
- },
- {
- "id": "Js.Typed_array.Float64Array.fillRangeInPlace",
- "kind": "value",
- "name": "fillRangeInPlace",
- "docstrings": [],
- "signature": "let fillRangeInPlace: (elt, ~start: int, ~end_: int, t) => t"
- },
- {
- "id": "Js.Typed_array.Float64Array.reverseInPlace",
- "kind": "value",
- "name": "reverseInPlace",
- "docstrings": [],
- "signature": "let reverseInPlace: t => t"
- },
- {
- "id": "Js.Typed_array.Float64Array.sortInPlace",
- "kind": "value",
- "name": "sortInPlace",
- "docstrings": [],
- "signature": "let sortInPlace: t => t"
- },
- {
- "id": "Js.Typed_array.Float64Array.sortInPlaceWith",
- "kind": "value",
- "name": "sortInPlaceWith",
- "docstrings": [],
- "signature": "let sortInPlaceWith: ((elt, elt) => int, t) => t"
- },
- {
- "id": "Js.Typed_array.Float64Array.includes",
- "kind": "value",
- "name": "includes",
- "docstrings": [],
- "signature": "let includes: (elt, t) => bool"
- },
- {
- "id": "Js.Typed_array.Float64Array.indexOf",
- "kind": "value",
- "name": "indexOf",
- "docstrings": [],
- "signature": "let indexOf: (elt, t) => int"
- },
- {
- "id": "Js.Typed_array.Float64Array.indexOfFrom",
- "kind": "value",
- "name": "indexOfFrom",
- "docstrings": [],
- "signature": "let indexOfFrom: (elt, ~from: int, t) => int"
- },
- {
- "id": "Js.Typed_array.Float64Array.join",
- "kind": "value",
- "name": "join",
- "docstrings": [],
- "signature": "let join: t => string"
- },
- {
- "id": "Js.Typed_array.Float64Array.joinWith",
- "kind": "value",
- "name": "joinWith",
- "docstrings": [],
- "signature": "let joinWith: (string, t) => string"
- },
- {
- "id": "Js.Typed_array.Float64Array.lastIndexOf",
- "kind": "value",
- "name": "lastIndexOf",
- "docstrings": [],
- "signature": "let lastIndexOf: (elt, t) => int"
- },
- {
- "id": "Js.Typed_array.Float64Array.lastIndexOfFrom",
- "kind": "value",
- "name": "lastIndexOfFrom",
- "docstrings": [],
- "signature": "let lastIndexOfFrom: (elt, ~from: int, t) => int"
+ "signature": "let copyWithinFromRange: (~to_: int, ~start: int, ~end_: int) => t"
},
{
"id": "Js.Typed_array.Float64Array.slice",
"kind": "value",
"name": "slice",
"docstrings": [],
- "signature": "let slice: (~start: int, ~end_: int, t) => t"
- },
- {
- "id": "Js.Typed_array.Float64Array.copy",
- "kind": "value",
- "name": "copy",
- "docstrings": [],
- "signature": "let copy: t => t"
- },
- {
- "id": "Js.Typed_array.Float64Array.sliceFrom",
- "kind": "value",
- "name": "sliceFrom",
- "docstrings": [],
- "signature": "let sliceFrom: (int, t) => t"
+ "signature": "let slice: (~start: int, ~end_: int) => t"
},
{
"id": "Js.Typed_array.Float64Array.subarray",
"kind": "value",
"name": "subarray",
"docstrings": [],
- "signature": "let subarray: (~start: int, ~end_: int, t) => t"
- },
- {
- "id": "Js.Typed_array.Float64Array.subarrayFrom",
- "kind": "value",
- "name": "subarrayFrom",
- "docstrings": [],
- "signature": "let subarrayFrom: (int, t) => t"
- },
- {
- "id": "Js.Typed_array.Float64Array.toString",
- "kind": "value",
- "name": "toString",
- "docstrings": [],
- "signature": "let toString: t => string"
- },
- {
- "id": "Js.Typed_array.Float64Array.toLocaleString",
- "kind": "value",
- "name": "toLocaleString",
- "docstrings": [],
- "signature": "let toLocaleString: t => string"
- },
- {
- "id": "Js.Typed_array.Float64Array.every",
- "kind": "value",
- "name": "every",
- "docstrings": [],
- "signature": "let every: (elt => bool, t) => bool"
- },
- {
- "id": "Js.Typed_array.Float64Array.everyi",
- "kind": "value",
- "name": "everyi",
- "docstrings": [],
- "signature": "let everyi: ((elt, int) => bool, t) => bool"
- },
- {
- "id": "Js.Typed_array.Float64Array.filter",
- "kind": "value",
- "name": "filter",
- "docstrings": [],
- "signature": "let filter: (elt => bool, t) => t"
- },
- {
- "id": "Js.Typed_array.Float64Array.filteri",
- "kind": "value",
- "name": "filteri",
- "docstrings": [],
- "signature": "let filteri: ((elt, int) => bool, t) => t"
- },
- {
- "id": "Js.Typed_array.Float64Array.find",
- "kind": "value",
- "name": "find",
- "docstrings": [],
- "signature": "let find: (elt => bool, t) => Js.undefined"
- },
- {
- "id": "Js.Typed_array.Float64Array.findi",
- "kind": "value",
- "name": "findi",
- "docstrings": [],
- "signature": "let findi: ((elt, int) => bool, t) => Js.undefined"
- },
- {
- "id": "Js.Typed_array.Float64Array.findIndex",
- "kind": "value",
- "name": "findIndex",
- "docstrings": [],
- "signature": "let findIndex: (elt => bool, t) => int"
- },
- {
- "id": "Js.Typed_array.Float64Array.findIndexi",
- "kind": "value",
- "name": "findIndexi",
- "docstrings": [],
- "signature": "let findIndexi: ((elt, int) => bool, t) => int"
- },
- {
- "id": "Js.Typed_array.Float64Array.forEach",
- "kind": "value",
- "name": "forEach",
- "docstrings": [],
- "signature": "let forEach: (elt => unit, t) => unit"
- },
- {
- "id": "Js.Typed_array.Float64Array.forEachi",
- "kind": "value",
- "name": "forEachi",
- "docstrings": [],
- "signature": "let forEachi: ((elt, int) => unit, t) => unit"
- },
- {
- "id": "Js.Typed_array.Float64Array.map",
- "kind": "value",
- "name": "map",
- "docstrings": [],
- "signature": "let map: (elt => 'a, t) => typed_array<'a>"
- },
- {
- "id": "Js.Typed_array.Float64Array.mapi",
- "kind": "value",
- "name": "mapi",
- "docstrings": [],
- "signature": "let mapi: ((elt, int) => 'a, t) => typed_array<'a>"
- },
- {
- "id": "Js.Typed_array.Float64Array.reduce",
- "kind": "value",
- "name": "reduce",
- "docstrings": [],
- "signature": "let reduce: (('a, elt) => 'a, 'a, t) => 'a"
- },
- {
- "id": "Js.Typed_array.Float64Array.reducei",
- "kind": "value",
- "name": "reducei",
- "docstrings": [],
- "signature": "let reducei: (('a, elt, int) => 'a, 'a, t) => 'a"
- },
- {
- "id": "Js.Typed_array.Float64Array.reduceRight",
- "kind": "value",
- "name": "reduceRight",
- "docstrings": [],
- "signature": "let reduceRight: (('a, elt) => 'a, 'a, t) => 'a"
- },
- {
- "id": "Js.Typed_array.Float64Array.reduceRighti",
- "kind": "value",
- "name": "reduceRighti",
- "docstrings": [],
- "signature": "let reduceRighti: (('a, elt, int) => 'a, 'a, t) => 'a"
- },
- {
- "id": "Js.Typed_array.Float64Array.some",
- "kind": "value",
- "name": "some",
- "docstrings": [],
- "signature": "let some: (elt => bool, t) => bool"
- },
- {
- "id": "Js.Typed_array.Float64Array.somei",
- "kind": "value",
- "name": "somei",
- "docstrings": [],
- "signature": "let somei: ((elt, int) => bool, t) => bool"
+ "signature": "let subarray: (~start: int, ~end_: int) => t"
},
{
"id": "Js.Typed_array.Float64Array._BYTES_PER_ELEMENT",
@@ -5200,20 +4925,6 @@
"docstrings": [],
"signature": "let byteOffset: t => int"
},
- {
- "id": "Js.Typed_array.Float32Array.setArray",
- "kind": "value",
- "name": "setArray",
- "docstrings": [],
- "signature": "let setArray: (array, t) => unit"
- },
- {
- "id": "Js.Typed_array.Float32Array.setArrayOffset",
- "kind": "value",
- "name": "setArrayOffset",
- "docstrings": [],
- "signature": "let setArrayOffset: (array, int, t) => unit"
- },
{
"id": "Js.Typed_array.Float32Array.length",
"kind": "value",
@@ -5222,308 +4933,360 @@
"signature": "let length: t => int"
},
{
- "id": "Js.Typed_array.Float32Array.copyWithin",
+ "id": "Js.Typed_array.Float32Array.copyWithinFromRange",
"kind": "value",
- "name": "copyWithin",
+ "name": "copyWithinFromRange",
"docstrings": [],
- "signature": "let copyWithin: (~to_: int, t) => t"
+ "signature": "let copyWithinFromRange: (~to_: int, ~start: int, ~end_: int) => t"
},
{
- "id": "Js.Typed_array.Float32Array.copyWithinFrom",
+ "id": "Js.Typed_array.Float32Array.slice",
"kind": "value",
- "name": "copyWithinFrom",
+ "name": "slice",
"docstrings": [],
- "signature": "let copyWithinFrom: (~to_: int, ~from: int, t) => t"
+ "signature": "let slice: (~start: int, ~end_: int) => t"
},
{
- "id": "Js.Typed_array.Float32Array.copyWithinFromRange",
+ "id": "Js.Typed_array.Float32Array.subarray",
"kind": "value",
- "name": "copyWithinFromRange",
+ "name": "subarray",
"docstrings": [],
- "signature": "let copyWithinFromRange: (~to_: int, ~start: int, ~end_: int, t) => t"
+ "signature": "let subarray: (~start: int, ~end_: int) => t"
},
{
- "id": "Js.Typed_array.Float32Array.fillInPlace",
+ "id": "Js.Typed_array.Float32Array._BYTES_PER_ELEMENT",
"kind": "value",
- "name": "fillInPlace",
+ "name": "_BYTES_PER_ELEMENT",
"docstrings": [],
- "signature": "let fillInPlace: (elt, t) => t"
+ "signature": "let _BYTES_PER_ELEMENT: int"
},
{
- "id": "Js.Typed_array.Float32Array.fillFromInPlace",
+ "id": "Js.Typed_array.Float32Array.make",
"kind": "value",
- "name": "fillFromInPlace",
+ "name": "make",
"docstrings": [],
- "signature": "let fillFromInPlace: (elt, ~from: int, t) => t"
+ "signature": "let make: array => t"
},
{
- "id": "Js.Typed_array.Float32Array.fillRangeInPlace",
+ "id": "Js.Typed_array.Float32Array.fromBuffer",
"kind": "value",
- "name": "fillRangeInPlace",
- "docstrings": [],
- "signature": "let fillRangeInPlace: (elt, ~start: int, ~end_: int, t) => t"
+ "name": "fromBuffer",
+ "docstrings": [
+ "can throw"
+ ],
+ "signature": "let fromBuffer: array_buffer => t"
},
{
- "id": "Js.Typed_array.Float32Array.reverseInPlace",
+ "id": "Js.Typed_array.Float32Array.fromBufferOffset",
"kind": "value",
- "name": "reverseInPlace",
- "docstrings": [],
- "signature": "let reverseInPlace: t => t"
+ "name": "fromBufferOffset",
+ "docstrings": [
+ "**raise** Js.Exn.Error raise Js exception\n\n **param** offset is in bytes"
+ ],
+ "signature": "let fromBufferOffset: (array_buffer, int) => t"
},
{
- "id": "Js.Typed_array.Float32Array.sortInPlace",
+ "id": "Js.Typed_array.Float32Array.fromBufferRange",
"kind": "value",
- "name": "sortInPlace",
- "docstrings": [],
- "signature": "let sortInPlace: t => t"
+ "name": "fromBufferRange",
+ "docstrings": [
+ "**raise** Js.Exn.Error raises Js exception\n\n **param** offset is in bytes, length in elements"
+ ],
+ "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t"
},
{
- "id": "Js.Typed_array.Float32Array.sortInPlaceWith",
+ "id": "Js.Typed_array.Float32Array.fromLength",
"kind": "value",
- "name": "sortInPlaceWith",
+ "name": "fromLength",
"docstrings": [],
- "signature": "let sortInPlaceWith: ((elt, elt) => int, t) => t"
+ "signature": "let fromLength: int => t"
},
{
- "id": "Js.Typed_array.Float32Array.includes",
+ "id": "Js.Typed_array.Float32Array.from",
"kind": "value",
- "name": "includes",
+ "name": "from",
"docstrings": [],
- "signature": "let includes: (elt, t) => bool"
+ "signature": "let from: array_like => t"
},
{
- "id": "Js.Typed_array.Float32Array.indexOf",
+ "id": "Js.Typed_array.Float32Array.create",
"kind": "value",
- "name": "indexOf",
+ "name": "create",
"docstrings": [],
- "signature": "let indexOf: (elt, t) => int"
+ "signature": "let create: array => t",
+ "deprecated": "use `make` instead"
},
{
- "id": "Js.Typed_array.Float32Array.indexOfFrom",
+ "id": "Js.Typed_array.Float32Array.of_buffer",
"kind": "value",
- "name": "indexOfFrom",
+ "name": "of_buffer",
"docstrings": [],
- "signature": "let indexOfFrom: (elt, ~from: int, t) => int"
+ "signature": "let of_buffer: array_buffer => t",
+ "deprecated": "use `fromBuffer` instead"
+ }
+ ]
+ },
+ "js/typed_array/uint32array": {
+ "id": "Js.Typed_array.Uint32Array",
+ "name": "Uint32Array",
+ "docstrings": [],
+ "items": [
+ {
+ "id": "Js.Typed_array.Uint32Array.elt",
+ "kind": "type",
+ "name": "elt",
+ "docstrings": [
+ ""
+ ],
+ "signature": "type elt = int"
},
{
- "id": "Js.Typed_array.Float32Array.join",
- "kind": "value",
- "name": "join",
+ "id": "Js.Typed_array.Uint32Array.typed_array",
+ "kind": "type",
+ "name": "typed_array",
"docstrings": [],
- "signature": "let join: t => string"
+ "signature": "type typed_array<\n 'a,\n> = Js_typed_array2.Uint32Array.typed_array<'a>"
},
{
- "id": "Js.Typed_array.Float32Array.joinWith",
- "kind": "value",
- "name": "joinWith",
+ "id": "Js.Typed_array.Uint32Array.t",
+ "kind": "type",
+ "name": "t",
"docstrings": [],
- "signature": "let joinWith: (string, t) => string"
+ "signature": "type t = typed_array"
},
{
- "id": "Js.Typed_array.Float32Array.lastIndexOf",
+ "id": "Js.Typed_array.Uint32Array.unsafe_get",
"kind": "value",
- "name": "lastIndexOf",
+ "name": "unsafe_get",
"docstrings": [],
- "signature": "let lastIndexOf: (elt, t) => int"
+ "signature": "let unsafe_get: (t, int) => elt"
},
{
- "id": "Js.Typed_array.Float32Array.lastIndexOfFrom",
+ "id": "Js.Typed_array.Uint32Array.unsafe_set",
"kind": "value",
- "name": "lastIndexOfFrom",
+ "name": "unsafe_set",
"docstrings": [],
- "signature": "let lastIndexOfFrom: (elt, ~from: int, t) => int"
+ "signature": "let unsafe_set: (t, int, elt) => unit"
},
{
- "id": "Js.Typed_array.Float32Array.slice",
+ "id": "Js.Typed_array.Uint32Array.buffer",
"kind": "value",
- "name": "slice",
+ "name": "buffer",
"docstrings": [],
- "signature": "let slice: (~start: int, ~end_: int, t) => t"
+ "signature": "let buffer: t => array_buffer"
},
{
- "id": "Js.Typed_array.Float32Array.copy",
+ "id": "Js.Typed_array.Uint32Array.byteLength",
"kind": "value",
- "name": "copy",
+ "name": "byteLength",
"docstrings": [],
- "signature": "let copy: t => t"
+ "signature": "let byteLength: t => int"
},
{
- "id": "Js.Typed_array.Float32Array.sliceFrom",
+ "id": "Js.Typed_array.Uint32Array.byteOffset",
"kind": "value",
- "name": "sliceFrom",
+ "name": "byteOffset",
"docstrings": [],
- "signature": "let sliceFrom: (int, t) => t"
+ "signature": "let byteOffset: t => int"
},
{
- "id": "Js.Typed_array.Float32Array.subarray",
+ "id": "Js.Typed_array.Uint32Array.length",
"kind": "value",
- "name": "subarray",
+ "name": "length",
"docstrings": [],
- "signature": "let subarray: (~start: int, ~end_: int, t) => t"
+ "signature": "let length: t => int"
},
{
- "id": "Js.Typed_array.Float32Array.subarrayFrom",
+ "id": "Js.Typed_array.Uint32Array.copyWithinFromRange",
"kind": "value",
- "name": "subarrayFrom",
+ "name": "copyWithinFromRange",
"docstrings": [],
- "signature": "let subarrayFrom: (int, t) => t"
+ "signature": "let copyWithinFromRange: (~to_: int, ~start: int, ~end_: int) => t"
},
{
- "id": "Js.Typed_array.Float32Array.toString",
+ "id": "Js.Typed_array.Uint32Array.slice",
"kind": "value",
- "name": "toString",
+ "name": "slice",
"docstrings": [],
- "signature": "let toString: t => string"
+ "signature": "let slice: (~start: int, ~end_: int) => t"
},
{
- "id": "Js.Typed_array.Float32Array.toLocaleString",
+ "id": "Js.Typed_array.Uint32Array.subarray",
"kind": "value",
- "name": "toLocaleString",
+ "name": "subarray",
"docstrings": [],
- "signature": "let toLocaleString: t => string"
+ "signature": "let subarray: (~start: int, ~end_: int) => t"
},
{
- "id": "Js.Typed_array.Float32Array.every",
+ "id": "Js.Typed_array.Uint32Array._BYTES_PER_ELEMENT",
"kind": "value",
- "name": "every",
+ "name": "_BYTES_PER_ELEMENT",
"docstrings": [],
- "signature": "let every: (elt => bool, t) => bool"
+ "signature": "let _BYTES_PER_ELEMENT: int"
},
{
- "id": "Js.Typed_array.Float32Array.everyi",
+ "id": "Js.Typed_array.Uint32Array.make",
"kind": "value",
- "name": "everyi",
+ "name": "make",
"docstrings": [],
- "signature": "let everyi: ((elt, int) => bool, t) => bool"
+ "signature": "let make: array => t"
},
{
- "id": "Js.Typed_array.Float32Array.filter",
+ "id": "Js.Typed_array.Uint32Array.fromBuffer",
"kind": "value",
- "name": "filter",
- "docstrings": [],
- "signature": "let filter: (elt => bool, t) => t"
+ "name": "fromBuffer",
+ "docstrings": [
+ "can throw"
+ ],
+ "signature": "let fromBuffer: array_buffer => t"
},
{
- "id": "Js.Typed_array.Float32Array.filteri",
+ "id": "Js.Typed_array.Uint32Array.fromBufferOffset",
"kind": "value",
- "name": "filteri",
- "docstrings": [],
- "signature": "let filteri: ((elt, int) => bool, t) => t"
+ "name": "fromBufferOffset",
+ "docstrings": [
+ "**raise** Js.Exn.Error raise Js exception\n\n **param** offset is in bytes"
+ ],
+ "signature": "let fromBufferOffset: (array_buffer, int) => t"
},
{
- "id": "Js.Typed_array.Float32Array.find",
+ "id": "Js.Typed_array.Uint32Array.fromBufferRange",
"kind": "value",
- "name": "find",
- "docstrings": [],
- "signature": "let find: (elt => bool, t) => Js.undefined"
+ "name": "fromBufferRange",
+ "docstrings": [
+ "**raise** Js.Exn.Error raises Js exception\n\n **param** offset is in bytes, length in elements"
+ ],
+ "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t"
},
{
- "id": "Js.Typed_array.Float32Array.findi",
+ "id": "Js.Typed_array.Uint32Array.fromLength",
"kind": "value",
- "name": "findi",
+ "name": "fromLength",
"docstrings": [],
- "signature": "let findi: ((elt, int) => bool, t) => Js.undefined"
+ "signature": "let fromLength: int => t"
},
{
- "id": "Js.Typed_array.Float32Array.findIndex",
+ "id": "Js.Typed_array.Uint32Array.from",
"kind": "value",
- "name": "findIndex",
+ "name": "from",
"docstrings": [],
- "signature": "let findIndex: (elt => bool, t) => int"
+ "signature": "let from: array_like => t"
+ }
+ ]
+ },
+ "js/typed_array/int32_array": {
+ "id": "Js.Typed_array.Int32_array",
+ "name": "Int32_array",
+ "docstrings": [],
+ "items": []
+ },
+ "js/typed_array/int32array": {
+ "id": "Js.Typed_array.Int32Array",
+ "name": "Int32Array",
+ "docstrings": [],
+ "items": [
+ {
+ "id": "Js.Typed_array.Int32Array.elt",
+ "kind": "type",
+ "name": "elt",
+ "docstrings": [
+ ""
+ ],
+ "signature": "type elt = int"
},
{
- "id": "Js.Typed_array.Float32Array.findIndexi",
- "kind": "value",
- "name": "findIndexi",
+ "id": "Js.Typed_array.Int32Array.typed_array",
+ "kind": "type",
+ "name": "typed_array",
"docstrings": [],
- "signature": "let findIndexi: ((elt, int) => bool, t) => int"
+ "signature": "type typed_array<\n 'a,\n> = Js_typed_array2.Int32Array.typed_array<'a>"
},
{
- "id": "Js.Typed_array.Float32Array.forEach",
- "kind": "value",
- "name": "forEach",
+ "id": "Js.Typed_array.Int32Array.t",
+ "kind": "type",
+ "name": "t",
"docstrings": [],
- "signature": "let forEach: (elt => unit, t) => unit"
+ "signature": "type t = typed_array"
},
{
- "id": "Js.Typed_array.Float32Array.forEachi",
+ "id": "Js.Typed_array.Int32Array.unsafe_get",
"kind": "value",
- "name": "forEachi",
+ "name": "unsafe_get",
"docstrings": [],
- "signature": "let forEachi: ((elt, int) => unit, t) => unit"
+ "signature": "let unsafe_get: (t, int) => elt"
},
{
- "id": "Js.Typed_array.Float32Array.map",
+ "id": "Js.Typed_array.Int32Array.unsafe_set",
"kind": "value",
- "name": "map",
+ "name": "unsafe_set",
"docstrings": [],
- "signature": "let map: (elt => 'a, t) => typed_array<'a>"
+ "signature": "let unsafe_set: (t, int, elt) => unit"
},
{
- "id": "Js.Typed_array.Float32Array.mapi",
+ "id": "Js.Typed_array.Int32Array.buffer",
"kind": "value",
- "name": "mapi",
+ "name": "buffer",
"docstrings": [],
- "signature": "let mapi: ((elt, int) => 'a, t) => typed_array<'a>"
+ "signature": "let buffer: t => array_buffer"
},
{
- "id": "Js.Typed_array.Float32Array.reduce",
+ "id": "Js.Typed_array.Int32Array.byteLength",
"kind": "value",
- "name": "reduce",
+ "name": "byteLength",
"docstrings": [],
- "signature": "let reduce: (('a, elt) => 'a, 'a, t) => 'a"
+ "signature": "let byteLength: t => int"
},
{
- "id": "Js.Typed_array.Float32Array.reducei",
+ "id": "Js.Typed_array.Int32Array.byteOffset",
"kind": "value",
- "name": "reducei",
+ "name": "byteOffset",
"docstrings": [],
- "signature": "let reducei: (('a, elt, int) => 'a, 'a, t) => 'a"
+ "signature": "let byteOffset: t => int"
},
{
- "id": "Js.Typed_array.Float32Array.reduceRight",
+ "id": "Js.Typed_array.Int32Array.length",
"kind": "value",
- "name": "reduceRight",
+ "name": "length",
"docstrings": [],
- "signature": "let reduceRight: (('a, elt) => 'a, 'a, t) => 'a"
+ "signature": "let length: t => int"
},
{
- "id": "Js.Typed_array.Float32Array.reduceRighti",
+ "id": "Js.Typed_array.Int32Array.copyWithinFromRange",
"kind": "value",
- "name": "reduceRighti",
+ "name": "copyWithinFromRange",
"docstrings": [],
- "signature": "let reduceRighti: (('a, elt, int) => 'a, 'a, t) => 'a"
+ "signature": "let copyWithinFromRange: (~to_: int, ~start: int, ~end_: int) => t"
},
{
- "id": "Js.Typed_array.Float32Array.some",
+ "id": "Js.Typed_array.Int32Array.slice",
"kind": "value",
- "name": "some",
+ "name": "slice",
"docstrings": [],
- "signature": "let some: (elt => bool, t) => bool"
+ "signature": "let slice: (~start: int, ~end_: int) => t"
},
{
- "id": "Js.Typed_array.Float32Array.somei",
+ "id": "Js.Typed_array.Int32Array.subarray",
"kind": "value",
- "name": "somei",
+ "name": "subarray",
"docstrings": [],
- "signature": "let somei: ((elt, int) => bool, t) => bool"
+ "signature": "let subarray: (~start: int, ~end_: int) => t"
},
{
- "id": "Js.Typed_array.Float32Array._BYTES_PER_ELEMENT",
+ "id": "Js.Typed_array.Int32Array._BYTES_PER_ELEMENT",
"kind": "value",
"name": "_BYTES_PER_ELEMENT",
"docstrings": [],
"signature": "let _BYTES_PER_ELEMENT: int"
},
{
- "id": "Js.Typed_array.Float32Array.make",
+ "id": "Js.Typed_array.Int32Array.make",
"kind": "value",
"name": "make",
"docstrings": [],
"signature": "let make: array => t"
},
{
- "id": "Js.Typed_array.Float32Array.fromBuffer",
+ "id": "Js.Typed_array.Int32Array.fromBuffer",
"kind": "value",
"name": "fromBuffer",
"docstrings": [
@@ -5532,7 +5295,7 @@
"signature": "let fromBuffer: array_buffer => t"
},
{
- "id": "Js.Typed_array.Float32Array.fromBufferOffset",
+ "id": "Js.Typed_array.Int32Array.fromBufferOffset",
"kind": "value",
"name": "fromBufferOffset",
"docstrings": [
@@ -5541,7 +5304,7 @@
"signature": "let fromBufferOffset: (array_buffer, int) => t"
},
{
- "id": "Js.Typed_array.Float32Array.fromBufferRange",
+ "id": "Js.Typed_array.Int32Array.fromBufferRange",
"kind": "value",
"name": "fromBufferRange",
"docstrings": [
@@ -5550,29 +5313,29 @@
"signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t"
},
{
- "id": "Js.Typed_array.Float32Array.fromLength",
+ "id": "Js.Typed_array.Int32Array.fromLength",
"kind": "value",
"name": "fromLength",
"docstrings": [],
"signature": "let fromLength: int => t"
},
{
- "id": "Js.Typed_array.Float32Array.from",
+ "id": "Js.Typed_array.Int32Array.from",
"kind": "value",
"name": "from",
"docstrings": [],
"signature": "let from: array_like => t"
},
{
- "id": "Js.Typed_array.Float32Array.create",
+ "id": "Js.Typed_array.Int32Array.create",
"kind": "value",
"name": "create",
"docstrings": [],
- "signature": "let create: array => t",
+ "signature": "let create: array => t",
"deprecated": "use `make` instead"
},
{
- "id": "Js.Typed_array.Float32Array.of_buffer",
+ "id": "Js.Typed_array.Int32Array.of_buffer",
"kind": "value",
"name": "of_buffer",
"docstrings": [],
@@ -5581,13 +5344,13 @@
}
]
},
- "js/typed_array/uint32array": {
- "id": "Js.Typed_array.Uint32Array",
- "name": "Uint32Array",
+ "js/typed_array/uint16array": {
+ "id": "Js.Typed_array.Uint16Array",
+ "name": "Uint16Array",
"docstrings": [],
"items": [
{
- "id": "Js.Typed_array.Uint32Array.elt",
+ "id": "Js.Typed_array.Uint16Array.elt",
"kind": "type",
"name": "elt",
"docstrings": [
@@ -5596,378 +5359,394 @@
"signature": "type elt = int"
},
{
- "id": "Js.Typed_array.Uint32Array.typed_array",
+ "id": "Js.Typed_array.Uint16Array.typed_array",
"kind": "type",
"name": "typed_array",
"docstrings": [],
- "signature": "type typed_array<\n 'a,\n> = Js_typed_array2.Uint32Array.typed_array<'a>"
+ "signature": "type typed_array<\n 'a,\n> = Js_typed_array2.Uint16Array.typed_array<'a>"
},
{
- "id": "Js.Typed_array.Uint32Array.t",
+ "id": "Js.Typed_array.Uint16Array.t",
"kind": "type",
"name": "t",
"docstrings": [],
"signature": "type t = typed_array"
},
{
- "id": "Js.Typed_array.Uint32Array.unsafe_get",
+ "id": "Js.Typed_array.Uint16Array.unsafe_get",
"kind": "value",
"name": "unsafe_get",
"docstrings": [],
"signature": "let unsafe_get: (t, int) => elt"
},
{
- "id": "Js.Typed_array.Uint32Array.unsafe_set",
+ "id": "Js.Typed_array.Uint16Array.unsafe_set",
"kind": "value",
"name": "unsafe_set",
"docstrings": [],
"signature": "let unsafe_set: (t, int, elt) => unit"
},
{
- "id": "Js.Typed_array.Uint32Array.buffer",
+ "id": "Js.Typed_array.Uint16Array.buffer",
"kind": "value",
"name": "buffer",
"docstrings": [],
"signature": "let buffer: t => array_buffer"
},
{
- "id": "Js.Typed_array.Uint32Array.byteLength",
+ "id": "Js.Typed_array.Uint16Array.byteLength",
"kind": "value",
"name": "byteLength",
"docstrings": [],
"signature": "let byteLength: t => int"
},
{
- "id": "Js.Typed_array.Uint32Array.byteOffset",
+ "id": "Js.Typed_array.Uint16Array.byteOffset",
"kind": "value",
"name": "byteOffset",
"docstrings": [],
"signature": "let byteOffset: t => int"
},
{
- "id": "Js.Typed_array.Uint32Array.setArray",
+ "id": "Js.Typed_array.Uint16Array.length",
"kind": "value",
- "name": "setArray",
+ "name": "length",
"docstrings": [],
- "signature": "let setArray: (array, t) => unit"
+ "signature": "let length: t => int"
},
{
- "id": "Js.Typed_array.Uint32Array.setArrayOffset",
+ "id": "Js.Typed_array.Uint16Array.copyWithinFromRange",
"kind": "value",
- "name": "setArrayOffset",
+ "name": "copyWithinFromRange",
"docstrings": [],
- "signature": "let setArrayOffset: (array, int, t) => unit"
+ "signature": "let copyWithinFromRange: (~to_: int, ~start: int, ~end_: int) => t"
},
{
- "id": "Js.Typed_array.Uint32Array.length",
+ "id": "Js.Typed_array.Uint16Array.slice",
"kind": "value",
- "name": "length",
+ "name": "slice",
"docstrings": [],
- "signature": "let length: t => int"
+ "signature": "let slice: (~start: int, ~end_: int) => t"
},
{
- "id": "Js.Typed_array.Uint32Array.copyWithin",
+ "id": "Js.Typed_array.Uint16Array.subarray",
"kind": "value",
- "name": "copyWithin",
+ "name": "subarray",
"docstrings": [],
- "signature": "let copyWithin: (~to_: int, t) => t"
+ "signature": "let subarray: (~start: int, ~end_: int) => t"
},
{
- "id": "Js.Typed_array.Uint32Array.copyWithinFrom",
+ "id": "Js.Typed_array.Uint16Array._BYTES_PER_ELEMENT",
"kind": "value",
- "name": "copyWithinFrom",
+ "name": "_BYTES_PER_ELEMENT",
"docstrings": [],
- "signature": "let copyWithinFrom: (~to_: int, ~from: int, t) => t"
+ "signature": "let _BYTES_PER_ELEMENT: int"
},
{
- "id": "Js.Typed_array.Uint32Array.copyWithinFromRange",
+ "id": "Js.Typed_array.Uint16Array.make",
"kind": "value",
- "name": "copyWithinFromRange",
+ "name": "make",
"docstrings": [],
- "signature": "let copyWithinFromRange: (~to_: int, ~start: int, ~end_: int, t) => t"
+ "signature": "let make: array => t"
},
{
- "id": "Js.Typed_array.Uint32Array.fillInPlace",
+ "id": "Js.Typed_array.Uint16Array.fromBuffer",
"kind": "value",
- "name": "fillInPlace",
- "docstrings": [],
- "signature": "let fillInPlace: (elt, t) => t"
+ "name": "fromBuffer",
+ "docstrings": [
+ "can throw"
+ ],
+ "signature": "let fromBuffer: array_buffer => t"
},
{
- "id": "Js.Typed_array.Uint32Array.fillFromInPlace",
+ "id": "Js.Typed_array.Uint16Array.fromBufferOffset",
"kind": "value",
- "name": "fillFromInPlace",
- "docstrings": [],
- "signature": "let fillFromInPlace: (elt, ~from: int, t) => t"
+ "name": "fromBufferOffset",
+ "docstrings": [
+ "**raise** Js.Exn.Error raise Js exception\n\n **param** offset is in bytes"
+ ],
+ "signature": "let fromBufferOffset: (array_buffer, int) => t"
},
{
- "id": "Js.Typed_array.Uint32Array.fillRangeInPlace",
+ "id": "Js.Typed_array.Uint16Array.fromBufferRange",
"kind": "value",
- "name": "fillRangeInPlace",
- "docstrings": [],
- "signature": "let fillRangeInPlace: (elt, ~start: int, ~end_: int, t) => t"
+ "name": "fromBufferRange",
+ "docstrings": [
+ "**raise** Js.Exn.Error raises Js exception\n\n **param** offset is in bytes, length in elements"
+ ],
+ "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t"
},
{
- "id": "Js.Typed_array.Uint32Array.reverseInPlace",
+ "id": "Js.Typed_array.Uint16Array.fromLength",
"kind": "value",
- "name": "reverseInPlace",
+ "name": "fromLength",
"docstrings": [],
- "signature": "let reverseInPlace: t => t"
+ "signature": "let fromLength: int => t"
},
{
- "id": "Js.Typed_array.Uint32Array.sortInPlace",
+ "id": "Js.Typed_array.Uint16Array.from",
"kind": "value",
- "name": "sortInPlace",
+ "name": "from",
"docstrings": [],
- "signature": "let sortInPlace: t => t"
- },
+ "signature": "let from: array_like => t"
+ }
+ ]
+ },
+ "js/typed_array/int16array": {
+ "id": "Js.Typed_array.Int16Array",
+ "name": "Int16Array",
+ "docstrings": [],
+ "items": [
{
- "id": "Js.Typed_array.Uint32Array.sortInPlaceWith",
- "kind": "value",
- "name": "sortInPlaceWith",
- "docstrings": [],
- "signature": "let sortInPlaceWith: ((elt, elt) => int, t) => t"
+ "id": "Js.Typed_array.Int16Array.elt",
+ "kind": "type",
+ "name": "elt",
+ "docstrings": [
+ ""
+ ],
+ "signature": "type elt = int"
},
{
- "id": "Js.Typed_array.Uint32Array.includes",
- "kind": "value",
- "name": "includes",
+ "id": "Js.Typed_array.Int16Array.typed_array",
+ "kind": "type",
+ "name": "typed_array",
"docstrings": [],
- "signature": "let includes: (elt, t) => bool"
+ "signature": "type typed_array<\n 'a,\n> = Js_typed_array2.Int16Array.typed_array<'a>"
},
{
- "id": "Js.Typed_array.Uint32Array.indexOf",
- "kind": "value",
- "name": "indexOf",
+ "id": "Js.Typed_array.Int16Array.t",
+ "kind": "type",
+ "name": "t",
"docstrings": [],
- "signature": "let indexOf: (elt, t) => int"
+ "signature": "type t = typed_array"
},
{
- "id": "Js.Typed_array.Uint32Array.indexOfFrom",
+ "id": "Js.Typed_array.Int16Array.unsafe_get",
"kind": "value",
- "name": "indexOfFrom",
+ "name": "unsafe_get",
"docstrings": [],
- "signature": "let indexOfFrom: (elt, ~from: int, t) => int"
+ "signature": "let unsafe_get: (t, int) => elt"
},
{
- "id": "Js.Typed_array.Uint32Array.join",
+ "id": "Js.Typed_array.Int16Array.unsafe_set",
"kind": "value",
- "name": "join",
+ "name": "unsafe_set",
"docstrings": [],
- "signature": "let join: t => string"
+ "signature": "let unsafe_set: (t, int, elt) => unit"
},
{
- "id": "Js.Typed_array.Uint32Array.joinWith",
+ "id": "Js.Typed_array.Int16Array.buffer",
"kind": "value",
- "name": "joinWith",
+ "name": "buffer",
"docstrings": [],
- "signature": "let joinWith: (string, t) => string"
+ "signature": "let buffer: t => array_buffer"
},
{
- "id": "Js.Typed_array.Uint32Array.lastIndexOf",
+ "id": "Js.Typed_array.Int16Array.byteLength",
"kind": "value",
- "name": "lastIndexOf",
+ "name": "byteLength",
"docstrings": [],
- "signature": "let lastIndexOf: (elt, t) => int"
+ "signature": "let byteLength: t => int"
},
{
- "id": "Js.Typed_array.Uint32Array.lastIndexOfFrom",
+ "id": "Js.Typed_array.Int16Array.byteOffset",
"kind": "value",
- "name": "lastIndexOfFrom",
+ "name": "byteOffset",
"docstrings": [],
- "signature": "let lastIndexOfFrom: (elt, ~from: int, t) => int"
+ "signature": "let byteOffset: t => int"
},
{
- "id": "Js.Typed_array.Uint32Array.slice",
+ "id": "Js.Typed_array.Int16Array.length",
"kind": "value",
- "name": "slice",
+ "name": "length",
"docstrings": [],
- "signature": "let slice: (~start: int, ~end_: int, t) => t"
+ "signature": "let length: t => int"
},
{
- "id": "Js.Typed_array.Uint32Array.copy",
+ "id": "Js.Typed_array.Int16Array.copyWithinFromRange",
"kind": "value",
- "name": "copy",
+ "name": "copyWithinFromRange",
"docstrings": [],
- "signature": "let copy: t => t"
+ "signature": "let copyWithinFromRange: (~to_: int, ~start: int, ~end_: int) => t"
},
{
- "id": "Js.Typed_array.Uint32Array.sliceFrom",
+ "id": "Js.Typed_array.Int16Array.slice",
"kind": "value",
- "name": "sliceFrom",
+ "name": "slice",
"docstrings": [],
- "signature": "let sliceFrom: (int, t) => t"
+ "signature": "let slice: (~start: int, ~end_: int) => t"
},
{
- "id": "Js.Typed_array.Uint32Array.subarray",
+ "id": "Js.Typed_array.Int16Array.subarray",
"kind": "value",
"name": "subarray",
"docstrings": [],
- "signature": "let subarray: (~start: int, ~end_: int, t) => t"
- },
- {
- "id": "Js.Typed_array.Uint32Array.subarrayFrom",
- "kind": "value",
- "name": "subarrayFrom",
- "docstrings": [],
- "signature": "let subarrayFrom: (int, t) => t"
- },
- {
- "id": "Js.Typed_array.Uint32Array.toString",
- "kind": "value",
- "name": "toString",
- "docstrings": [],
- "signature": "let toString: t => string"
+ "signature": "let subarray: (~start: int, ~end_: int) => t"
},
{
- "id": "Js.Typed_array.Uint32Array.toLocaleString",
+ "id": "Js.Typed_array.Int16Array._BYTES_PER_ELEMENT",
"kind": "value",
- "name": "toLocaleString",
+ "name": "_BYTES_PER_ELEMENT",
"docstrings": [],
- "signature": "let toLocaleString: t => string"
+ "signature": "let _BYTES_PER_ELEMENT: int"
},
{
- "id": "Js.Typed_array.Uint32Array.every",
+ "id": "Js.Typed_array.Int16Array.make",
"kind": "value",
- "name": "every",
+ "name": "make",
"docstrings": [],
- "signature": "let every: (elt => bool, t) => bool"
+ "signature": "let make: array => t"
},
{
- "id": "Js.Typed_array.Uint32Array.everyi",
+ "id": "Js.Typed_array.Int16Array.fromBuffer",
"kind": "value",
- "name": "everyi",
- "docstrings": [],
- "signature": "let everyi: ((elt, int) => bool, t) => bool"
+ "name": "fromBuffer",
+ "docstrings": [
+ "can throw"
+ ],
+ "signature": "let fromBuffer: array_buffer => t"
},
{
- "id": "Js.Typed_array.Uint32Array.filter",
+ "id": "Js.Typed_array.Int16Array.fromBufferOffset",
"kind": "value",
- "name": "filter",
- "docstrings": [],
- "signature": "let filter: (elt => bool, t) => t"
+ "name": "fromBufferOffset",
+ "docstrings": [
+ "**raise** Js.Exn.Error raise Js exception\n\n **param** offset is in bytes"
+ ],
+ "signature": "let fromBufferOffset: (array_buffer, int) => t"
},
{
- "id": "Js.Typed_array.Uint32Array.filteri",
+ "id": "Js.Typed_array.Int16Array.fromBufferRange",
"kind": "value",
- "name": "filteri",
- "docstrings": [],
- "signature": "let filteri: ((elt, int) => bool, t) => t"
+ "name": "fromBufferRange",
+ "docstrings": [
+ "**raise** Js.Exn.Error raises Js exception\n\n **param** offset is in bytes, length in elements"
+ ],
+ "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t"
},
{
- "id": "Js.Typed_array.Uint32Array.find",
+ "id": "Js.Typed_array.Int16Array.fromLength",
"kind": "value",
- "name": "find",
+ "name": "fromLength",
"docstrings": [],
- "signature": "let find: (elt => bool, t) => Js.undefined"
+ "signature": "let fromLength: int => t"
},
{
- "id": "Js.Typed_array.Uint32Array.findi",
+ "id": "Js.Typed_array.Int16Array.from",
"kind": "value",
- "name": "findi",
+ "name": "from",
"docstrings": [],
- "signature": "let findi: ((elt, int) => bool, t) => Js.undefined"
- },
+ "signature": "let from: array_like => t"
+ }
+ ]
+ },
+ "js/typed_array/uint8clampedarray": {
+ "id": "Js.Typed_array.Uint8ClampedArray",
+ "name": "Uint8ClampedArray",
+ "docstrings": [],
+ "items": [
{
- "id": "Js.Typed_array.Uint32Array.findIndex",
- "kind": "value",
- "name": "findIndex",
- "docstrings": [],
- "signature": "let findIndex: (elt => bool, t) => int"
+ "id": "Js.Typed_array.Uint8ClampedArray.elt",
+ "kind": "type",
+ "name": "elt",
+ "docstrings": [
+ ""
+ ],
+ "signature": "type elt = int"
},
{
- "id": "Js.Typed_array.Uint32Array.findIndexi",
- "kind": "value",
- "name": "findIndexi",
+ "id": "Js.Typed_array.Uint8ClampedArray.typed_array",
+ "kind": "type",
+ "name": "typed_array",
"docstrings": [],
- "signature": "let findIndexi: ((elt, int) => bool, t) => int"
+ "signature": "type typed_array<\n 'a,\n> = Js_typed_array2.Uint8ClampedArray.typed_array<'a>"
},
{
- "id": "Js.Typed_array.Uint32Array.forEach",
- "kind": "value",
- "name": "forEach",
+ "id": "Js.Typed_array.Uint8ClampedArray.t",
+ "kind": "type",
+ "name": "t",
"docstrings": [],
- "signature": "let forEach: (elt => unit, t) => unit"
+ "signature": "type t = typed_array"
},
{
- "id": "Js.Typed_array.Uint32Array.forEachi",
+ "id": "Js.Typed_array.Uint8ClampedArray.unsafe_get",
"kind": "value",
- "name": "forEachi",
+ "name": "unsafe_get",
"docstrings": [],
- "signature": "let forEachi: ((elt, int) => unit, t) => unit"
+ "signature": "let unsafe_get: (t, int) => elt"
},
{
- "id": "Js.Typed_array.Uint32Array.map",
+ "id": "Js.Typed_array.Uint8ClampedArray.unsafe_set",
"kind": "value",
- "name": "map",
+ "name": "unsafe_set",
"docstrings": [],
- "signature": "let map: (elt => 'a, t) => typed_array<'a>"
+ "signature": "let unsafe_set: (t, int, elt) => unit"
},
{
- "id": "Js.Typed_array.Uint32Array.mapi",
+ "id": "Js.Typed_array.Uint8ClampedArray.buffer",
"kind": "value",
- "name": "mapi",
+ "name": "buffer",
"docstrings": [],
- "signature": "let mapi: ((elt, int) => 'a, t) => typed_array<'a>"
+ "signature": "let buffer: t => array_buffer"
},
{
- "id": "Js.Typed_array.Uint32Array.reduce",
+ "id": "Js.Typed_array.Uint8ClampedArray.byteLength",
"kind": "value",
- "name": "reduce",
+ "name": "byteLength",
"docstrings": [],
- "signature": "let reduce: (('a, elt) => 'a, 'a, t) => 'a"
+ "signature": "let byteLength: t => int"
},
{
- "id": "Js.Typed_array.Uint32Array.reducei",
+ "id": "Js.Typed_array.Uint8ClampedArray.byteOffset",
"kind": "value",
- "name": "reducei",
+ "name": "byteOffset",
"docstrings": [],
- "signature": "let reducei: (('a, elt, int) => 'a, 'a, t) => 'a"
+ "signature": "let byteOffset: t => int"
},
{
- "id": "Js.Typed_array.Uint32Array.reduceRight",
+ "id": "Js.Typed_array.Uint8ClampedArray.length",
"kind": "value",
- "name": "reduceRight",
+ "name": "length",
"docstrings": [],
- "signature": "let reduceRight: (('a, elt) => 'a, 'a, t) => 'a"
+ "signature": "let length: t => int"
},
{
- "id": "Js.Typed_array.Uint32Array.reduceRighti",
+ "id": "Js.Typed_array.Uint8ClampedArray.copyWithinFromRange",
"kind": "value",
- "name": "reduceRighti",
+ "name": "copyWithinFromRange",
"docstrings": [],
- "signature": "let reduceRighti: (('a, elt, int) => 'a, 'a, t) => 'a"
+ "signature": "let copyWithinFromRange: (~to_: int, ~start: int, ~end_: int) => t"
},
{
- "id": "Js.Typed_array.Uint32Array.some",
+ "id": "Js.Typed_array.Uint8ClampedArray.slice",
"kind": "value",
- "name": "some",
+ "name": "slice",
"docstrings": [],
- "signature": "let some: (elt => bool, t) => bool"
+ "signature": "let slice: (~start: int, ~end_: int) => t"
},
{
- "id": "Js.Typed_array.Uint32Array.somei",
+ "id": "Js.Typed_array.Uint8ClampedArray.subarray",
"kind": "value",
- "name": "somei",
+ "name": "subarray",
"docstrings": [],
- "signature": "let somei: ((elt, int) => bool, t) => bool"
+ "signature": "let subarray: (~start: int, ~end_: int) => t"
},
{
- "id": "Js.Typed_array.Uint32Array._BYTES_PER_ELEMENT",
+ "id": "Js.Typed_array.Uint8ClampedArray._BYTES_PER_ELEMENT",
"kind": "value",
"name": "_BYTES_PER_ELEMENT",
"docstrings": [],
"signature": "let _BYTES_PER_ELEMENT: int"
},
{
- "id": "Js.Typed_array.Uint32Array.make",
+ "id": "Js.Typed_array.Uint8ClampedArray.make",
"kind": "value",
"name": "make",
"docstrings": [],
"signature": "let make: array => t"
},
{
- "id": "Js.Typed_array.Uint32Array.fromBuffer",
+ "id": "Js.Typed_array.Uint8ClampedArray.fromBuffer",
"kind": "value",
"name": "fromBuffer",
"docstrings": [
@@ -5976,7 +5755,7 @@
"signature": "let fromBuffer: array_buffer => t"
},
{
- "id": "Js.Typed_array.Uint32Array.fromBufferOffset",
+ "id": "Js.Typed_array.Uint8ClampedArray.fromBufferOffset",
"kind": "value",
"name": "fromBufferOffset",
"docstrings": [
@@ -5985,7 +5764,7 @@
"signature": "let fromBufferOffset: (array_buffer, int) => t"
},
{
- "id": "Js.Typed_array.Uint32Array.fromBufferRange",
+ "id": "Js.Typed_array.Uint8ClampedArray.fromBufferRange",
"kind": "value",
"name": "fromBufferRange",
"docstrings": [
@@ -5994,14 +5773,14 @@
"signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t"
},
{
- "id": "Js.Typed_array.Uint32Array.fromLength",
+ "id": "Js.Typed_array.Uint8ClampedArray.fromLength",
"kind": "value",
"name": "fromLength",
"docstrings": [],
"signature": "let fromLength: int => t"
},
{
- "id": "Js.Typed_array.Uint32Array.from",
+ "id": "Js.Typed_array.Uint8ClampedArray.from",
"kind": "value",
"name": "from",
"docstrings": [],
@@ -6009,19 +5788,13 @@
}
]
},
- "js/typed_array/int32_array": {
- "id": "Js.Typed_array.Int32_array",
- "name": "Int32_array",
- "docstrings": [],
- "items": []
- },
- "js/typed_array/int32array": {
- "id": "Js.Typed_array.Int32Array",
- "name": "Int32Array",
+ "js/typed_array/uint8array": {
+ "id": "Js.Typed_array.Uint8Array",
+ "name": "Uint8Array",
"docstrings": [],
"items": [
{
- "id": "Js.Typed_array.Int32Array.elt",
+ "id": "Js.Typed_array.Uint8Array.elt",
"kind": "type",
"name": "elt",
"docstrings": [
@@ -6030,3601 +5803,684 @@
"signature": "type elt = int"
},
{
- "id": "Js.Typed_array.Int32Array.typed_array",
+ "id": "Js.Typed_array.Uint8Array.typed_array",
"kind": "type",
"name": "typed_array",
"docstrings": [],
- "signature": "type typed_array<\n 'a,\n> = Js_typed_array2.Int32Array.typed_array<'a>"
+ "signature": "type typed_array<\n 'a,\n> = Js_typed_array2.Uint8Array.typed_array<'a>"
},
{
- "id": "Js.Typed_array.Int32Array.t",
+ "id": "Js.Typed_array.Uint8Array.t",
"kind": "type",
"name": "t",
"docstrings": [],
"signature": "type t = typed_array"
},
{
- "id": "Js.Typed_array.Int32Array.unsafe_get",
+ "id": "Js.Typed_array.Uint8Array.unsafe_get",
"kind": "value",
"name": "unsafe_get",
"docstrings": [],
"signature": "let unsafe_get: (t, int) => elt"
},
{
- "id": "Js.Typed_array.Int32Array.unsafe_set",
+ "id": "Js.Typed_array.Uint8Array.unsafe_set",
"kind": "value",
"name": "unsafe_set",
"docstrings": [],
"signature": "let unsafe_set: (t, int, elt) => unit"
},
{
- "id": "Js.Typed_array.Int32Array.buffer",
+ "id": "Js.Typed_array.Uint8Array.buffer",
"kind": "value",
"name": "buffer",
"docstrings": [],
"signature": "let buffer: t => array_buffer"
},
{
- "id": "Js.Typed_array.Int32Array.byteLength",
+ "id": "Js.Typed_array.Uint8Array.byteLength",
"kind": "value",
"name": "byteLength",
"docstrings": [],
"signature": "let byteLength: t => int"
},
{
- "id": "Js.Typed_array.Int32Array.byteOffset",
+ "id": "Js.Typed_array.Uint8Array.byteOffset",
"kind": "value",
"name": "byteOffset",
"docstrings": [],
"signature": "let byteOffset: t => int"
},
{
- "id": "Js.Typed_array.Int32Array.setArray",
- "kind": "value",
- "name": "setArray",
- "docstrings": [],
- "signature": "let setArray: (array, t) => unit"
- },
- {
- "id": "Js.Typed_array.Int32Array.setArrayOffset",
- "kind": "value",
- "name": "setArrayOffset",
- "docstrings": [],
- "signature": "let setArrayOffset: (array, int, t) => unit"
- },
- {
- "id": "Js.Typed_array.Int32Array.length",
+ "id": "Js.Typed_array.Uint8Array.length",
"kind": "value",
"name": "length",
"docstrings": [],
"signature": "let length: t => int"
},
{
- "id": "Js.Typed_array.Int32Array.copyWithin",
+ "id": "Js.Typed_array.Uint8Array.copyWithinFromRange",
"kind": "value",
- "name": "copyWithin",
+ "name": "copyWithinFromRange",
"docstrings": [],
- "signature": "let copyWithin: (~to_: int, t) => t"
+ "signature": "let copyWithinFromRange: (~to_: int, ~start: int, ~end_: int) => t"
},
{
- "id": "Js.Typed_array.Int32Array.copyWithinFrom",
+ "id": "Js.Typed_array.Uint8Array.slice",
"kind": "value",
- "name": "copyWithinFrom",
+ "name": "slice",
"docstrings": [],
- "signature": "let copyWithinFrom: (~to_: int, ~from: int, t) => t"
+ "signature": "let slice: (~start: int, ~end_: int) => t"
},
{
- "id": "Js.Typed_array.Int32Array.copyWithinFromRange",
+ "id": "Js.Typed_array.Uint8Array.subarray",
"kind": "value",
- "name": "copyWithinFromRange",
+ "name": "subarray",
"docstrings": [],
- "signature": "let copyWithinFromRange: (~to_: int, ~start: int, ~end_: int, t) => t"
+ "signature": "let subarray: (~start: int, ~end_: int) => t"
},
{
- "id": "Js.Typed_array.Int32Array.fillInPlace",
+ "id": "Js.Typed_array.Uint8Array._BYTES_PER_ELEMENT",
"kind": "value",
- "name": "fillInPlace",
+ "name": "_BYTES_PER_ELEMENT",
"docstrings": [],
- "signature": "let fillInPlace: (elt, t) => t"
+ "signature": "let _BYTES_PER_ELEMENT: int"
},
{
- "id": "Js.Typed_array.Int32Array.fillFromInPlace",
+ "id": "Js.Typed_array.Uint8Array.make",
"kind": "value",
- "name": "fillFromInPlace",
+ "name": "make",
"docstrings": [],
- "signature": "let fillFromInPlace: (elt, ~from: int, t) => t"
+ "signature": "let make: array => t"
},
{
- "id": "Js.Typed_array.Int32Array.fillRangeInPlace",
+ "id": "Js.Typed_array.Uint8Array.fromBuffer",
"kind": "value",
- "name": "fillRangeInPlace",
- "docstrings": [],
- "signature": "let fillRangeInPlace: (elt, ~start: int, ~end_: int, t) => t"
+ "name": "fromBuffer",
+ "docstrings": [
+ "can throw"
+ ],
+ "signature": "let fromBuffer: array_buffer => t"
},
{
- "id": "Js.Typed_array.Int32Array.reverseInPlace",
+ "id": "Js.Typed_array.Uint8Array.fromBufferOffset",
"kind": "value",
- "name": "reverseInPlace",
- "docstrings": [],
- "signature": "let reverseInPlace: t => t"
+ "name": "fromBufferOffset",
+ "docstrings": [
+ "**raise** Js.Exn.Error raise Js exception\n\n **param** offset is in bytes"
+ ],
+ "signature": "let fromBufferOffset: (array_buffer, int) => t"
},
{
- "id": "Js.Typed_array.Int32Array.sortInPlace",
+ "id": "Js.Typed_array.Uint8Array.fromBufferRange",
"kind": "value",
- "name": "sortInPlace",
- "docstrings": [],
- "signature": "let sortInPlace: t => t"
+ "name": "fromBufferRange",
+ "docstrings": [
+ "**raise** Js.Exn.Error raises Js exception\n\n **param** offset is in bytes, length in elements"
+ ],
+ "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t"
},
{
- "id": "Js.Typed_array.Int32Array.sortInPlaceWith",
+ "id": "Js.Typed_array.Uint8Array.fromLength",
"kind": "value",
- "name": "sortInPlaceWith",
+ "name": "fromLength",
"docstrings": [],
- "signature": "let sortInPlaceWith: ((elt, elt) => int, t) => t"
+ "signature": "let fromLength: int => t"
},
{
- "id": "Js.Typed_array.Int32Array.includes",
+ "id": "Js.Typed_array.Uint8Array.from",
"kind": "value",
- "name": "includes",
+ "name": "from",
"docstrings": [],
- "signature": "let includes: (elt, t) => bool"
- },
+ "signature": "let from: array_like => t"
+ }
+ ]
+ },
+ "js/typed_array/int8array": {
+ "id": "Js.Typed_array.Int8Array",
+ "name": "Int8Array",
+ "docstrings": [],
+ "items": [
{
- "id": "Js.Typed_array.Int32Array.indexOf",
- "kind": "value",
- "name": "indexOf",
- "docstrings": [],
- "signature": "let indexOf: (elt, t) => int"
+ "id": "Js.Typed_array.Int8Array.elt",
+ "kind": "type",
+ "name": "elt",
+ "docstrings": [
+ ""
+ ],
+ "signature": "type elt = int"
},
{
- "id": "Js.Typed_array.Int32Array.indexOfFrom",
- "kind": "value",
- "name": "indexOfFrom",
+ "id": "Js.Typed_array.Int8Array.typed_array",
+ "kind": "type",
+ "name": "typed_array",
"docstrings": [],
- "signature": "let indexOfFrom: (elt, ~from: int, t) => int"
+ "signature": "type typed_array<\n 'a,\n> = Js_typed_array2.Int8Array.typed_array<'a>"
},
{
- "id": "Js.Typed_array.Int32Array.join",
- "kind": "value",
- "name": "join",
+ "id": "Js.Typed_array.Int8Array.t",
+ "kind": "type",
+ "name": "t",
"docstrings": [],
- "signature": "let join: t => string"
+ "signature": "type t = typed_array"
},
{
- "id": "Js.Typed_array.Int32Array.joinWith",
+ "id": "Js.Typed_array.Int8Array.unsafe_get",
"kind": "value",
- "name": "joinWith",
+ "name": "unsafe_get",
"docstrings": [],
- "signature": "let joinWith: (string, t) => string"
+ "signature": "let unsafe_get: (t, int) => elt"
},
{
- "id": "Js.Typed_array.Int32Array.lastIndexOf",
+ "id": "Js.Typed_array.Int8Array.unsafe_set",
"kind": "value",
- "name": "lastIndexOf",
+ "name": "unsafe_set",
"docstrings": [],
- "signature": "let lastIndexOf: (elt, t) => int"
+ "signature": "let unsafe_set: (t, int, elt) => unit"
},
{
- "id": "Js.Typed_array.Int32Array.lastIndexOfFrom",
+ "id": "Js.Typed_array.Int8Array.buffer",
"kind": "value",
- "name": "lastIndexOfFrom",
+ "name": "buffer",
"docstrings": [],
- "signature": "let lastIndexOfFrom: (elt, ~from: int, t) => int"
+ "signature": "let buffer: t => array_buffer"
},
{
- "id": "Js.Typed_array.Int32Array.slice",
+ "id": "Js.Typed_array.Int8Array.byteLength",
"kind": "value",
- "name": "slice",
+ "name": "byteLength",
"docstrings": [],
- "signature": "let slice: (~start: int, ~end_: int, t) => t"
+ "signature": "let byteLength: t => int"
},
{
- "id": "Js.Typed_array.Int32Array.copy",
+ "id": "Js.Typed_array.Int8Array.byteOffset",
"kind": "value",
- "name": "copy",
+ "name": "byteOffset",
"docstrings": [],
- "signature": "let copy: t => t"
+ "signature": "let byteOffset: t => int"
},
{
- "id": "Js.Typed_array.Int32Array.sliceFrom",
+ "id": "Js.Typed_array.Int8Array.length",
"kind": "value",
- "name": "sliceFrom",
+ "name": "length",
"docstrings": [],
- "signature": "let sliceFrom: (int, t) => t"
+ "signature": "let length: t => int"
},
{
- "id": "Js.Typed_array.Int32Array.subarray",
+ "id": "Js.Typed_array.Int8Array.copyWithinFromRange",
"kind": "value",
- "name": "subarray",
+ "name": "copyWithinFromRange",
"docstrings": [],
- "signature": "let subarray: (~start: int, ~end_: int, t) => t"
+ "signature": "let copyWithinFromRange: (~to_: int, ~start: int, ~end_: int) => t"
},
{
- "id": "Js.Typed_array.Int32Array.subarrayFrom",
+ "id": "Js.Typed_array.Int8Array.slice",
"kind": "value",
- "name": "subarrayFrom",
+ "name": "slice",
"docstrings": [],
- "signature": "let subarrayFrom: (int, t) => t"
+ "signature": "let slice: (~start: int, ~end_: int) => t"
},
{
- "id": "Js.Typed_array.Int32Array.toString",
+ "id": "Js.Typed_array.Int8Array.subarray",
"kind": "value",
- "name": "toString",
+ "name": "subarray",
"docstrings": [],
- "signature": "let toString: t => string"
+ "signature": "let subarray: (~start: int, ~end_: int) => t"
},
{
- "id": "Js.Typed_array.Int32Array.toLocaleString",
+ "id": "Js.Typed_array.Int8Array._BYTES_PER_ELEMENT",
"kind": "value",
- "name": "toLocaleString",
+ "name": "_BYTES_PER_ELEMENT",
"docstrings": [],
- "signature": "let toLocaleString: t => string"
+ "signature": "let _BYTES_PER_ELEMENT: int"
},
{
- "id": "Js.Typed_array.Int32Array.every",
+ "id": "Js.Typed_array.Int8Array.make",
"kind": "value",
- "name": "every",
+ "name": "make",
"docstrings": [],
- "signature": "let every: (elt => bool, t) => bool"
+ "signature": "let make: array => t"
},
{
- "id": "Js.Typed_array.Int32Array.everyi",
+ "id": "Js.Typed_array.Int8Array.fromBuffer",
"kind": "value",
- "name": "everyi",
- "docstrings": [],
- "signature": "let everyi: ((elt, int) => bool, t) => bool"
+ "name": "fromBuffer",
+ "docstrings": [
+ "can throw"
+ ],
+ "signature": "let fromBuffer: array_buffer => t"
},
{
- "id": "Js.Typed_array.Int32Array.filter",
+ "id": "Js.Typed_array.Int8Array.fromBufferOffset",
"kind": "value",
- "name": "filter",
- "docstrings": [],
- "signature": "let filter: (elt => bool, t) => t"
+ "name": "fromBufferOffset",
+ "docstrings": [
+ "raise Js.Exn.Error raise Js exception\n\n param offset is in bytes"
+ ],
+ "signature": "let fromBufferOffset: (array_buffer, int) => t"
},
{
- "id": "Js.Typed_array.Int32Array.filteri",
+ "id": "Js.Typed_array.Int8Array.fromBufferRange",
"kind": "value",
- "name": "filteri",
- "docstrings": [],
- "signature": "let filteri: ((elt, int) => bool, t) => t"
+ "name": "fromBufferRange",
+ "docstrings": [
+ "raise Js.Exn.Error raises Js exception\n\n param offset is in bytes, length in elements"
+ ],
+ "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t"
},
{
- "id": "Js.Typed_array.Int32Array.find",
+ "id": "Js.Typed_array.Int8Array.fromLength",
"kind": "value",
- "name": "find",
+ "name": "fromLength",
"docstrings": [],
- "signature": "let find: (elt => bool, t) => Js.undefined"
+ "signature": "let fromLength: int => t"
},
{
- "id": "Js.Typed_array.Int32Array.findi",
+ "id": "Js.Typed_array.Int8Array.from",
"kind": "value",
- "name": "findi",
+ "name": "from",
"docstrings": [],
- "signature": "let findi: ((elt, int) => bool, t) => Js.undefined"
- },
+ "signature": "let from: array_like => t"
+ }
+ ]
+ },
+ "js/typed_array/s": {
+ "id": "Js.Typed_array.S",
+ "name": "S",
+ "docstrings": [],
+ "items": [
{
- "id": "Js.Typed_array.Int32Array.findIndex",
- "kind": "value",
- "name": "findIndex",
+ "id": "Js.Typed_array.S.elt",
+ "kind": "type",
+ "name": "elt",
"docstrings": [],
- "signature": "let findIndex: (elt => bool, t) => int"
+ "signature": "type elt"
},
{
- "id": "Js.Typed_array.Int32Array.findIndexi",
- "kind": "value",
- "name": "findIndexi",
+ "id": "Js.Typed_array.S.typed_array",
+ "kind": "type",
+ "name": "typed_array",
"docstrings": [],
- "signature": "let findIndexi: ((elt, int) => bool, t) => int"
+ "signature": "type typed_array<'a>"
},
{
- "id": "Js.Typed_array.Int32Array.forEach",
- "kind": "value",
- "name": "forEach",
+ "id": "Js.Typed_array.S.t",
+ "kind": "type",
+ "name": "t",
"docstrings": [],
- "signature": "let forEach: (elt => unit, t) => unit"
+ "signature": "type t = typed_array"
},
{
- "id": "Js.Typed_array.Int32Array.forEachi",
+ "id": "Js.Typed_array.S.unsafe_get",
"kind": "value",
- "name": "forEachi",
+ "name": "unsafe_get",
"docstrings": [],
- "signature": "let forEachi: ((elt, int) => unit, t) => unit"
+ "signature": "let unsafe_get: (t, int) => elt"
},
{
- "id": "Js.Typed_array.Int32Array.map",
+ "id": "Js.Typed_array.S.unsafe_set",
"kind": "value",
- "name": "map",
+ "name": "unsafe_set",
"docstrings": [],
- "signature": "let map: (elt => 'a, t) => typed_array<'a>"
+ "signature": "let unsafe_set: (t, int, elt) => unit"
},
{
- "id": "Js.Typed_array.Int32Array.mapi",
+ "id": "Js.Typed_array.S.buffer",
"kind": "value",
- "name": "mapi",
+ "name": "buffer",
"docstrings": [],
- "signature": "let mapi: ((elt, int) => 'a, t) => typed_array<'a>"
+ "signature": "let buffer: t => array_buffer"
},
{
- "id": "Js.Typed_array.Int32Array.reduce",
+ "id": "Js.Typed_array.S.byteLength",
"kind": "value",
- "name": "reduce",
+ "name": "byteLength",
"docstrings": [],
- "signature": "let reduce: (('a, elt) => 'a, 'a, t) => 'a"
+ "signature": "let byteLength: t => int"
},
{
- "id": "Js.Typed_array.Int32Array.reducei",
+ "id": "Js.Typed_array.S.byteOffset",
"kind": "value",
- "name": "reducei",
+ "name": "byteOffset",
"docstrings": [],
- "signature": "let reducei: (('a, elt, int) => 'a, 'a, t) => 'a"
+ "signature": "let byteOffset: t => int"
},
{
- "id": "Js.Typed_array.Int32Array.reduceRight",
+ "id": "Js.Typed_array.S.length",
"kind": "value",
- "name": "reduceRight",
+ "name": "length",
"docstrings": [],
- "signature": "let reduceRight: (('a, elt) => 'a, 'a, t) => 'a"
+ "signature": "let length: t => int"
},
{
- "id": "Js.Typed_array.Int32Array.reduceRighti",
+ "id": "Js.Typed_array.S.copyWithinFromRange",
"kind": "value",
- "name": "reduceRighti",
+ "name": "copyWithinFromRange",
"docstrings": [],
- "signature": "let reduceRighti: (('a, elt, int) => 'a, 'a, t) => 'a"
+ "signature": "let copyWithinFromRange: (~to_: int, ~start: int, ~end_: int) => t"
},
{
- "id": "Js.Typed_array.Int32Array.some",
+ "id": "Js.Typed_array.S.includes",
"kind": "value",
- "name": "some",
+ "name": "includes",
"docstrings": [],
- "signature": "let some: (elt => bool, t) => bool"
+ "signature": "let includes: elt => bool"
},
{
- "id": "Js.Typed_array.Int32Array.somei",
+ "id": "Js.Typed_array.S.filter",
"kind": "value",
- "name": "somei",
- "docstrings": [],
- "signature": "let somei: ((elt, int) => bool, t) => bool"
- },
- {
- "id": "Js.Typed_array.Int32Array._BYTES_PER_ELEMENT",
- "kind": "value",
- "name": "_BYTES_PER_ELEMENT",
- "docstrings": [],
- "signature": "let _BYTES_PER_ELEMENT: int"
- },
- {
- "id": "Js.Typed_array.Int32Array.make",
- "kind": "value",
- "name": "make",
- "docstrings": [],
- "signature": "let make: array => t"
- },
- {
- "id": "Js.Typed_array.Int32Array.fromBuffer",
- "kind": "value",
- "name": "fromBuffer",
- "docstrings": [
- "can throw"
- ],
- "signature": "let fromBuffer: array_buffer => t"
- },
- {
- "id": "Js.Typed_array.Int32Array.fromBufferOffset",
- "kind": "value",
- "name": "fromBufferOffset",
- "docstrings": [
- "**raise** Js.Exn.Error raise Js exception\n\n **param** offset is in bytes"
- ],
- "signature": "let fromBufferOffset: (array_buffer, int) => t"
- },
- {
- "id": "Js.Typed_array.Int32Array.fromBufferRange",
- "kind": "value",
- "name": "fromBufferRange",
- "docstrings": [
- "**raise** Js.Exn.Error raises Js exception\n\n **param** offset is in bytes, length in elements"
- ],
- "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t"
- },
- {
- "id": "Js.Typed_array.Int32Array.fromLength",
- "kind": "value",
- "name": "fromLength",
- "docstrings": [],
- "signature": "let fromLength: int => t"
- },
- {
- "id": "Js.Typed_array.Int32Array.from",
- "kind": "value",
- "name": "from",
- "docstrings": [],
- "signature": "let from: array_like => t"
- },
- {
- "id": "Js.Typed_array.Int32Array.create",
- "kind": "value",
- "name": "create",
- "docstrings": [],
- "signature": "let create: array => t",
- "deprecated": "use `make` instead"
- },
- {
- "id": "Js.Typed_array.Int32Array.of_buffer",
- "kind": "value",
- "name": "of_buffer",
- "docstrings": [],
- "signature": "let of_buffer: array_buffer => t",
- "deprecated": "use `fromBuffer` instead"
- }
- ]
- },
- "js/typed_array/uint16array": {
- "id": "Js.Typed_array.Uint16Array",
- "name": "Uint16Array",
- "docstrings": [],
- "items": [
- {
- "id": "Js.Typed_array.Uint16Array.elt",
- "kind": "type",
- "name": "elt",
- "docstrings": [
- ""
- ],
- "signature": "type elt = int"
- },
- {
- "id": "Js.Typed_array.Uint16Array.typed_array",
- "kind": "type",
- "name": "typed_array",
- "docstrings": [],
- "signature": "type typed_array<\n 'a,\n> = Js_typed_array2.Uint16Array.typed_array<'a>"
- },
- {
- "id": "Js.Typed_array.Uint16Array.t",
- "kind": "type",
- "name": "t",
- "docstrings": [],
- "signature": "type t = typed_array"
- },
- {
- "id": "Js.Typed_array.Uint16Array.unsafe_get",
- "kind": "value",
- "name": "unsafe_get",
- "docstrings": [],
- "signature": "let unsafe_get: (t, int) => elt"
- },
- {
- "id": "Js.Typed_array.Uint16Array.unsafe_set",
- "kind": "value",
- "name": "unsafe_set",
- "docstrings": [],
- "signature": "let unsafe_set: (t, int, elt) => unit"
- },
- {
- "id": "Js.Typed_array.Uint16Array.buffer",
- "kind": "value",
- "name": "buffer",
- "docstrings": [],
- "signature": "let buffer: t => array_buffer"
- },
- {
- "id": "Js.Typed_array.Uint16Array.byteLength",
- "kind": "value",
- "name": "byteLength",
- "docstrings": [],
- "signature": "let byteLength: t => int"
- },
- {
- "id": "Js.Typed_array.Uint16Array.byteOffset",
- "kind": "value",
- "name": "byteOffset",
- "docstrings": [],
- "signature": "let byteOffset: t => int"
- },
- {
- "id": "Js.Typed_array.Uint16Array.setArray",
- "kind": "value",
- "name": "setArray",
- "docstrings": [],
- "signature": "let setArray: (array, t) => unit"
- },
- {
- "id": "Js.Typed_array.Uint16Array.setArrayOffset",
- "kind": "value",
- "name": "setArrayOffset",
- "docstrings": [],
- "signature": "let setArrayOffset: (array, int, t) => unit"
- },
- {
- "id": "Js.Typed_array.Uint16Array.length",
- "kind": "value",
- "name": "length",
- "docstrings": [],
- "signature": "let length: t => int"
- },
- {
- "id": "Js.Typed_array.Uint16Array.copyWithin",
- "kind": "value",
- "name": "copyWithin",
- "docstrings": [],
- "signature": "let copyWithin: (~to_: int, t) => t"
- },
- {
- "id": "Js.Typed_array.Uint16Array.copyWithinFrom",
- "kind": "value",
- "name": "copyWithinFrom",
- "docstrings": [],
- "signature": "let copyWithinFrom: (~to_: int, ~from: int, t) => t"
- },
- {
- "id": "Js.Typed_array.Uint16Array.copyWithinFromRange",
- "kind": "value",
- "name": "copyWithinFromRange",
- "docstrings": [],
- "signature": "let copyWithinFromRange: (~to_: int, ~start: int, ~end_: int, t) => t"
- },
- {
- "id": "Js.Typed_array.Uint16Array.fillInPlace",
- "kind": "value",
- "name": "fillInPlace",
- "docstrings": [],
- "signature": "let fillInPlace: (elt, t) => t"
- },
- {
- "id": "Js.Typed_array.Uint16Array.fillFromInPlace",
- "kind": "value",
- "name": "fillFromInPlace",
- "docstrings": [],
- "signature": "let fillFromInPlace: (elt, ~from: int, t) => t"
- },
- {
- "id": "Js.Typed_array.Uint16Array.fillRangeInPlace",
- "kind": "value",
- "name": "fillRangeInPlace",
- "docstrings": [],
- "signature": "let fillRangeInPlace: (elt, ~start: int, ~end_: int, t) => t"
- },
- {
- "id": "Js.Typed_array.Uint16Array.reverseInPlace",
- "kind": "value",
- "name": "reverseInPlace",
- "docstrings": [],
- "signature": "let reverseInPlace: t => t"
- },
- {
- "id": "Js.Typed_array.Uint16Array.sortInPlace",
- "kind": "value",
- "name": "sortInPlace",
- "docstrings": [],
- "signature": "let sortInPlace: t => t"
- },
- {
- "id": "Js.Typed_array.Uint16Array.sortInPlaceWith",
- "kind": "value",
- "name": "sortInPlaceWith",
- "docstrings": [],
- "signature": "let sortInPlaceWith: ((elt, elt) => int, t) => t"
- },
- {
- "id": "Js.Typed_array.Uint16Array.includes",
- "kind": "value",
- "name": "includes",
- "docstrings": [],
- "signature": "let includes: (elt, t) => bool"
- },
- {
- "id": "Js.Typed_array.Uint16Array.indexOf",
- "kind": "value",
- "name": "indexOf",
- "docstrings": [],
- "signature": "let indexOf: (elt, t) => int"
- },
- {
- "id": "Js.Typed_array.Uint16Array.indexOfFrom",
- "kind": "value",
- "name": "indexOfFrom",
- "docstrings": [],
- "signature": "let indexOfFrom: (elt, ~from: int, t) => int"
- },
- {
- "id": "Js.Typed_array.Uint16Array.join",
- "kind": "value",
- "name": "join",
- "docstrings": [],
- "signature": "let join: t => string"
- },
- {
- "id": "Js.Typed_array.Uint16Array.joinWith",
- "kind": "value",
- "name": "joinWith",
- "docstrings": [],
- "signature": "let joinWith: (string, t) => string"
- },
- {
- "id": "Js.Typed_array.Uint16Array.lastIndexOf",
- "kind": "value",
- "name": "lastIndexOf",
- "docstrings": [],
- "signature": "let lastIndexOf: (elt, t) => int"
- },
- {
- "id": "Js.Typed_array.Uint16Array.lastIndexOfFrom",
- "kind": "value",
- "name": "lastIndexOfFrom",
- "docstrings": [],
- "signature": "let lastIndexOfFrom: (elt, ~from: int, t) => int"
- },
- {
- "id": "Js.Typed_array.Uint16Array.slice",
- "kind": "value",
- "name": "slice",
- "docstrings": [],
- "signature": "let slice: (~start: int, ~end_: int, t) => t"
- },
- {
- "id": "Js.Typed_array.Uint16Array.copy",
- "kind": "value",
- "name": "copy",
- "docstrings": [],
- "signature": "let copy: t => t"
- },
- {
- "id": "Js.Typed_array.Uint16Array.sliceFrom",
- "kind": "value",
- "name": "sliceFrom",
- "docstrings": [],
- "signature": "let sliceFrom: (int, t) => t"
- },
- {
- "id": "Js.Typed_array.Uint16Array.subarray",
- "kind": "value",
- "name": "subarray",
- "docstrings": [],
- "signature": "let subarray: (~start: int, ~end_: int, t) => t"
- },
- {
- "id": "Js.Typed_array.Uint16Array.subarrayFrom",
- "kind": "value",
- "name": "subarrayFrom",
- "docstrings": [],
- "signature": "let subarrayFrom: (int, t) => t"
- },
- {
- "id": "Js.Typed_array.Uint16Array.toString",
- "kind": "value",
- "name": "toString",
- "docstrings": [],
- "signature": "let toString: t => string"
- },
- {
- "id": "Js.Typed_array.Uint16Array.toLocaleString",
- "kind": "value",
- "name": "toLocaleString",
- "docstrings": [],
- "signature": "let toLocaleString: t => string"
- },
- {
- "id": "Js.Typed_array.Uint16Array.every",
- "kind": "value",
- "name": "every",
- "docstrings": [],
- "signature": "let every: (elt => bool, t) => bool"
- },
- {
- "id": "Js.Typed_array.Uint16Array.everyi",
- "kind": "value",
- "name": "everyi",
- "docstrings": [],
- "signature": "let everyi: ((elt, int) => bool, t) => bool"
- },
- {
- "id": "Js.Typed_array.Uint16Array.filter",
- "kind": "value",
- "name": "filter",
- "docstrings": [],
- "signature": "let filter: (elt => bool, t) => t"
- },
- {
- "id": "Js.Typed_array.Uint16Array.filteri",
- "kind": "value",
- "name": "filteri",
- "docstrings": [],
- "signature": "let filteri: ((elt, int) => bool, t) => t"
- },
- {
- "id": "Js.Typed_array.Uint16Array.find",
- "kind": "value",
- "name": "find",
- "docstrings": [],
- "signature": "let find: (elt => bool, t) => Js.undefined"
- },
- {
- "id": "Js.Typed_array.Uint16Array.findi",
- "kind": "value",
- "name": "findi",
- "docstrings": [],
- "signature": "let findi: ((elt, int) => bool, t) => Js.undefined"
- },
- {
- "id": "Js.Typed_array.Uint16Array.findIndex",
- "kind": "value",
- "name": "findIndex",
- "docstrings": [],
- "signature": "let findIndex: (elt => bool, t) => int"
- },
- {
- "id": "Js.Typed_array.Uint16Array.findIndexi",
- "kind": "value",
- "name": "findIndexi",
- "docstrings": [],
- "signature": "let findIndexi: ((elt, int) => bool, t) => int"
- },
- {
- "id": "Js.Typed_array.Uint16Array.forEach",
- "kind": "value",
- "name": "forEach",
- "docstrings": [],
- "signature": "let forEach: (elt => unit, t) => unit"
- },
- {
- "id": "Js.Typed_array.Uint16Array.forEachi",
- "kind": "value",
- "name": "forEachi",
- "docstrings": [],
- "signature": "let forEachi: ((elt, int) => unit, t) => unit"
- },
- {
- "id": "Js.Typed_array.Uint16Array.map",
- "kind": "value",
- "name": "map",
- "docstrings": [],
- "signature": "let map: (elt => 'a, t) => typed_array<'a>"
- },
- {
- "id": "Js.Typed_array.Uint16Array.mapi",
- "kind": "value",
- "name": "mapi",
- "docstrings": [],
- "signature": "let mapi: ((elt, int) => 'a, t) => typed_array<'a>"
- },
- {
- "id": "Js.Typed_array.Uint16Array.reduce",
- "kind": "value",
- "name": "reduce",
- "docstrings": [],
- "signature": "let reduce: (('a, elt) => 'a, 'a, t) => 'a"
- },
- {
- "id": "Js.Typed_array.Uint16Array.reducei",
- "kind": "value",
- "name": "reducei",
- "docstrings": [],
- "signature": "let reducei: (('a, elt, int) => 'a, 'a, t) => 'a"
- },
- {
- "id": "Js.Typed_array.Uint16Array.reduceRight",
- "kind": "value",
- "name": "reduceRight",
- "docstrings": [],
- "signature": "let reduceRight: (('a, elt) => 'a, 'a, t) => 'a"
- },
- {
- "id": "Js.Typed_array.Uint16Array.reduceRighti",
- "kind": "value",
- "name": "reduceRighti",
- "docstrings": [],
- "signature": "let reduceRighti: (('a, elt, int) => 'a, 'a, t) => 'a"
- },
- {
- "id": "Js.Typed_array.Uint16Array.some",
- "kind": "value",
- "name": "some",
- "docstrings": [],
- "signature": "let some: (elt => bool, t) => bool"
- },
- {
- "id": "Js.Typed_array.Uint16Array.somei",
- "kind": "value",
- "name": "somei",
- "docstrings": [],
- "signature": "let somei: ((elt, int) => bool, t) => bool"
- },
- {
- "id": "Js.Typed_array.Uint16Array._BYTES_PER_ELEMENT",
- "kind": "value",
- "name": "_BYTES_PER_ELEMENT",
- "docstrings": [],
- "signature": "let _BYTES_PER_ELEMENT: int"
- },
- {
- "id": "Js.Typed_array.Uint16Array.make",
- "kind": "value",
- "name": "make",
- "docstrings": [],
- "signature": "let make: array => t"
- },
- {
- "id": "Js.Typed_array.Uint16Array.fromBuffer",
- "kind": "value",
- "name": "fromBuffer",
- "docstrings": [
- "can throw"
- ],
- "signature": "let fromBuffer: array_buffer => t"
- },
- {
- "id": "Js.Typed_array.Uint16Array.fromBufferOffset",
- "kind": "value",
- "name": "fromBufferOffset",
- "docstrings": [
- "**raise** Js.Exn.Error raise Js exception\n\n **param** offset is in bytes"
- ],
- "signature": "let fromBufferOffset: (array_buffer, int) => t"
- },
- {
- "id": "Js.Typed_array.Uint16Array.fromBufferRange",
- "kind": "value",
- "name": "fromBufferRange",
- "docstrings": [
- "**raise** Js.Exn.Error raises Js exception\n\n **param** offset is in bytes, length in elements"
- ],
- "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t"
- },
- {
- "id": "Js.Typed_array.Uint16Array.fromLength",
- "kind": "value",
- "name": "fromLength",
- "docstrings": [],
- "signature": "let fromLength: int => t"
- },
- {
- "id": "Js.Typed_array.Uint16Array.from",
- "kind": "value",
- "name": "from",
- "docstrings": [],
- "signature": "let from: array_like => t"
- }
- ]
- },
- "js/typed_array/int16array": {
- "id": "Js.Typed_array.Int16Array",
- "name": "Int16Array",
- "docstrings": [],
- "items": [
- {
- "id": "Js.Typed_array.Int16Array.elt",
- "kind": "type",
- "name": "elt",
- "docstrings": [
- ""
- ],
- "signature": "type elt = int"
- },
- {
- "id": "Js.Typed_array.Int16Array.typed_array",
- "kind": "type",
- "name": "typed_array",
- "docstrings": [],
- "signature": "type typed_array<\n 'a,\n> = Js_typed_array2.Int16Array.typed_array<'a>"
- },
- {
- "id": "Js.Typed_array.Int16Array.t",
- "kind": "type",
- "name": "t",
- "docstrings": [],
- "signature": "type t = typed_array"
- },
- {
- "id": "Js.Typed_array.Int16Array.unsafe_get",
- "kind": "value",
- "name": "unsafe_get",
- "docstrings": [],
- "signature": "let unsafe_get: (t, int) => elt"
- },
- {
- "id": "Js.Typed_array.Int16Array.unsafe_set",
- "kind": "value",
- "name": "unsafe_set",
- "docstrings": [],
- "signature": "let unsafe_set: (t, int, elt) => unit"
- },
- {
- "id": "Js.Typed_array.Int16Array.buffer",
- "kind": "value",
- "name": "buffer",
- "docstrings": [],
- "signature": "let buffer: t => array_buffer"
- },
- {
- "id": "Js.Typed_array.Int16Array.byteLength",
- "kind": "value",
- "name": "byteLength",
- "docstrings": [],
- "signature": "let byteLength: t => int"
- },
- {
- "id": "Js.Typed_array.Int16Array.byteOffset",
- "kind": "value",
- "name": "byteOffset",
- "docstrings": [],
- "signature": "let byteOffset: t => int"
- },
- {
- "id": "Js.Typed_array.Int16Array.setArray",
- "kind": "value",
- "name": "setArray",
- "docstrings": [],
- "signature": "let setArray: (array, t) => unit"
- },
- {
- "id": "Js.Typed_array.Int16Array.setArrayOffset",
- "kind": "value",
- "name": "setArrayOffset",
- "docstrings": [],
- "signature": "let setArrayOffset: (array, int, t) => unit"
- },
- {
- "id": "Js.Typed_array.Int16Array.length",
- "kind": "value",
- "name": "length",
- "docstrings": [],
- "signature": "let length: t => int"
- },
- {
- "id": "Js.Typed_array.Int16Array.copyWithin",
- "kind": "value",
- "name": "copyWithin",
- "docstrings": [],
- "signature": "let copyWithin: (~to_: int, t) => t"
- },
- {
- "id": "Js.Typed_array.Int16Array.copyWithinFrom",
- "kind": "value",
- "name": "copyWithinFrom",
- "docstrings": [],
- "signature": "let copyWithinFrom: (~to_: int, ~from: int, t) => t"
- },
- {
- "id": "Js.Typed_array.Int16Array.copyWithinFromRange",
- "kind": "value",
- "name": "copyWithinFromRange",
- "docstrings": [],
- "signature": "let copyWithinFromRange: (~to_: int, ~start: int, ~end_: int, t) => t"
- },
- {
- "id": "Js.Typed_array.Int16Array.fillInPlace",
- "kind": "value",
- "name": "fillInPlace",
- "docstrings": [],
- "signature": "let fillInPlace: (elt, t) => t"
- },
- {
- "id": "Js.Typed_array.Int16Array.fillFromInPlace",
- "kind": "value",
- "name": "fillFromInPlace",
- "docstrings": [],
- "signature": "let fillFromInPlace: (elt, ~from: int, t) => t"
- },
- {
- "id": "Js.Typed_array.Int16Array.fillRangeInPlace",
- "kind": "value",
- "name": "fillRangeInPlace",
- "docstrings": [],
- "signature": "let fillRangeInPlace: (elt, ~start: int, ~end_: int, t) => t"
- },
- {
- "id": "Js.Typed_array.Int16Array.reverseInPlace",
- "kind": "value",
- "name": "reverseInPlace",
- "docstrings": [],
- "signature": "let reverseInPlace: t => t"
- },
- {
- "id": "Js.Typed_array.Int16Array.sortInPlace",
- "kind": "value",
- "name": "sortInPlace",
- "docstrings": [],
- "signature": "let sortInPlace: t => t"
- },
- {
- "id": "Js.Typed_array.Int16Array.sortInPlaceWith",
- "kind": "value",
- "name": "sortInPlaceWith",
- "docstrings": [],
- "signature": "let sortInPlaceWith: ((elt, elt) => int, t) => t"
- },
- {
- "id": "Js.Typed_array.Int16Array.includes",
- "kind": "value",
- "name": "includes",
- "docstrings": [],
- "signature": "let includes: (elt, t) => bool"
- },
- {
- "id": "Js.Typed_array.Int16Array.indexOf",
- "kind": "value",
- "name": "indexOf",
- "docstrings": [],
- "signature": "let indexOf: (elt, t) => int"
- },
- {
- "id": "Js.Typed_array.Int16Array.indexOfFrom",
- "kind": "value",
- "name": "indexOfFrom",
- "docstrings": [],
- "signature": "let indexOfFrom: (elt, ~from: int, t) => int"
- },
- {
- "id": "Js.Typed_array.Int16Array.join",
- "kind": "value",
- "name": "join",
- "docstrings": [],
- "signature": "let join: t => string"
- },
- {
- "id": "Js.Typed_array.Int16Array.joinWith",
- "kind": "value",
- "name": "joinWith",
- "docstrings": [],
- "signature": "let joinWith: (string, t) => string"
- },
- {
- "id": "Js.Typed_array.Int16Array.lastIndexOf",
- "kind": "value",
- "name": "lastIndexOf",
- "docstrings": [],
- "signature": "let lastIndexOf: (elt, t) => int"
- },
- {
- "id": "Js.Typed_array.Int16Array.lastIndexOfFrom",
- "kind": "value",
- "name": "lastIndexOfFrom",
- "docstrings": [],
- "signature": "let lastIndexOfFrom: (elt, ~from: int, t) => int"
- },
- {
- "id": "Js.Typed_array.Int16Array.slice",
- "kind": "value",
- "name": "slice",
- "docstrings": [],
- "signature": "let slice: (~start: int, ~end_: int, t) => t"
- },
- {
- "id": "Js.Typed_array.Int16Array.copy",
- "kind": "value",
- "name": "copy",
- "docstrings": [],
- "signature": "let copy: t => t"
- },
- {
- "id": "Js.Typed_array.Int16Array.sliceFrom",
- "kind": "value",
- "name": "sliceFrom",
- "docstrings": [],
- "signature": "let sliceFrom: (int, t) => t"
- },
- {
- "id": "Js.Typed_array.Int16Array.subarray",
- "kind": "value",
- "name": "subarray",
- "docstrings": [],
- "signature": "let subarray: (~start: int, ~end_: int, t) => t"
- },
- {
- "id": "Js.Typed_array.Int16Array.subarrayFrom",
- "kind": "value",
- "name": "subarrayFrom",
- "docstrings": [],
- "signature": "let subarrayFrom: (int, t) => t"
- },
- {
- "id": "Js.Typed_array.Int16Array.toString",
- "kind": "value",
- "name": "toString",
- "docstrings": [],
- "signature": "let toString: t => string"
- },
- {
- "id": "Js.Typed_array.Int16Array.toLocaleString",
- "kind": "value",
- "name": "toLocaleString",
- "docstrings": [],
- "signature": "let toLocaleString: t => string"
- },
- {
- "id": "Js.Typed_array.Int16Array.every",
- "kind": "value",
- "name": "every",
- "docstrings": [],
- "signature": "let every: (elt => bool, t) => bool"
- },
- {
- "id": "Js.Typed_array.Int16Array.everyi",
- "kind": "value",
- "name": "everyi",
- "docstrings": [],
- "signature": "let everyi: ((elt, int) => bool, t) => bool"
- },
- {
- "id": "Js.Typed_array.Int16Array.filter",
- "kind": "value",
- "name": "filter",
- "docstrings": [],
- "signature": "let filter: (elt => bool, t) => t"
- },
- {
- "id": "Js.Typed_array.Int16Array.filteri",
- "kind": "value",
- "name": "filteri",
- "docstrings": [],
- "signature": "let filteri: ((elt, int) => bool, t) => t"
- },
- {
- "id": "Js.Typed_array.Int16Array.find",
- "kind": "value",
- "name": "find",
- "docstrings": [],
- "signature": "let find: (elt => bool, t) => Js.undefined"
- },
- {
- "id": "Js.Typed_array.Int16Array.findi",
- "kind": "value",
- "name": "findi",
- "docstrings": [],
- "signature": "let findi: ((elt, int) => bool, t) => Js.undefined"
- },
- {
- "id": "Js.Typed_array.Int16Array.findIndex",
- "kind": "value",
- "name": "findIndex",
- "docstrings": [],
- "signature": "let findIndex: (elt => bool, t) => int"
- },
- {
- "id": "Js.Typed_array.Int16Array.findIndexi",
- "kind": "value",
- "name": "findIndexi",
- "docstrings": [],
- "signature": "let findIndexi: ((elt, int) => bool, t) => int"
- },
- {
- "id": "Js.Typed_array.Int16Array.forEach",
- "kind": "value",
- "name": "forEach",
- "docstrings": [],
- "signature": "let forEach: (elt => unit, t) => unit"
- },
- {
- "id": "Js.Typed_array.Int16Array.forEachi",
- "kind": "value",
- "name": "forEachi",
- "docstrings": [],
- "signature": "let forEachi: ((elt, int) => unit, t) => unit"
- },
- {
- "id": "Js.Typed_array.Int16Array.map",
- "kind": "value",
- "name": "map",
- "docstrings": [],
- "signature": "let map: (elt => 'a, t) => typed_array<'a>"
- },
- {
- "id": "Js.Typed_array.Int16Array.mapi",
- "kind": "value",
- "name": "mapi",
- "docstrings": [],
- "signature": "let mapi: ((elt, int) => 'a, t) => typed_array<'a>"
- },
- {
- "id": "Js.Typed_array.Int16Array.reduce",
- "kind": "value",
- "name": "reduce",
- "docstrings": [],
- "signature": "let reduce: (('a, elt) => 'a, 'a, t) => 'a"
- },
- {
- "id": "Js.Typed_array.Int16Array.reducei",
- "kind": "value",
- "name": "reducei",
- "docstrings": [],
- "signature": "let reducei: (('a, elt, int) => 'a, 'a, t) => 'a"
- },
- {
- "id": "Js.Typed_array.Int16Array.reduceRight",
- "kind": "value",
- "name": "reduceRight",
- "docstrings": [],
- "signature": "let reduceRight: (('a, elt) => 'a, 'a, t) => 'a"
- },
- {
- "id": "Js.Typed_array.Int16Array.reduceRighti",
- "kind": "value",
- "name": "reduceRighti",
- "docstrings": [],
- "signature": "let reduceRighti: (('a, elt, int) => 'a, 'a, t) => 'a"
- },
- {
- "id": "Js.Typed_array.Int16Array.some",
- "kind": "value",
- "name": "some",
- "docstrings": [],
- "signature": "let some: (elt => bool, t) => bool"
- },
- {
- "id": "Js.Typed_array.Int16Array.somei",
- "kind": "value",
- "name": "somei",
- "docstrings": [],
- "signature": "let somei: ((elt, int) => bool, t) => bool"
- },
- {
- "id": "Js.Typed_array.Int16Array._BYTES_PER_ELEMENT",
- "kind": "value",
- "name": "_BYTES_PER_ELEMENT",
- "docstrings": [],
- "signature": "let _BYTES_PER_ELEMENT: int"
- },
- {
- "id": "Js.Typed_array.Int16Array.make",
- "kind": "value",
- "name": "make",
- "docstrings": [],
- "signature": "let make: array => t"
- },
- {
- "id": "Js.Typed_array.Int16Array.fromBuffer",
- "kind": "value",
- "name": "fromBuffer",
- "docstrings": [
- "can throw"
- ],
- "signature": "let fromBuffer: array_buffer => t"
- },
- {
- "id": "Js.Typed_array.Int16Array.fromBufferOffset",
- "kind": "value",
- "name": "fromBufferOffset",
- "docstrings": [
- "**raise** Js.Exn.Error raise Js exception\n\n **param** offset is in bytes"
- ],
- "signature": "let fromBufferOffset: (array_buffer, int) => t"
- },
- {
- "id": "Js.Typed_array.Int16Array.fromBufferRange",
- "kind": "value",
- "name": "fromBufferRange",
- "docstrings": [
- "**raise** Js.Exn.Error raises Js exception\n\n **param** offset is in bytes, length in elements"
- ],
- "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t"
- },
- {
- "id": "Js.Typed_array.Int16Array.fromLength",
- "kind": "value",
- "name": "fromLength",
- "docstrings": [],
- "signature": "let fromLength: int => t"
- },
- {
- "id": "Js.Typed_array.Int16Array.from",
- "kind": "value",
- "name": "from",
- "docstrings": [],
- "signature": "let from: array_like => t"
- }
- ]
- },
- "js/typed_array/uint8clampedarray": {
- "id": "Js.Typed_array.Uint8ClampedArray",
- "name": "Uint8ClampedArray",
- "docstrings": [],
- "items": [
- {
- "id": "Js.Typed_array.Uint8ClampedArray.elt",
- "kind": "type",
- "name": "elt",
- "docstrings": [
- ""
- ],
- "signature": "type elt = int"
- },
- {
- "id": "Js.Typed_array.Uint8ClampedArray.typed_array",
- "kind": "type",
- "name": "typed_array",
- "docstrings": [],
- "signature": "type typed_array<\n 'a,\n> = Js_typed_array2.Uint8ClampedArray.typed_array<'a>"
- },
- {
- "id": "Js.Typed_array.Uint8ClampedArray.t",
- "kind": "type",
- "name": "t",
- "docstrings": [],
- "signature": "type t = typed_array"
- },
- {
- "id": "Js.Typed_array.Uint8ClampedArray.unsafe_get",
- "kind": "value",
- "name": "unsafe_get",
- "docstrings": [],
- "signature": "let unsafe_get: (t, int) => elt"
- },
- {
- "id": "Js.Typed_array.Uint8ClampedArray.unsafe_set",
- "kind": "value",
- "name": "unsafe_set",
- "docstrings": [],
- "signature": "let unsafe_set: (t, int, elt) => unit"
- },
- {
- "id": "Js.Typed_array.Uint8ClampedArray.buffer",
- "kind": "value",
- "name": "buffer",
- "docstrings": [],
- "signature": "let buffer: t => array_buffer"
- },
- {
- "id": "Js.Typed_array.Uint8ClampedArray.byteLength",
- "kind": "value",
- "name": "byteLength",
- "docstrings": [],
- "signature": "let byteLength: t => int"
- },
- {
- "id": "Js.Typed_array.Uint8ClampedArray.byteOffset",
- "kind": "value",
- "name": "byteOffset",
- "docstrings": [],
- "signature": "let byteOffset: t => int"
- },
- {
- "id": "Js.Typed_array.Uint8ClampedArray.setArray",
- "kind": "value",
- "name": "setArray",
- "docstrings": [],
- "signature": "let setArray: (array, t) => unit"
- },
- {
- "id": "Js.Typed_array.Uint8ClampedArray.setArrayOffset",
- "kind": "value",
- "name": "setArrayOffset",
- "docstrings": [],
- "signature": "let setArrayOffset: (array, int, t) => unit"
- },
- {
- "id": "Js.Typed_array.Uint8ClampedArray.length",
- "kind": "value",
- "name": "length",
- "docstrings": [],
- "signature": "let length: t => int"
- },
- {
- "id": "Js.Typed_array.Uint8ClampedArray.copyWithin",
- "kind": "value",
- "name": "copyWithin",
- "docstrings": [],
- "signature": "let copyWithin: (~to_: int, t) => t"
- },
- {
- "id": "Js.Typed_array.Uint8ClampedArray.copyWithinFrom",
- "kind": "value",
- "name": "copyWithinFrom",
- "docstrings": [],
- "signature": "let copyWithinFrom: (~to_: int, ~from: int, t) => t"
- },
- {
- "id": "Js.Typed_array.Uint8ClampedArray.copyWithinFromRange",
- "kind": "value",
- "name": "copyWithinFromRange",
- "docstrings": [],
- "signature": "let copyWithinFromRange: (~to_: int, ~start: int, ~end_: int, t) => t"
- },
- {
- "id": "Js.Typed_array.Uint8ClampedArray.fillInPlace",
- "kind": "value",
- "name": "fillInPlace",
- "docstrings": [],
- "signature": "let fillInPlace: (elt, t) => t"
- },
- {
- "id": "Js.Typed_array.Uint8ClampedArray.fillFromInPlace",
- "kind": "value",
- "name": "fillFromInPlace",
- "docstrings": [],
- "signature": "let fillFromInPlace: (elt, ~from: int, t) => t"
- },
- {
- "id": "Js.Typed_array.Uint8ClampedArray.fillRangeInPlace",
- "kind": "value",
- "name": "fillRangeInPlace",
- "docstrings": [],
- "signature": "let fillRangeInPlace: (elt, ~start: int, ~end_: int, t) => t"
- },
- {
- "id": "Js.Typed_array.Uint8ClampedArray.reverseInPlace",
- "kind": "value",
- "name": "reverseInPlace",
- "docstrings": [],
- "signature": "let reverseInPlace: t => t"
- },
- {
- "id": "Js.Typed_array.Uint8ClampedArray.sortInPlace",
- "kind": "value",
- "name": "sortInPlace",
- "docstrings": [],
- "signature": "let sortInPlace: t => t"
- },
- {
- "id": "Js.Typed_array.Uint8ClampedArray.sortInPlaceWith",
- "kind": "value",
- "name": "sortInPlaceWith",
- "docstrings": [],
- "signature": "let sortInPlaceWith: ((elt, elt) => int, t) => t"
- },
- {
- "id": "Js.Typed_array.Uint8ClampedArray.includes",
- "kind": "value",
- "name": "includes",
- "docstrings": [],
- "signature": "let includes: (elt, t) => bool"
- },
- {
- "id": "Js.Typed_array.Uint8ClampedArray.indexOf",
- "kind": "value",
- "name": "indexOf",
- "docstrings": [],
- "signature": "let indexOf: (elt, t) => int"
- },
- {
- "id": "Js.Typed_array.Uint8ClampedArray.indexOfFrom",
- "kind": "value",
- "name": "indexOfFrom",
- "docstrings": [],
- "signature": "let indexOfFrom: (elt, ~from: int, t) => int"
- },
- {
- "id": "Js.Typed_array.Uint8ClampedArray.join",
- "kind": "value",
- "name": "join",
- "docstrings": [],
- "signature": "let join: t => string"
- },
- {
- "id": "Js.Typed_array.Uint8ClampedArray.joinWith",
- "kind": "value",
- "name": "joinWith",
- "docstrings": [],
- "signature": "let joinWith: (string, t) => string"
- },
- {
- "id": "Js.Typed_array.Uint8ClampedArray.lastIndexOf",
- "kind": "value",
- "name": "lastIndexOf",
- "docstrings": [],
- "signature": "let lastIndexOf: (elt, t) => int"
- },
- {
- "id": "Js.Typed_array.Uint8ClampedArray.lastIndexOfFrom",
- "kind": "value",
- "name": "lastIndexOfFrom",
- "docstrings": [],
- "signature": "let lastIndexOfFrom: (elt, ~from: int, t) => int"
- },
- {
- "id": "Js.Typed_array.Uint8ClampedArray.slice",
- "kind": "value",
- "name": "slice",
- "docstrings": [],
- "signature": "let slice: (~start: int, ~end_: int, t) => t"
- },
- {
- "id": "Js.Typed_array.Uint8ClampedArray.copy",
- "kind": "value",
- "name": "copy",
- "docstrings": [],
- "signature": "let copy: t => t"
- },
- {
- "id": "Js.Typed_array.Uint8ClampedArray.sliceFrom",
- "kind": "value",
- "name": "sliceFrom",
- "docstrings": [],
- "signature": "let sliceFrom: (int, t) => t"
- },
- {
- "id": "Js.Typed_array.Uint8ClampedArray.subarray",
- "kind": "value",
- "name": "subarray",
- "docstrings": [],
- "signature": "let subarray: (~start: int, ~end_: int, t) => t"
- },
- {
- "id": "Js.Typed_array.Uint8ClampedArray.subarrayFrom",
- "kind": "value",
- "name": "subarrayFrom",
- "docstrings": [],
- "signature": "let subarrayFrom: (int, t) => t"
- },
- {
- "id": "Js.Typed_array.Uint8ClampedArray.toString",
- "kind": "value",
- "name": "toString",
- "docstrings": [],
- "signature": "let toString: t => string"
- },
- {
- "id": "Js.Typed_array.Uint8ClampedArray.toLocaleString",
- "kind": "value",
- "name": "toLocaleString",
- "docstrings": [],
- "signature": "let toLocaleString: t => string"
- },
- {
- "id": "Js.Typed_array.Uint8ClampedArray.every",
- "kind": "value",
- "name": "every",
- "docstrings": [],
- "signature": "let every: (elt => bool, t) => bool"
- },
- {
- "id": "Js.Typed_array.Uint8ClampedArray.everyi",
- "kind": "value",
- "name": "everyi",
- "docstrings": [],
- "signature": "let everyi: ((elt, int) => bool, t) => bool"
- },
- {
- "id": "Js.Typed_array.Uint8ClampedArray.filter",
- "kind": "value",
- "name": "filter",
- "docstrings": [],
- "signature": "let filter: (elt => bool, t) => t"
- },
- {
- "id": "Js.Typed_array.Uint8ClampedArray.filteri",
- "kind": "value",
- "name": "filteri",
- "docstrings": [],
- "signature": "let filteri: ((elt, int) => bool, t) => t"
- },
- {
- "id": "Js.Typed_array.Uint8ClampedArray.find",
- "kind": "value",
- "name": "find",
- "docstrings": [],
- "signature": "let find: (elt => bool, t) => Js.undefined"
- },
- {
- "id": "Js.Typed_array.Uint8ClampedArray.findi",
- "kind": "value",
- "name": "findi",
- "docstrings": [],
- "signature": "let findi: ((elt, int) => bool, t) => Js.undefined"
- },
- {
- "id": "Js.Typed_array.Uint8ClampedArray.findIndex",
- "kind": "value",
- "name": "findIndex",
- "docstrings": [],
- "signature": "let findIndex: (elt => bool, t) => int"
- },
- {
- "id": "Js.Typed_array.Uint8ClampedArray.findIndexi",
- "kind": "value",
- "name": "findIndexi",
- "docstrings": [],
- "signature": "let findIndexi: ((elt, int) => bool, t) => int"
- },
- {
- "id": "Js.Typed_array.Uint8ClampedArray.forEach",
- "kind": "value",
- "name": "forEach",
- "docstrings": [],
- "signature": "let forEach: (elt => unit, t) => unit"
- },
- {
- "id": "Js.Typed_array.Uint8ClampedArray.forEachi",
- "kind": "value",
- "name": "forEachi",
- "docstrings": [],
- "signature": "let forEachi: ((elt, int) => unit, t) => unit"
- },
- {
- "id": "Js.Typed_array.Uint8ClampedArray.map",
- "kind": "value",
- "name": "map",
- "docstrings": [],
- "signature": "let map: (elt => 'a, t) => typed_array<'a>"
- },
- {
- "id": "Js.Typed_array.Uint8ClampedArray.mapi",
- "kind": "value",
- "name": "mapi",
- "docstrings": [],
- "signature": "let mapi: ((elt, int) => 'a, t) => typed_array<'a>"
- },
- {
- "id": "Js.Typed_array.Uint8ClampedArray.reduce",
- "kind": "value",
- "name": "reduce",
- "docstrings": [],
- "signature": "let reduce: (('a, elt) => 'a, 'a, t) => 'a"
- },
- {
- "id": "Js.Typed_array.Uint8ClampedArray.reducei",
- "kind": "value",
- "name": "reducei",
- "docstrings": [],
- "signature": "let reducei: (('a, elt, int) => 'a, 'a, t) => 'a"
- },
- {
- "id": "Js.Typed_array.Uint8ClampedArray.reduceRight",
- "kind": "value",
- "name": "reduceRight",
- "docstrings": [],
- "signature": "let reduceRight: (('a, elt) => 'a, 'a, t) => 'a"
- },
- {
- "id": "Js.Typed_array.Uint8ClampedArray.reduceRighti",
- "kind": "value",
- "name": "reduceRighti",
- "docstrings": [],
- "signature": "let reduceRighti: (('a, elt, int) => 'a, 'a, t) => 'a"
- },
- {
- "id": "Js.Typed_array.Uint8ClampedArray.some",
- "kind": "value",
- "name": "some",
- "docstrings": [],
- "signature": "let some: (elt => bool, t) => bool"
- },
- {
- "id": "Js.Typed_array.Uint8ClampedArray.somei",
- "kind": "value",
- "name": "somei",
- "docstrings": [],
- "signature": "let somei: ((elt, int) => bool, t) => bool"
- },
- {
- "id": "Js.Typed_array.Uint8ClampedArray._BYTES_PER_ELEMENT",
- "kind": "value",
- "name": "_BYTES_PER_ELEMENT",
- "docstrings": [],
- "signature": "let _BYTES_PER_ELEMENT: int"
- },
- {
- "id": "Js.Typed_array.Uint8ClampedArray.make",
- "kind": "value",
- "name": "make",
- "docstrings": [],
- "signature": "let make: array => t"
- },
- {
- "id": "Js.Typed_array.Uint8ClampedArray.fromBuffer",
- "kind": "value",
- "name": "fromBuffer",
- "docstrings": [
- "can throw"
- ],
- "signature": "let fromBuffer: array_buffer => t"
- },
- {
- "id": "Js.Typed_array.Uint8ClampedArray.fromBufferOffset",
- "kind": "value",
- "name": "fromBufferOffset",
- "docstrings": [
- "**raise** Js.Exn.Error raise Js exception\n\n **param** offset is in bytes"
- ],
- "signature": "let fromBufferOffset: (array_buffer, int) => t"
- },
- {
- "id": "Js.Typed_array.Uint8ClampedArray.fromBufferRange",
- "kind": "value",
- "name": "fromBufferRange",
- "docstrings": [
- "**raise** Js.Exn.Error raises Js exception\n\n **param** offset is in bytes, length in elements"
- ],
- "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t"
- },
- {
- "id": "Js.Typed_array.Uint8ClampedArray.fromLength",
- "kind": "value",
- "name": "fromLength",
- "docstrings": [],
- "signature": "let fromLength: int => t"
- },
- {
- "id": "Js.Typed_array.Uint8ClampedArray.from",
- "kind": "value",
- "name": "from",
- "docstrings": [],
- "signature": "let from: array_like => t"
- }
- ]
- },
- "js/typed_array/uint8array": {
- "id": "Js.Typed_array.Uint8Array",
- "name": "Uint8Array",
- "docstrings": [],
- "items": [
- {
- "id": "Js.Typed_array.Uint8Array.elt",
- "kind": "type",
- "name": "elt",
- "docstrings": [
- ""
- ],
- "signature": "type elt = int"
- },
- {
- "id": "Js.Typed_array.Uint8Array.typed_array",
- "kind": "type",
- "name": "typed_array",
- "docstrings": [],
- "signature": "type typed_array<\n 'a,\n> = Js_typed_array2.Uint8Array.typed_array<'a>"
- },
- {
- "id": "Js.Typed_array.Uint8Array.t",
- "kind": "type",
- "name": "t",
- "docstrings": [],
- "signature": "type t = typed_array"
- },
- {
- "id": "Js.Typed_array.Uint8Array.unsafe_get",
- "kind": "value",
- "name": "unsafe_get",
- "docstrings": [],
- "signature": "let unsafe_get: (t, int) => elt"
- },
- {
- "id": "Js.Typed_array.Uint8Array.unsafe_set",
- "kind": "value",
- "name": "unsafe_set",
- "docstrings": [],
- "signature": "let unsafe_set: (t, int, elt) => unit"
- },
- {
- "id": "Js.Typed_array.Uint8Array.buffer",
- "kind": "value",
- "name": "buffer",
- "docstrings": [],
- "signature": "let buffer: t => array_buffer"
- },
- {
- "id": "Js.Typed_array.Uint8Array.byteLength",
- "kind": "value",
- "name": "byteLength",
- "docstrings": [],
- "signature": "let byteLength: t => int"
- },
- {
- "id": "Js.Typed_array.Uint8Array.byteOffset",
- "kind": "value",
- "name": "byteOffset",
- "docstrings": [],
- "signature": "let byteOffset: t => int"
- },
- {
- "id": "Js.Typed_array.Uint8Array.setArray",
- "kind": "value",
- "name": "setArray",
- "docstrings": [],
- "signature": "let setArray: (array, t) => unit"
- },
- {
- "id": "Js.Typed_array.Uint8Array.setArrayOffset",
- "kind": "value",
- "name": "setArrayOffset",
- "docstrings": [],
- "signature": "let setArrayOffset: (array, int, t) => unit"
- },
- {
- "id": "Js.Typed_array.Uint8Array.length",
- "kind": "value",
- "name": "length",
- "docstrings": [],
- "signature": "let length: t => int"
- },
- {
- "id": "Js.Typed_array.Uint8Array.copyWithin",
- "kind": "value",
- "name": "copyWithin",
- "docstrings": [],
- "signature": "let copyWithin: (~to_: int, t) => t"
- },
- {
- "id": "Js.Typed_array.Uint8Array.copyWithinFrom",
- "kind": "value",
- "name": "copyWithinFrom",
- "docstrings": [],
- "signature": "let copyWithinFrom: (~to_: int, ~from: int, t) => t"
- },
- {
- "id": "Js.Typed_array.Uint8Array.copyWithinFromRange",
- "kind": "value",
- "name": "copyWithinFromRange",
- "docstrings": [],
- "signature": "let copyWithinFromRange: (~to_: int, ~start: int, ~end_: int, t) => t"
- },
- {
- "id": "Js.Typed_array.Uint8Array.fillInPlace",
- "kind": "value",
- "name": "fillInPlace",
- "docstrings": [],
- "signature": "let fillInPlace: (elt, t) => t"
- },
- {
- "id": "Js.Typed_array.Uint8Array.fillFromInPlace",
- "kind": "value",
- "name": "fillFromInPlace",
- "docstrings": [],
- "signature": "let fillFromInPlace: (elt, ~from: int, t) => t"
- },
- {
- "id": "Js.Typed_array.Uint8Array.fillRangeInPlace",
- "kind": "value",
- "name": "fillRangeInPlace",
- "docstrings": [],
- "signature": "let fillRangeInPlace: (elt, ~start: int, ~end_: int, t) => t"
- },
- {
- "id": "Js.Typed_array.Uint8Array.reverseInPlace",
- "kind": "value",
- "name": "reverseInPlace",
- "docstrings": [],
- "signature": "let reverseInPlace: t => t"
- },
- {
- "id": "Js.Typed_array.Uint8Array.sortInPlace",
- "kind": "value",
- "name": "sortInPlace",
- "docstrings": [],
- "signature": "let sortInPlace: t => t"
- },
- {
- "id": "Js.Typed_array.Uint8Array.sortInPlaceWith",
- "kind": "value",
- "name": "sortInPlaceWith",
- "docstrings": [],
- "signature": "let sortInPlaceWith: ((elt, elt) => int, t) => t"
- },
- {
- "id": "Js.Typed_array.Uint8Array.includes",
- "kind": "value",
- "name": "includes",
- "docstrings": [],
- "signature": "let includes: (elt, t) => bool"
- },
- {
- "id": "Js.Typed_array.Uint8Array.indexOf",
- "kind": "value",
- "name": "indexOf",
- "docstrings": [],
- "signature": "let indexOf: (elt, t) => int"
- },
- {
- "id": "Js.Typed_array.Uint8Array.indexOfFrom",
- "kind": "value",
- "name": "indexOfFrom",
- "docstrings": [],
- "signature": "let indexOfFrom: (elt, ~from: int, t) => int"
- },
- {
- "id": "Js.Typed_array.Uint8Array.join",
- "kind": "value",
- "name": "join",
- "docstrings": [],
- "signature": "let join: t => string"
- },
- {
- "id": "Js.Typed_array.Uint8Array.joinWith",
- "kind": "value",
- "name": "joinWith",
- "docstrings": [],
- "signature": "let joinWith: (string, t) => string"
- },
- {
- "id": "Js.Typed_array.Uint8Array.lastIndexOf",
- "kind": "value",
- "name": "lastIndexOf",
- "docstrings": [],
- "signature": "let lastIndexOf: (elt, t) => int"
- },
- {
- "id": "Js.Typed_array.Uint8Array.lastIndexOfFrom",
- "kind": "value",
- "name": "lastIndexOfFrom",
- "docstrings": [],
- "signature": "let lastIndexOfFrom: (elt, ~from: int, t) => int"
- },
- {
- "id": "Js.Typed_array.Uint8Array.slice",
- "kind": "value",
- "name": "slice",
- "docstrings": [],
- "signature": "let slice: (~start: int, ~end_: int, t) => t"
- },
- {
- "id": "Js.Typed_array.Uint8Array.copy",
- "kind": "value",
- "name": "copy",
- "docstrings": [],
- "signature": "let copy: t => t"
- },
- {
- "id": "Js.Typed_array.Uint8Array.sliceFrom",
- "kind": "value",
- "name": "sliceFrom",
- "docstrings": [],
- "signature": "let sliceFrom: (int, t) => t"
- },
- {
- "id": "Js.Typed_array.Uint8Array.subarray",
- "kind": "value",
- "name": "subarray",
- "docstrings": [],
- "signature": "let subarray: (~start: int, ~end_: int, t) => t"
- },
- {
- "id": "Js.Typed_array.Uint8Array.subarrayFrom",
- "kind": "value",
- "name": "subarrayFrom",
- "docstrings": [],
- "signature": "let subarrayFrom: (int, t) => t"
- },
- {
- "id": "Js.Typed_array.Uint8Array.toString",
- "kind": "value",
- "name": "toString",
- "docstrings": [],
- "signature": "let toString: t => string"
- },
- {
- "id": "Js.Typed_array.Uint8Array.toLocaleString",
- "kind": "value",
- "name": "toLocaleString",
- "docstrings": [],
- "signature": "let toLocaleString: t => string"
- },
- {
- "id": "Js.Typed_array.Uint8Array.every",
- "kind": "value",
- "name": "every",
- "docstrings": [],
- "signature": "let every: (elt => bool, t) => bool"
- },
- {
- "id": "Js.Typed_array.Uint8Array.everyi",
- "kind": "value",
- "name": "everyi",
- "docstrings": [],
- "signature": "let everyi: ((elt, int) => bool, t) => bool"
- },
- {
- "id": "Js.Typed_array.Uint8Array.filter",
- "kind": "value",
- "name": "filter",
- "docstrings": [],
- "signature": "let filter: (elt => bool, t) => t"
- },
- {
- "id": "Js.Typed_array.Uint8Array.filteri",
- "kind": "value",
- "name": "filteri",
- "docstrings": [],
- "signature": "let filteri: ((elt, int) => bool, t) => t"
- },
- {
- "id": "Js.Typed_array.Uint8Array.find",
- "kind": "value",
- "name": "find",
- "docstrings": [],
- "signature": "let find: (elt => bool, t) => Js.undefined"
- },
- {
- "id": "Js.Typed_array.Uint8Array.findi",
- "kind": "value",
- "name": "findi",
- "docstrings": [],
- "signature": "let findi: ((elt, int) => bool, t) => Js.undefined"
- },
- {
- "id": "Js.Typed_array.Uint8Array.findIndex",
- "kind": "value",
- "name": "findIndex",
- "docstrings": [],
- "signature": "let findIndex: (elt => bool, t) => int"
- },
- {
- "id": "Js.Typed_array.Uint8Array.findIndexi",
- "kind": "value",
- "name": "findIndexi",
- "docstrings": [],
- "signature": "let findIndexi: ((elt, int) => bool, t) => int"
- },
- {
- "id": "Js.Typed_array.Uint8Array.forEach",
- "kind": "value",
- "name": "forEach",
- "docstrings": [],
- "signature": "let forEach: (elt => unit, t) => unit"
- },
- {
- "id": "Js.Typed_array.Uint8Array.forEachi",
- "kind": "value",
- "name": "forEachi",
- "docstrings": [],
- "signature": "let forEachi: ((elt, int) => unit, t) => unit"
- },
- {
- "id": "Js.Typed_array.Uint8Array.map",
- "kind": "value",
- "name": "map",
- "docstrings": [],
- "signature": "let map: (elt => 'a, t) => typed_array<'a>"
- },
- {
- "id": "Js.Typed_array.Uint8Array.mapi",
- "kind": "value",
- "name": "mapi",
- "docstrings": [],
- "signature": "let mapi: ((elt, int) => 'a, t) => typed_array<'a>"
- },
- {
- "id": "Js.Typed_array.Uint8Array.reduce",
- "kind": "value",
- "name": "reduce",
- "docstrings": [],
- "signature": "let reduce: (('a, elt) => 'a, 'a, t) => 'a"
- },
- {
- "id": "Js.Typed_array.Uint8Array.reducei",
- "kind": "value",
- "name": "reducei",
- "docstrings": [],
- "signature": "let reducei: (('a, elt, int) => 'a, 'a, t) => 'a"
- },
- {
- "id": "Js.Typed_array.Uint8Array.reduceRight",
- "kind": "value",
- "name": "reduceRight",
- "docstrings": [],
- "signature": "let reduceRight: (('a, elt) => 'a, 'a, t) => 'a"
- },
- {
- "id": "Js.Typed_array.Uint8Array.reduceRighti",
- "kind": "value",
- "name": "reduceRighti",
- "docstrings": [],
- "signature": "let reduceRighti: (('a, elt, int) => 'a, 'a, t) => 'a"
- },
- {
- "id": "Js.Typed_array.Uint8Array.some",
- "kind": "value",
- "name": "some",
- "docstrings": [],
- "signature": "let some: (elt => bool, t) => bool"
- },
- {
- "id": "Js.Typed_array.Uint8Array.somei",
- "kind": "value",
- "name": "somei",
- "docstrings": [],
- "signature": "let somei: ((elt, int) => bool, t) => bool"
- },
- {
- "id": "Js.Typed_array.Uint8Array._BYTES_PER_ELEMENT",
- "kind": "value",
- "name": "_BYTES_PER_ELEMENT",
- "docstrings": [],
- "signature": "let _BYTES_PER_ELEMENT: int"
- },
- {
- "id": "Js.Typed_array.Uint8Array.make",
- "kind": "value",
- "name": "make",
- "docstrings": [],
- "signature": "let make: array => t"
- },
- {
- "id": "Js.Typed_array.Uint8Array.fromBuffer",
- "kind": "value",
- "name": "fromBuffer",
- "docstrings": [
- "can throw"
- ],
- "signature": "let fromBuffer: array_buffer => t"
- },
- {
- "id": "Js.Typed_array.Uint8Array.fromBufferOffset",
- "kind": "value",
- "name": "fromBufferOffset",
- "docstrings": [
- "**raise** Js.Exn.Error raise Js exception\n\n **param** offset is in bytes"
- ],
- "signature": "let fromBufferOffset: (array_buffer, int) => t"
- },
- {
- "id": "Js.Typed_array.Uint8Array.fromBufferRange",
- "kind": "value",
- "name": "fromBufferRange",
- "docstrings": [
- "**raise** Js.Exn.Error raises Js exception\n\n **param** offset is in bytes, length in elements"
- ],
- "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t"
- },
- {
- "id": "Js.Typed_array.Uint8Array.fromLength",
- "kind": "value",
- "name": "fromLength",
- "docstrings": [],
- "signature": "let fromLength: int => t"
- },
- {
- "id": "Js.Typed_array.Uint8Array.from",
- "kind": "value",
- "name": "from",
- "docstrings": [],
- "signature": "let from: array_like => t"
- }
- ]
- },
- "js/typed_array/int8array": {
- "id": "Js.Typed_array.Int8Array",
- "name": "Int8Array",
- "docstrings": [],
- "items": [
- {
- "id": "Js.Typed_array.Int8Array.elt",
- "kind": "type",
- "name": "elt",
- "docstrings": [
- ""
- ],
- "signature": "type elt = int"
- },
- {
- "id": "Js.Typed_array.Int8Array.typed_array",
- "kind": "type",
- "name": "typed_array",
- "docstrings": [],
- "signature": "type typed_array<\n 'a,\n> = Js_typed_array2.Int8Array.typed_array<'a>"
- },
- {
- "id": "Js.Typed_array.Int8Array.t",
- "kind": "type",
- "name": "t",
- "docstrings": [],
- "signature": "type t = typed_array"
- },
- {
- "id": "Js.Typed_array.Int8Array.unsafe_get",
- "kind": "value",
- "name": "unsafe_get",
- "docstrings": [],
- "signature": "let unsafe_get: (t, int) => elt"
- },
- {
- "id": "Js.Typed_array.Int8Array.unsafe_set",
- "kind": "value",
- "name": "unsafe_set",
- "docstrings": [],
- "signature": "let unsafe_set: (t, int, elt) => unit"
- },
- {
- "id": "Js.Typed_array.Int8Array.buffer",
- "kind": "value",
- "name": "buffer",
- "docstrings": [],
- "signature": "let buffer: t => array_buffer"
- },
- {
- "id": "Js.Typed_array.Int8Array.byteLength",
- "kind": "value",
- "name": "byteLength",
- "docstrings": [],
- "signature": "let byteLength: t => int"
- },
- {
- "id": "Js.Typed_array.Int8Array.byteOffset",
- "kind": "value",
- "name": "byteOffset",
- "docstrings": [],
- "signature": "let byteOffset: t => int"
- },
- {
- "id": "Js.Typed_array.Int8Array.setArray",
- "kind": "value",
- "name": "setArray",
- "docstrings": [],
- "signature": "let setArray: (array, t) => unit"
- },
- {
- "id": "Js.Typed_array.Int8Array.setArrayOffset",
- "kind": "value",
- "name": "setArrayOffset",
- "docstrings": [],
- "signature": "let setArrayOffset: (array, int, t) => unit"
- },
- {
- "id": "Js.Typed_array.Int8Array.length",
- "kind": "value",
- "name": "length",
- "docstrings": [],
- "signature": "let length: t => int"
- },
- {
- "id": "Js.Typed_array.Int8Array.copyWithin",
- "kind": "value",
- "name": "copyWithin",
- "docstrings": [],
- "signature": "let copyWithin: (~to_: int, t) => t"
- },
- {
- "id": "Js.Typed_array.Int8Array.copyWithinFrom",
- "kind": "value",
- "name": "copyWithinFrom",
- "docstrings": [],
- "signature": "let copyWithinFrom: (~to_: int, ~from: int, t) => t"
- },
- {
- "id": "Js.Typed_array.Int8Array.copyWithinFromRange",
- "kind": "value",
- "name": "copyWithinFromRange",
- "docstrings": [],
- "signature": "let copyWithinFromRange: (~to_: int, ~start: int, ~end_: int, t) => t"
- },
- {
- "id": "Js.Typed_array.Int8Array.fillInPlace",
- "kind": "value",
- "name": "fillInPlace",
- "docstrings": [],
- "signature": "let fillInPlace: (elt, t) => t"
- },
- {
- "id": "Js.Typed_array.Int8Array.fillFromInPlace",
- "kind": "value",
- "name": "fillFromInPlace",
- "docstrings": [],
- "signature": "let fillFromInPlace: (elt, ~from: int, t) => t"
- },
- {
- "id": "Js.Typed_array.Int8Array.fillRangeInPlace",
- "kind": "value",
- "name": "fillRangeInPlace",
- "docstrings": [],
- "signature": "let fillRangeInPlace: (elt, ~start: int, ~end_: int, t) => t"
- },
- {
- "id": "Js.Typed_array.Int8Array.reverseInPlace",
- "kind": "value",
- "name": "reverseInPlace",
- "docstrings": [],
- "signature": "let reverseInPlace: t => t"
- },
- {
- "id": "Js.Typed_array.Int8Array.sortInPlace",
- "kind": "value",
- "name": "sortInPlace",
- "docstrings": [],
- "signature": "let sortInPlace: t => t"
- },
- {
- "id": "Js.Typed_array.Int8Array.sortInPlaceWith",
- "kind": "value",
- "name": "sortInPlaceWith",
- "docstrings": [],
- "signature": "let sortInPlaceWith: ((elt, elt) => int, t) => t"
- },
- {
- "id": "Js.Typed_array.Int8Array.includes",
- "kind": "value",
- "name": "includes",
- "docstrings": [],
- "signature": "let includes: (elt, t) => bool"
- },
- {
- "id": "Js.Typed_array.Int8Array.indexOf",
- "kind": "value",
- "name": "indexOf",
- "docstrings": [],
- "signature": "let indexOf: (elt, t) => int"
- },
- {
- "id": "Js.Typed_array.Int8Array.indexOfFrom",
- "kind": "value",
- "name": "indexOfFrom",
- "docstrings": [],
- "signature": "let indexOfFrom: (elt, ~from: int, t) => int"
- },
- {
- "id": "Js.Typed_array.Int8Array.join",
- "kind": "value",
- "name": "join",
- "docstrings": [],
- "signature": "let join: t => string"
- },
- {
- "id": "Js.Typed_array.Int8Array.joinWith",
- "kind": "value",
- "name": "joinWith",
- "docstrings": [],
- "signature": "let joinWith: (string, t) => string"
- },
- {
- "id": "Js.Typed_array.Int8Array.lastIndexOf",
- "kind": "value",
- "name": "lastIndexOf",
- "docstrings": [],
- "signature": "let lastIndexOf: (elt, t) => int"
- },
- {
- "id": "Js.Typed_array.Int8Array.lastIndexOfFrom",
- "kind": "value",
- "name": "lastIndexOfFrom",
- "docstrings": [],
- "signature": "let lastIndexOfFrom: (elt, ~from: int, t) => int"
- },
- {
- "id": "Js.Typed_array.Int8Array.slice",
- "kind": "value",
- "name": "slice",
- "docstrings": [],
- "signature": "let slice: (~start: int, ~end_: int, t) => t"
- },
- {
- "id": "Js.Typed_array.Int8Array.copy",
- "kind": "value",
- "name": "copy",
- "docstrings": [],
- "signature": "let copy: t => t"
- },
- {
- "id": "Js.Typed_array.Int8Array.sliceFrom",
- "kind": "value",
- "name": "sliceFrom",
- "docstrings": [],
- "signature": "let sliceFrom: (int, t) => t"
- },
- {
- "id": "Js.Typed_array.Int8Array.subarray",
- "kind": "value",
- "name": "subarray",
- "docstrings": [],
- "signature": "let subarray: (~start: int, ~end_: int, t) => t"
- },
- {
- "id": "Js.Typed_array.Int8Array.subarrayFrom",
- "kind": "value",
- "name": "subarrayFrom",
- "docstrings": [],
- "signature": "let subarrayFrom: (int, t) => t"
- },
- {
- "id": "Js.Typed_array.Int8Array.toString",
- "kind": "value",
- "name": "toString",
- "docstrings": [],
- "signature": "let toString: t => string"
- },
- {
- "id": "Js.Typed_array.Int8Array.toLocaleString",
- "kind": "value",
- "name": "toLocaleString",
- "docstrings": [],
- "signature": "let toLocaleString: t => string"
- },
- {
- "id": "Js.Typed_array.Int8Array.every",
- "kind": "value",
- "name": "every",
- "docstrings": [],
- "signature": "let every: (elt => bool, t) => bool"
- },
- {
- "id": "Js.Typed_array.Int8Array.everyi",
- "kind": "value",
- "name": "everyi",
- "docstrings": [],
- "signature": "let everyi: ((elt, int) => bool, t) => bool"
- },
- {
- "id": "Js.Typed_array.Int8Array.filter",
- "kind": "value",
- "name": "filter",
- "docstrings": [],
- "signature": "let filter: (elt => bool, t) => t"
- },
- {
- "id": "Js.Typed_array.Int8Array.filteri",
- "kind": "value",
- "name": "filteri",
- "docstrings": [],
- "signature": "let filteri: ((elt, int) => bool, t) => t"
- },
- {
- "id": "Js.Typed_array.Int8Array.find",
- "kind": "value",
- "name": "find",
- "docstrings": [],
- "signature": "let find: (elt => bool, t) => Js.undefined"
- },
- {
- "id": "Js.Typed_array.Int8Array.findi",
- "kind": "value",
- "name": "findi",
- "docstrings": [],
- "signature": "let findi: ((elt, int) => bool, t) => Js.undefined"
- },
- {
- "id": "Js.Typed_array.Int8Array.findIndex",
- "kind": "value",
- "name": "findIndex",
- "docstrings": [],
- "signature": "let findIndex: (elt => bool, t) => int"
- },
- {
- "id": "Js.Typed_array.Int8Array.findIndexi",
- "kind": "value",
- "name": "findIndexi",
- "docstrings": [],
- "signature": "let findIndexi: ((elt, int) => bool, t) => int"
- },
- {
- "id": "Js.Typed_array.Int8Array.forEach",
- "kind": "value",
- "name": "forEach",
- "docstrings": [],
- "signature": "let forEach: (elt => unit, t) => unit"
- },
- {
- "id": "Js.Typed_array.Int8Array.forEachi",
- "kind": "value",
- "name": "forEachi",
- "docstrings": [],
- "signature": "let forEachi: ((elt, int) => unit, t) => unit"
- },
- {
- "id": "Js.Typed_array.Int8Array.map",
- "kind": "value",
- "name": "map",
- "docstrings": [],
- "signature": "let map: (elt => 'a, t) => typed_array<'a>"
- },
- {
- "id": "Js.Typed_array.Int8Array.mapi",
- "kind": "value",
- "name": "mapi",
- "docstrings": [],
- "signature": "let mapi: ((elt, int) => 'a, t) => typed_array<'a>"
- },
- {
- "id": "Js.Typed_array.Int8Array.reduce",
- "kind": "value",
- "name": "reduce",
- "docstrings": [],
- "signature": "let reduce: (('a, elt) => 'a, 'a, t) => 'a"
- },
- {
- "id": "Js.Typed_array.Int8Array.reducei",
- "kind": "value",
- "name": "reducei",
- "docstrings": [],
- "signature": "let reducei: (('a, elt, int) => 'a, 'a, t) => 'a"
- },
- {
- "id": "Js.Typed_array.Int8Array.reduceRight",
- "kind": "value",
- "name": "reduceRight",
- "docstrings": [],
- "signature": "let reduceRight: (('a, elt) => 'a, 'a, t) => 'a"
- },
- {
- "id": "Js.Typed_array.Int8Array.reduceRighti",
- "kind": "value",
- "name": "reduceRighti",
- "docstrings": [],
- "signature": "let reduceRighti: (('a, elt, int) => 'a, 'a, t) => 'a"
- },
- {
- "id": "Js.Typed_array.Int8Array.some",
- "kind": "value",
- "name": "some",
- "docstrings": [],
- "signature": "let some: (elt => bool, t) => bool"
- },
- {
- "id": "Js.Typed_array.Int8Array.somei",
- "kind": "value",
- "name": "somei",
- "docstrings": [],
- "signature": "let somei: ((elt, int) => bool, t) => bool"
- },
- {
- "id": "Js.Typed_array.Int8Array._BYTES_PER_ELEMENT",
- "kind": "value",
- "name": "_BYTES_PER_ELEMENT",
- "docstrings": [],
- "signature": "let _BYTES_PER_ELEMENT: int"
- },
- {
- "id": "Js.Typed_array.Int8Array.make",
- "kind": "value",
- "name": "make",
- "docstrings": [],
- "signature": "let make: array => t"
- },
- {
- "id": "Js.Typed_array.Int8Array.fromBuffer",
- "kind": "value",
- "name": "fromBuffer",
- "docstrings": [
- "can throw"
- ],
- "signature": "let fromBuffer: array_buffer => t"
- },
- {
- "id": "Js.Typed_array.Int8Array.fromBufferOffset",
- "kind": "value",
- "name": "fromBufferOffset",
- "docstrings": [
- "raise Js.Exn.Error raise Js exception\n\n param offset is in bytes"
- ],
- "signature": "let fromBufferOffset: (array_buffer, int) => t"
- },
- {
- "id": "Js.Typed_array.Int8Array.fromBufferRange",
- "kind": "value",
- "name": "fromBufferRange",
- "docstrings": [
- "raise Js.Exn.Error raises Js exception\n\n param offset is in bytes, length in elements"
- ],
- "signature": "let fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t"
- },
- {
- "id": "Js.Typed_array.Int8Array.fromLength",
- "kind": "value",
- "name": "fromLength",
- "docstrings": [],
- "signature": "let fromLength: int => t"
- },
- {
- "id": "Js.Typed_array.Int8Array.from",
- "kind": "value",
- "name": "from",
- "docstrings": [],
- "signature": "let from: array_like => t"
- }
- ]
- },
- "js/typed_array/s": {
- "id": "Js.Typed_array.S",
- "name": "S",
- "docstrings": [],
- "items": [
- {
- "id": "Js.Typed_array.S.elt",
- "kind": "type",
- "name": "elt",
- "docstrings": [],
- "signature": "type elt"
- },
- {
- "id": "Js.Typed_array.S.typed_array",
- "kind": "type",
- "name": "typed_array",
- "docstrings": [],
- "signature": "type typed_array<'a>"
- },
- {
- "id": "Js.Typed_array.S.t",
- "kind": "type",
- "name": "t",
- "docstrings": [],
- "signature": "type t = typed_array"
- },
- {
- "id": "Js.Typed_array.S.unsafe_get",
- "kind": "value",
- "name": "unsafe_get",
- "docstrings": [],
- "signature": "let unsafe_get: (t, int) => elt"
- },
- {
- "id": "Js.Typed_array.S.unsafe_set",
- "kind": "value",
- "name": "unsafe_set",
- "docstrings": [],
- "signature": "let unsafe_set: (t, int, elt) => unit"
- },
- {
- "id": "Js.Typed_array.S.buffer",
- "kind": "value",
- "name": "buffer",
- "docstrings": [],
- "signature": "let buffer: t => array_buffer"
- },
- {
- "id": "Js.Typed_array.S.byteLength",
- "kind": "value",
- "name": "byteLength",
- "docstrings": [],
- "signature": "let byteLength: t => int"
- },
- {
- "id": "Js.Typed_array.S.byteOffset",
- "kind": "value",
- "name": "byteOffset",
- "docstrings": [],
- "signature": "let byteOffset: t => int"
- },
- {
- "id": "Js.Typed_array.S.setArray",
- "kind": "value",
- "name": "setArray",
- "docstrings": [],
- "signature": "let setArray: (array, t) => unit"
- },
- {
- "id": "Js.Typed_array.S.setArrayOffset",
- "kind": "value",
- "name": "setArrayOffset",
- "docstrings": [],
- "signature": "let setArrayOffset: (array, int, t) => unit"
- },
- {
- "id": "Js.Typed_array.S.length",
- "kind": "value",
- "name": "length",
- "docstrings": [],
- "signature": "let length: t => int"
- },
- {
- "id": "Js.Typed_array.S.copyWithin",
- "kind": "value",
- "name": "copyWithin",
- "docstrings": [],
- "signature": "let copyWithin: (~to_: int, t) => t"
- },
- {
- "id": "Js.Typed_array.S.copyWithinFrom",
- "kind": "value",
- "name": "copyWithinFrom",
- "docstrings": [],
- "signature": "let copyWithinFrom: (~to_: int, ~from: int, t) => t"
- },
- {
- "id": "Js.Typed_array.S.copyWithinFromRange",
- "kind": "value",
- "name": "copyWithinFromRange",
- "docstrings": [],
- "signature": "let copyWithinFromRange: (~to_: int, ~start: int, ~end_: int, t) => t"
- },
- {
- "id": "Js.Typed_array.S.fillInPlace",
- "kind": "value",
- "name": "fillInPlace",
- "docstrings": [],
- "signature": "let fillInPlace: (elt, t) => t"
- },
- {
- "id": "Js.Typed_array.S.fillFromInPlace",
- "kind": "value",
- "name": "fillFromInPlace",
- "docstrings": [],
- "signature": "let fillFromInPlace: (elt, ~from: int, t) => t"
- },
- {
- "id": "Js.Typed_array.S.fillRangeInPlace",
- "kind": "value",
- "name": "fillRangeInPlace",
- "docstrings": [],
- "signature": "let fillRangeInPlace: (elt, ~start: int, ~end_: int, t) => t"
- },
- {
- "id": "Js.Typed_array.S.reverseInPlace",
- "kind": "value",
- "name": "reverseInPlace",
- "docstrings": [],
- "signature": "let reverseInPlace: t => t"
- },
- {
- "id": "Js.Typed_array.S.sortInPlace",
- "kind": "value",
- "name": "sortInPlace",
- "docstrings": [],
- "signature": "let sortInPlace: t => t"
- },
- {
- "id": "Js.Typed_array.S.sortInPlaceWith",
- "kind": "value",
- "name": "sortInPlaceWith",
- "docstrings": [],
- "signature": "let sortInPlaceWith: ((elt, elt) => int, t) => t"
- },
- {
- "id": "Js.Typed_array.S.includes",
- "kind": "value",
- "name": "includes",
- "docstrings": [],
- "signature": "let includes: (elt, t) => bool"
- },
- {
- "id": "Js.Typed_array.S.indexOf",
- "kind": "value",
- "name": "indexOf",
- "docstrings": [],
- "signature": "let indexOf: (elt, t) => int"
- },
- {
- "id": "Js.Typed_array.S.indexOfFrom",
- "kind": "value",
- "name": "indexOfFrom",
- "docstrings": [],
- "signature": "let indexOfFrom: (elt, ~from: int, t) => int"
- },
- {
- "id": "Js.Typed_array.S.join",
- "kind": "value",
- "name": "join",
- "docstrings": [],
- "signature": "let join: t => string"
- },
- {
- "id": "Js.Typed_array.S.joinWith",
- "kind": "value",
- "name": "joinWith",
- "docstrings": [],
- "signature": "let joinWith: (string, t) => string"
- },
- {
- "id": "Js.Typed_array.S.lastIndexOf",
- "kind": "value",
- "name": "lastIndexOf",
- "docstrings": [],
- "signature": "let lastIndexOf: (elt, t) => int"
- },
- {
- "id": "Js.Typed_array.S.lastIndexOfFrom",
- "kind": "value",
- "name": "lastIndexOfFrom",
- "docstrings": [],
- "signature": "let lastIndexOfFrom: (elt, ~from: int, t) => int"
- },
- {
- "id": "Js.Typed_array.S.slice",
- "kind": "value",
- "name": "slice",
- "docstrings": [],
- "signature": "let slice: (~start: int, ~end_: int, t) => t"
- },
- {
- "id": "Js.Typed_array.S.copy",
- "kind": "value",
- "name": "copy",
- "docstrings": [],
- "signature": "let copy: t => t"
- },
- {
- "id": "Js.Typed_array.S.sliceFrom",
- "kind": "value",
- "name": "sliceFrom",
- "docstrings": [],
- "signature": "let sliceFrom: (int, t) => t"
- },
- {
- "id": "Js.Typed_array.S.subarray",
- "kind": "value",
- "name": "subarray",
- "docstrings": [],
- "signature": "let subarray: (~start: int, ~end_: int, t) => t"
- },
- {
- "id": "Js.Typed_array.S.subarrayFrom",
- "kind": "value",
- "name": "subarrayFrom",
- "docstrings": [],
- "signature": "let subarrayFrom: (int, t) => t"
- },
- {
- "id": "Js.Typed_array.S.toString",
- "kind": "value",
- "name": "toString",
- "docstrings": [],
- "signature": "let toString: t => string"
- },
- {
- "id": "Js.Typed_array.S.toLocaleString",
- "kind": "value",
- "name": "toLocaleString",
- "docstrings": [],
- "signature": "let toLocaleString: t => string"
- },
- {
- "id": "Js.Typed_array.S.every",
- "kind": "value",
- "name": "every",
- "docstrings": [],
- "signature": "let every: (elt => bool, t) => bool"
- },
- {
- "id": "Js.Typed_array.S.everyi",
- "kind": "value",
- "name": "everyi",
- "docstrings": [],
- "signature": "let everyi: ((elt, int) => bool, t) => bool"
- },
- {
- "id": "Js.Typed_array.S.filter",
- "kind": "value",
- "name": "filter",
- "docstrings": [],
- "signature": "let filter: (elt => bool, t) => t"
- },
- {
- "id": "Js.Typed_array.S.filteri",
- "kind": "value",
- "name": "filteri",
- "docstrings": [],
- "signature": "let filteri: ((elt, int) => bool, t) => t"
- },
- {
- "id": "Js.Typed_array.S.find",
- "kind": "value",
- "name": "find",
- "docstrings": [],
- "signature": "let find: (elt => bool, t) => Js.undefined"
- },
- {
- "id": "Js.Typed_array.S.findi",
- "kind": "value",
- "name": "findi",
- "docstrings": [],
- "signature": "let findi: ((elt, int) => bool, t) => Js.undefined"
- },
- {
- "id": "Js.Typed_array.S.findIndex",
- "kind": "value",
- "name": "findIndex",
- "docstrings": [],
- "signature": "let findIndex: (elt => bool, t) => int"
- },
- {
- "id": "Js.Typed_array.S.findIndexi",
- "kind": "value",
- "name": "findIndexi",
- "docstrings": [],
- "signature": "let findIndexi: ((elt, int) => bool, t) => int"
- },
- {
- "id": "Js.Typed_array.S.forEach",
- "kind": "value",
- "name": "forEach",
- "docstrings": [],
- "signature": "let forEach: (elt => unit, t) => unit"
- },
- {
- "id": "Js.Typed_array.S.forEachi",
- "kind": "value",
- "name": "forEachi",
- "docstrings": [],
- "signature": "let forEachi: ((elt, int) => unit, t) => unit"
- },
- {
- "id": "Js.Typed_array.S.map",
- "kind": "value",
- "name": "map",
- "docstrings": [],
- "signature": "let map: (elt => 'b, t) => typed_array<'b>"
- },
- {
- "id": "Js.Typed_array.S.mapi",
- "kind": "value",
- "name": "mapi",
- "docstrings": [],
- "signature": "let mapi: ((elt, int) => 'b, t) => typed_array<'b>"
- },
- {
- "id": "Js.Typed_array.S.reduce",
- "kind": "value",
- "name": "reduce",
- "docstrings": [],
- "signature": "let reduce: (('b, elt) => 'b, 'b, t) => 'b"
- },
- {
- "id": "Js.Typed_array.S.reducei",
- "kind": "value",
- "name": "reducei",
- "docstrings": [],
- "signature": "let reducei: (('b, elt, int) => 'b, 'b, t) => 'b"
- },
- {
- "id": "Js.Typed_array.S.reduceRight",
- "kind": "value",
- "name": "reduceRight",
- "docstrings": [],
- "signature": "let reduceRight: (('b, elt) => 'b, 'b, t) => 'b"
- },
- {
- "id": "Js.Typed_array.S.reduceRighti",
- "kind": "value",
- "name": "reduceRighti",
- "docstrings": [],
- "signature": "let reduceRighti: (('b, elt, int) => 'b, 'b, t) => 'b"
- },
- {
- "id": "Js.Typed_array.S.some",
- "kind": "value",
- "name": "some",
- "docstrings": [],
- "signature": "let some: (elt => bool, t) => bool"
- },
- {
- "id": "Js.Typed_array.S.somei",
- "kind": "value",
- "name": "somei",
- "docstrings": [],
- "signature": "let somei: ((elt, int) => bool, t) => bool"
- }
- ]
- },
- "js/typed_array/arraybuffer": {
- "id": "Js.Typed_array.ArrayBuffer",
- "name": "ArrayBuffer",
- "docstrings": [
- "The underlying buffer that the typed arrays provide views of\n\n **see** [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer)"
- ],
- "items": [
- {
- "id": "Js.Typed_array.ArrayBuffer.t",
- "kind": "type",
- "name": "t",
- "docstrings": [],
- "signature": "type t = array_buffer"
- },
- {
- "id": "Js.Typed_array.ArrayBuffer.make",
- "kind": "value",
- "name": "make",
- "docstrings": [
- "takes length. initializes elements to 0"
- ],
- "signature": "let make: int => t"
- },
- {
- "id": "Js.Typed_array.ArrayBuffer.byteLength",
- "kind": "value",
- "name": "byteLength",
- "docstrings": [],
- "signature": "let byteLength: t => int"
- },
- {
- "id": "Js.Typed_array.ArrayBuffer.slice",
- "kind": "value",
- "name": "slice",
- "docstrings": [],
- "signature": "let slice: (~start: int, ~end_: int, t) => array_buffer"
- },
- {
- "id": "Js.Typed_array.ArrayBuffer.sliceFrom",
- "kind": "value",
- "name": "sliceFrom",
- "docstrings": [],
- "signature": "let sliceFrom: (int, t) => array_buffer"
- }
- ]
- },
- "js/typed_array/type": {
- "id": "Js.Typed_array.Type",
- "name": "Type",
- "docstrings": [],
- "items": [
- {
- "id": "Js.Typed_array.Type.t",
- "kind": "type",
- "name": "t",
- "docstrings": [],
- "signature": "type t"
- }
- ]
- },
- "js/json/kind": {
- "id": "Js.Json.Kind",
- "name": "Kind",
- "docstrings": [],
- "items": [
- {
- "id": "Js.Json.Kind.json",
- "kind": "type",
- "name": "json",
- "docstrings": [],
- "signature": "type json = t"
- },
- {
- "id": "Js.Json.Kind.t",
- "kind": "type",
- "name": "t",
- "docstrings": [
- "Underlying type of a JSON value"
- ],
- "signature": "type t<_> =\n | String: t\n | Number: t\n | Object: t>\n | Array: t>\n | Boolean: t\n | Null: t"
- }
- ]
- },
- "js/weakmap": {
- "id": "Js.WeakMap",
- "name": "WeakMap",
- "docstrings": [
- "Provides bindings for ES6 WeakMap",
- "ES6 WeakMap API"
- ],
- "items": [
- {
- "id": "Js.WeakMap.t",
- "kind": "type",
- "name": "t",
- "docstrings": [],
- "signature": "type t<'k, 'v>"
- }
- ]
- },
- "js/map": {
- "id": "Js.Map",
- "name": "Map",
- "docstrings": [
- "Provides bindings for ES6 Map",
- "ES6 Map API"
- ],
- "items": [
- {
- "id": "Js.Map.t",
- "kind": "type",
- "name": "t",
- "docstrings": [],
- "signature": "type t<'k, 'v>"
- }
- ]
- },
- "js/weakset": {
- "id": "Js.WeakSet",
- "name": "WeakSet",
- "docstrings": [
- "Provides bindings for ES6 WeakSet",
- "ES6 WeakSet API"
- ],
- "items": [
- {
- "id": "Js.WeakSet.t",
- "kind": "type",
- "name": "t",
- "docstrings": [],
- "signature": "type t<'a>"
- }
- ]
- },
- "js/set": {
- "id": "Js.Set",
- "name": "Set",
- "docstrings": [
- "Provides bindings for ES6 Set",
- "ES6 Set API"
- ],
- "items": [
- {
- "id": "Js.Set.t",
- "kind": "type",
- "name": "t",
- "docstrings": [],
- "signature": "type t<'a>"
- }
- ]
- },
- "js/console": {
- "id": "Js.Console",
- "name": "Console",
- "docstrings": [
- "Provides bindings for console"
- ],
- "items": [
- {
- "id": "Js.Console.log",
- "kind": "value",
- "name": "log",
- "docstrings": [],
- "signature": "let log: 'a => unit"
- },
- {
- "id": "Js.Console.log2",
- "kind": "value",
- "name": "log2",
- "docstrings": [],
- "signature": "let log2: ('a, 'b) => unit"
- },
- {
- "id": "Js.Console.log3",
- "kind": "value",
- "name": "log3",
- "docstrings": [],
- "signature": "let log3: ('a, 'b, 'c) => unit"
- },
- {
- "id": "Js.Console.log4",
- "kind": "value",
- "name": "log4",
- "docstrings": [],
- "signature": "let log4: ('a, 'b, 'c, 'd) => unit"
- },
- {
- "id": "Js.Console.logMany",
- "kind": "value",
- "name": "logMany",
- "docstrings": [],
- "signature": "let logMany: array<'a> => unit"
- },
- {
- "id": "Js.Console.info",
- "kind": "value",
- "name": "info",
- "docstrings": [],
- "signature": "let info: 'a => unit"
- },
- {
- "id": "Js.Console.info2",
- "kind": "value",
- "name": "info2",
- "docstrings": [],
- "signature": "let info2: ('a, 'b) => unit"
- },
- {
- "id": "Js.Console.info3",
- "kind": "value",
- "name": "info3",
- "docstrings": [],
- "signature": "let info3: ('a, 'b, 'c) => unit"
- },
- {
- "id": "Js.Console.info4",
- "kind": "value",
- "name": "info4",
- "docstrings": [],
- "signature": "let info4: ('a, 'b, 'c, 'd) => unit"
- },
- {
- "id": "Js.Console.infoMany",
- "kind": "value",
- "name": "infoMany",
- "docstrings": [],
- "signature": "let infoMany: array<'a> => unit"
- },
- {
- "id": "Js.Console.warn",
- "kind": "value",
- "name": "warn",
- "docstrings": [],
- "signature": "let warn: 'a => unit"
- },
- {
- "id": "Js.Console.warn2",
- "kind": "value",
- "name": "warn2",
- "docstrings": [],
- "signature": "let warn2: ('a, 'b) => unit"
- },
- {
- "id": "Js.Console.warn3",
- "kind": "value",
- "name": "warn3",
- "docstrings": [],
- "signature": "let warn3: ('a, 'b, 'c) => unit"
- },
- {
- "id": "Js.Console.warn4",
- "kind": "value",
- "name": "warn4",
- "docstrings": [],
- "signature": "let warn4: ('a, 'b, 'c, 'd) => unit"
- },
- {
- "id": "Js.Console.warnMany",
- "kind": "value",
- "name": "warnMany",
- "docstrings": [],
- "signature": "let warnMany: array<'a> => unit"
- },
- {
- "id": "Js.Console.error",
- "kind": "value",
- "name": "error",
- "docstrings": [],
- "signature": "let error: 'a => unit"
- },
- {
- "id": "Js.Console.error2",
- "kind": "value",
- "name": "error2",
- "docstrings": [],
- "signature": "let error2: ('a, 'b) => unit"
- },
- {
- "id": "Js.Console.error3",
- "kind": "value",
- "name": "error3",
- "docstrings": [],
- "signature": "let error3: ('a, 'b, 'c) => unit"
- },
- {
- "id": "Js.Console.error4",
- "kind": "value",
- "name": "error4",
- "docstrings": [],
- "signature": "let error4: ('a, 'b, 'c, 'd) => unit"
- },
- {
- "id": "Js.Console.errorMany",
- "kind": "value",
- "name": "errorMany",
- "docstrings": [],
- "signature": "let errorMany: array<'a> => unit"
- },
- {
- "id": "Js.Console.trace",
- "kind": "value",
- "name": "trace",
- "docstrings": [],
- "signature": "let trace: unit => unit"
- },
- {
- "id": "Js.Console.timeStart",
- "kind": "value",
- "name": "timeStart",
- "docstrings": [],
- "signature": "let timeStart: string => unit"
- },
- {
- "id": "Js.Console.timeEnd",
- "kind": "value",
- "name": "timeEnd",
- "docstrings": [],
- "signature": "let timeEnd: string => unit"
+ "name": "filter",
+ "docstrings": [
+ "should we use `bool` or `boolean` seems they are intechangeable here"
+ ],
+ "signature": "let filter: (elt => bool) => t"
}
]
},
- "js/vector": {
- "id": "Js.Vector",
- "name": "Vector",
+ "js/typed_array/arraybuffer": {
+ "id": "Js.Typed_array.ArrayBuffer",
+ "name": "ArrayBuffer",
"docstrings": [
- "Provides bindings for JS Vector"
+ "The underlying buffer that the typed arrays provide views of\n\n **see** [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer)"
],
"items": [
{
- "id": "Js.Vector.t",
+ "id": "Js.Typed_array.ArrayBuffer.t",
"kind": "type",
"name": "t",
"docstrings": [],
- "signature": "type t<'a> = array<'a>"
- },
- {
- "id": "Js.Vector.filterInPlace",
- "kind": "value",
- "name": "filterInPlace",
- "docstrings": [],
- "signature": "let filterInPlace: ('a => bool, t<'a>) => unit"
- },
- {
- "id": "Js.Vector.empty",
- "kind": "value",
- "name": "empty",
- "docstrings": [],
- "signature": "let empty: t<'a> => unit"
- },
- {
- "id": "Js.Vector.pushBack",
- "kind": "value",
- "name": "pushBack",
- "docstrings": [],
- "signature": "let pushBack: ('a, t<'a>) => unit"
- },
- {
- "id": "Js.Vector.copy",
- "kind": "value",
- "name": "copy",
- "docstrings": [
- "shallow copy"
- ],
- "signature": "let copy: t<'a> => t<'a>"
- },
- {
- "id": "Js.Vector.memByRef",
- "kind": "value",
- "name": "memByRef",
- "docstrings": [],
- "signature": "let memByRef: ('a, t<'a>) => bool"
- },
- {
- "id": "Js.Vector.iter",
- "kind": "value",
- "name": "iter",
- "docstrings": [],
- "signature": "let iter: ('a => unit, t<'a>) => unit"
- },
- {
- "id": "Js.Vector.iteri",
- "kind": "value",
- "name": "iteri",
- "docstrings": [],
- "signature": "let iteri: ((int, 'a) => unit, t<'a>) => unit"
- },
- {
- "id": "Js.Vector.toList",
- "kind": "value",
- "name": "toList",
- "docstrings": [],
- "signature": "let toList: t<'a> => list<'a>"
- },
- {
- "id": "Js.Vector.map",
- "kind": "value",
- "name": "map",
- "docstrings": [],
- "signature": "let map: ('a => 'b, t<'a>) => t<'b>"
- },
- {
- "id": "Js.Vector.mapi",
- "kind": "value",
- "name": "mapi",
- "docstrings": [],
- "signature": "let mapi: ((int, 'a) => 'b, t<'a>) => t<'b>"
- },
- {
- "id": "Js.Vector.foldLeft",
- "kind": "value",
- "name": "foldLeft",
- "docstrings": [],
- "signature": "let foldLeft: (('a, 'b) => 'a, 'a, t<'b>) => 'a"
- },
- {
- "id": "Js.Vector.foldRight",
- "kind": "value",
- "name": "foldRight",
- "docstrings": [],
- "signature": "let foldRight: (('b, 'a) => 'a, t<'b>, 'a) => 'a"
+ "signature": "type t = array_buffer"
},
{
- "id": "Js.Vector.length",
+ "id": "Js.Typed_array.ArrayBuffer.make",
"kind": "value",
- "name": "length",
+ "name": "make",
"docstrings": [
- "Return the length (number of elements) of the given array."
+ "takes length. initializes elements to 0"
],
- "signature": "let length: t<'a> => int"
+ "signature": "let make: int => t"
},
{
- "id": "Js.Vector.get",
+ "id": "Js.Typed_array.ArrayBuffer.byteLength",
"kind": "value",
- "name": "get",
- "docstrings": [
- "`Vector.get(a, n)` returns the element number `n` of vector `a`. The first\nelement has number 0. The last element has number `Vector.length(a) - 1`. You\ncan also write `a[n]` instead of `Vector.get(a, n)`. Raise `Invalid_argument\n\"index out of bounds\"` if `n` is outside the range 0 to (`Array.length(a) -\n1`)."
- ],
- "signature": "let get: (t<'a>, int) => 'a"
- },
+ "name": "byteLength",
+ "docstrings": [],
+ "signature": "let byteLength: t => int"
+ }
+ ]
+ },
+ "js/typed_array/type": {
+ "id": "Js.Typed_array.Type",
+ "name": "Type",
+ "docstrings": [],
+ "items": [
{
- "id": "Js.Vector.set",
- "kind": "value",
- "name": "set",
- "docstrings": [
- "`Vector.set(a, n, x)` modifies vector `a` in place, replacing element number\n`n` with `x`. Raise `Invalid_argument \"index out of bounds\"` if `n` is outside\nthe range 0 to `Array.length(a) - 1`."
- ],
- "signature": "let set: (t<'a>, int, 'a) => unit"
- },
+ "id": "Js.Typed_array.Type.t",
+ "kind": "type",
+ "name": "t",
+ "docstrings": [],
+ "signature": "type t"
+ }
+ ]
+ },
+ "js/json/kind": {
+ "id": "Js.Json.Kind",
+ "name": "Kind",
+ "docstrings": [],
+ "items": [
{
- "id": "Js.Vector.make",
- "kind": "value",
- "name": "make",
- "docstrings": [
- "`Vector.make(n, x)` returns a fresh vector of length `n`, initialized with `x`.\nAll the elements of this new vector are initially physically equal to `x` (in\nthe sense of the `==` predicate). Consequently, if `x` is mutable, it is shared\namong all elements of the array, and modifying `x` through one of the array\nentries will modify all other entries at the same time. Raise\n`Invalid_argument` if `n < 0` or `n > Sys.max_array_length`. If the value of\n`x` is a floating-point number, then the maximum size is only\n`Sys.max_array_length / 2`."
- ],
- "signature": "let make: (int, 'a) => t<'a>"
+ "id": "Js.Json.Kind.json",
+ "kind": "type",
+ "name": "json",
+ "docstrings": [],
+ "signature": "type json = t"
},
{
- "id": "Js.Vector.init",
- "kind": "value",
- "name": "init",
+ "id": "Js.Json.Kind.t",
+ "kind": "type",
+ "name": "t",
"docstrings": [
- "Raises `RangeError` when n is negative.\nn : size"
+ "Underlying type of a JSON value"
],
- "signature": "let init: (int, int => 'a) => t<'a>"
- },
+ "signature": "type t<_> =\n | String: t\n | Number: t\n | Object: t>\n | Array: t>\n | Boolean: t\n | Null: t"
+ }
+ ]
+ },
+ "js/weakmap": {
+ "id": "Js.WeakMap",
+ "name": "WeakMap",
+ "docstrings": [
+ "Provides bindings for ES6 WeakMap",
+ "ES6 WeakMap API"
+ ],
+ "items": [
{
- "id": "Js.Vector.append",
- "kind": "value",
- "name": "append",
- "docstrings": [
- "`append(x, a)` returns a fresh vector with `x` appended to `a`."
- ],
- "signature": "let append: ('a, t<'a>) => t<'a>"
- },
+ "id": "Js.WeakMap.t",
+ "kind": "type",
+ "name": "t",
+ "docstrings": [],
+ "signature": "type t<'k, 'v> = WeakMap.t<'k, 'v>"
+ }
+ ]
+ },
+ "js/map": {
+ "id": "Js.Map",
+ "name": "Map",
+ "docstrings": [
+ "Provides bindings for ES6 Map",
+ "ES6 Map API"
+ ],
+ "items": [
{
- "id": "Js.Vector.unsafe_get",
- "kind": "value",
- "name": "unsafe_get",
+ "id": "Js.Map.t",
+ "kind": "type",
+ "name": "t",
"docstrings": [],
- "signature": "let unsafe_get: (t<'a>, int) => 'a"
- },
+ "signature": "type t<'k, 'v> = Map.t<'k, 'v>"
+ }
+ ]
+ },
+ "js/weakset": {
+ "id": "Js.WeakSet",
+ "name": "WeakSet",
+ "docstrings": [
+ "Provides bindings for ES6 WeakSet",
+ "ES6 WeakSet API"
+ ],
+ "items": [
{
- "id": "Js.Vector.unsafe_set",
- "kind": "value",
- "name": "unsafe_set",
+ "id": "Js.WeakSet.t",
+ "kind": "type",
+ "name": "t",
"docstrings": [],
- "signature": "let unsafe_set: (t<'a>, int, 'a) => unit"
+ "signature": "type t<'a> = WeakSet.t<'a>"
}
]
},
- "js/list": {
- "id": "Js.List",
- "name": "List",
+ "js/set": {
+ "id": "Js.Set",
+ "name": "Set",
"docstrings": [
- "Provide utilities for list"
+ "Provides bindings for ES6 Set",
+ "ES6 Set API"
],
"items": [
{
- "id": "Js.List.t",
+ "id": "Js.Set.t",
"kind": "type",
"name": "t",
"docstrings": [],
- "signature": "type t<'a> = list<'a>"
+ "signature": "type t<'a> = Set.t<'a>"
+ }
+ ]
+ },
+ "js/console": {
+ "id": "Js.Console",
+ "name": "Console",
+ "docstrings": [
+ "Provides bindings for console"
+ ],
+ "items": [
+ {
+ "id": "Js.Console.log",
+ "kind": "value",
+ "name": "log",
+ "docstrings": [],
+ "signature": "let log: 'a => unit"
},
{
- "id": "Js.List.length",
+ "id": "Js.Console.log2",
"kind": "value",
- "name": "length",
+ "name": "log2",
"docstrings": [],
- "signature": "let length: t<'a> => int"
+ "signature": "let log2: ('a, 'b) => unit"
},
{
- "id": "Js.List.cons",
+ "id": "Js.Console.log3",
"kind": "value",
- "name": "cons",
+ "name": "log3",
"docstrings": [],
- "signature": "let cons: ('a, t<'a>) => t<'a>"
+ "signature": "let log3: ('a, 'b, 'c) => unit"
},
{
- "id": "Js.List.isEmpty",
+ "id": "Js.Console.log4",
"kind": "value",
- "name": "isEmpty",
+ "name": "log4",
"docstrings": [],
- "signature": "let isEmpty: t<'a> => bool"
+ "signature": "let log4: ('a, 'b, 'c, 'd) => unit"
},
{
- "id": "Js.List.hd",
+ "id": "Js.Console.logMany",
"kind": "value",
- "name": "hd",
+ "name": "logMany",
"docstrings": [],
- "signature": "let hd: t<'a> => option<'a>"
+ "signature": "let logMany: array<'a> => unit"
},
{
- "id": "Js.List.tl",
+ "id": "Js.Console.info",
"kind": "value",
- "name": "tl",
+ "name": "info",
"docstrings": [],
- "signature": "let tl: t<'a> => option>"
+ "signature": "let info: 'a => unit"
},
{
- "id": "Js.List.nth",
+ "id": "Js.Console.info2",
"kind": "value",
- "name": "nth",
+ "name": "info2",
"docstrings": [],
- "signature": "let nth: (t<'a>, int) => option<'a>"
+ "signature": "let info2: ('a, 'b) => unit"
},
{
- "id": "Js.List.revAppend",
+ "id": "Js.Console.info3",
"kind": "value",
- "name": "revAppend",
+ "name": "info3",
"docstrings": [],
- "signature": "let revAppend: (t<'a>, t<'a>) => t<'a>"
+ "signature": "let info3: ('a, 'b, 'c) => unit"
},
{
- "id": "Js.List.rev",
+ "id": "Js.Console.info4",
"kind": "value",
- "name": "rev",
+ "name": "info4",
"docstrings": [],
- "signature": "let rev: t<'a> => t<'a>"
+ "signature": "let info4: ('a, 'b, 'c, 'd) => unit"
},
{
- "id": "Js.List.mapRev",
+ "id": "Js.Console.infoMany",
"kind": "value",
- "name": "mapRev",
+ "name": "infoMany",
"docstrings": [],
- "signature": "let mapRev: ('a => 'b, t<'a>) => t<'b>"
+ "signature": "let infoMany: array<'a> => unit"
},
{
- "id": "Js.List.map",
+ "id": "Js.Console.warn",
"kind": "value",
- "name": "map",
+ "name": "warn",
"docstrings": [],
- "signature": "let map: ('a => 'b, t<'a>) => t<'b>"
+ "signature": "let warn: 'a => unit"
},
{
- "id": "Js.List.iter",
+ "id": "Js.Console.warn2",
"kind": "value",
- "name": "iter",
+ "name": "warn2",
"docstrings": [],
- "signature": "let iter: ('a => unit, t<'a>) => unit"
+ "signature": "let warn2: ('a, 'b) => unit"
},
{
- "id": "Js.List.iteri",
+ "id": "Js.Console.warn3",
"kind": "value",
- "name": "iteri",
+ "name": "warn3",
"docstrings": [],
- "signature": "let iteri: ((int, 'a) => unit, t<'a>) => unit"
+ "signature": "let warn3: ('a, 'b, 'c) => unit"
},
{
- "id": "Js.List.foldLeft",
+ "id": "Js.Console.warn4",
"kind": "value",
- "name": "foldLeft",
- "docstrings": [
- "Application order is left to right, tail recurisve"
- ],
- "signature": "let foldLeft: (('a, 'b) => 'a, 'a, list<'b>) => 'a"
+ "name": "warn4",
+ "docstrings": [],
+ "signature": "let warn4: ('a, 'b, 'c, 'd) => unit"
},
{
- "id": "Js.List.foldRight",
+ "id": "Js.Console.warnMany",
"kind": "value",
- "name": "foldRight",
- "docstrings": [
- "Application order is right to left tail-recursive."
- ],
- "signature": "let foldRight: (('a, 'b) => 'b, list<'a>, 'b) => 'b"
+ "name": "warnMany",
+ "docstrings": [],
+ "signature": "let warnMany: array<'a> => unit"
},
{
- "id": "Js.List.flatten",
+ "id": "Js.Console.error",
"kind": "value",
- "name": "flatten",
+ "name": "error",
"docstrings": [],
- "signature": "let flatten: t> => t<'a>"
+ "signature": "let error: 'a => unit"
},
{
- "id": "Js.List.filter",
+ "id": "Js.Console.error2",
"kind": "value",
- "name": "filter",
+ "name": "error2",
+ "docstrings": [],
+ "signature": "let error2: ('a, 'b) => unit"
+ },
+ {
+ "id": "Js.Console.error3",
+ "kind": "value",
+ "name": "error3",
"docstrings": [],
- "signature": "let filter: ('a => bool, t<'a>) => t<'a>"
+ "signature": "let error3: ('a, 'b, 'c) => unit"
},
{
- "id": "Js.List.filterMap",
+ "id": "Js.Console.error4",
"kind": "value",
- "name": "filterMap",
+ "name": "error4",
"docstrings": [],
- "signature": "let filterMap: ('a => option<'b>, t<'a>) => t<'b>"
+ "signature": "let error4: ('a, 'b, 'c, 'd) => unit"
},
{
- "id": "Js.List.countBy",
+ "id": "Js.Console.errorMany",
"kind": "value",
- "name": "countBy",
+ "name": "errorMany",
"docstrings": [],
- "signature": "let countBy: ('a => bool, list<'a>) => int"
+ "signature": "let errorMany: array<'a> => unit"
},
{
- "id": "Js.List.init",
+ "id": "Js.Console.trace",
"kind": "value",
- "name": "init",
+ "name": "trace",
"docstrings": [],
- "signature": "let init: (int, int => 'a) => t<'a>"
+ "signature": "let trace: unit => unit"
},
{
- "id": "Js.List.toVector",
+ "id": "Js.Console.timeStart",
"kind": "value",
- "name": "toVector",
+ "name": "timeStart",
"docstrings": [],
- "signature": "let toVector: t<'a> => array<'a>"
+ "signature": "let timeStart: string => unit"
},
{
- "id": "Js.List.equal",
+ "id": "Js.Console.timeEnd",
"kind": "value",
- "name": "equal",
+ "name": "timeEnd",
"docstrings": [],
- "signature": "let equal: (('a, 'a) => bool, list<'a>, list<'a>) => bool"
+ "signature": "let timeEnd: string => unit"
}
]
},
@@ -10140,23 +6996,14 @@
"docstrings": [
"Js symbol type (only available in ES6)"
],
- "signature": "type symbol"
- },
- {
- "id": "Js.Types.bigint_val",
- "kind": "type",
- "name": "bigint_val",
- "docstrings": [
- "Js bigint type only available in ES2020"
- ],
- "signature": "type bigint_val"
+ "signature": "type symbol = Symbol.t"
},
{
"id": "Js.Types.obj_val",
"kind": "type",
"name": "obj_val",
"docstrings": [],
- "signature": "type obj_val"
+ "signature": "type obj_val = \\\"Type.Classify\".object"
},
{
"id": "Js.Types.undefined_val",
@@ -10181,14 +7028,14 @@
"kind": "type",
"name": "function_val",
"docstrings": [],
- "signature": "type function_val"
+ "signature": "type function_val = \\\"Type.Classify\".function"
},
{
"id": "Js.Types.t",
"kind": "type",
"name": "t",
"docstrings": [],
- "signature": "type t<_> =\n | Undefined: t\n | Null: t\n | Boolean: t\n | Number: t\n | String: t\n | Function: t\n | Object: t\n | Symbol: t\n | BigInt: t"
+ "signature": "type t<_> =\n | Undefined: t\n | Null: t\n | Boolean: t\n | Number: t\n | String: t\n | Function: t\n | Object: t\n | Symbol: t\n | BigInt: t"
},
{
"id": "Js.Types.test",
@@ -10204,7 +7051,7 @@
"kind": "type",
"name": "tagged_t",
"docstrings": [],
- "signature": "type tagged_t =\n | JSFalse\n | JSTrue\n | JSNull\n | JSUndefined\n | JSNumber(float)\n | JSString(string)\n | JSFunction(function_val)\n | JSObject(obj_val)\n | JSSymbol(symbol)\n | JSBigInt(bigint_val)"
+ "signature": "type tagged_t =\n | JSFalse\n | JSTrue\n | JSNull\n | JSUndefined\n | JSNumber(float)\n | JSString(string)\n | JSFunction(function_val)\n | JSObject(obj_val)\n | JSSymbol(symbol)\n | JSBigInt(bigint)"
},
{
"id": "Js.Types.classify",
@@ -10228,7 +7075,7 @@
"kind": "type",
"name": "array_buffer",
"docstrings": [],
- "signature": "type array_buffer"
+ "signature": "type array_buffer = ArrayBuffer.t"
},
{
"id": "Js.TypedArray2.array_like",
@@ -10898,14 +7745,14 @@
"docstrings": [
"The JSON data structure"
],
- "signature": "type t =\n | Boolean(bool)\n | Null\n | String(string)\n | Number(float)\n | Object(Js.Dict.t)\n | Array(array)"
+ "signature": "@unboxed\ntype t = JSON.t =\n | Boolean(bool)\n | @as(null) Null\n | String(string)\n | Number(float)\n | Object(dict)\n | Array(array)"
},
{
"id": "Js.Json.tagged_t",
"kind": "type",
"name": "tagged_t",
"docstrings": [],
- "signature": "type tagged_t =\n | JSONFalse\n | JSONTrue\n | JSONNull\n | JSONString(string)\n | JSONNumber(float)\n | JSONObject(Js_dict.t)\n | JSONArray(array)"
+ "signature": "type tagged_t =\n | JSONFalse\n | JSONTrue\n | JSONNull\n | JSONString(string)\n | JSONNumber(float)\n | JSONObject(dict)\n | JSONArray(array)"
},
{
"id": "Js.Json.classify",
@@ -10948,7 +7795,7 @@
"docstrings": [
"`decodeObject(json)` returns `Some(o)` if `json` is an `object`, `None` otherwise."
],
- "signature": "let decodeObject: t => option>"
+ "signature": "let decodeObject: t => option>"
},
{
"id": "Js.Json.decodeArray",
@@ -11018,9 +7865,9 @@
"kind": "value",
"name": "object_",
"docstrings": [
- "`object_(dict)` makes a JSON object of the `Js.Dict.t` `dict`."
+ "`object_(dict)` makes a JSON object of the `dict`."
],
- "signature": "let object_: Js_dict.t => t"
+ "signature": "let object_: dict => t"
},
{
"id": "Js.Json.array",
@@ -11065,14 +7912,14 @@
"docstrings": [
"`objectArray(a) makes a JSON array of the `JsDict.t` array `a`."
],
- "signature": "let objectArray: array> => t"
+ "signature": "let objectArray: array> => t"
},
{
"id": "Js.Json.parseExn",
"kind": "value",
"name": "parseExn",
"docstrings": [
- "`parseExn(s)` parses the `string` `s` into a JSON data structure.\nReturns a JSON data structure.\nRaises `SyntaxError` if the given string is not a valid JSON. Note: `SyntaxError` is a JavaScript exception.\n\nSee [`parse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse) on MDN.\n\n## Examples\n\n```rescript\n/* parse a simple JSON string */\n\nlet json = try Js.Json.parseExn(` \"hello\" `) catch {\n| _ => failwith(\"Error parsing JSON string\")\n}\n\nswitch Js.Json.classify(json) {\n| Js.Json.JSONString(value) => Js.log(value)\n| _ => failwith(\"Expected a string\")\n}\n```\n\n```rescript\n/* parse a complex JSON string */\n\nlet getIds = s => {\n let json = try Js.Json.parseExn(s) catch {\n | _ => failwith(\"Error parsing JSON string\")\n }\n\n switch Js.Json.classify(json) {\n | Js.Json.JSONObject(value) =>\n /* In this branch, compiler infer value : Js.Json.t Js.Dict.t */\n switch Js.Dict.get(value, \"ids\") {\n | Some(ids) =>\n switch Js.Json.classify(ids) {\n | Js.Json.JSONArray(ids) => /* In this branch compiler infer ids : Js.Json.t array */\n ids\n | _ => failwith(\"Expected an array\")\n }\n | None => failwith(\"Expected an `ids` property\")\n }\n | _ => failwith(\"Expected an object\")\n }\n}\n\n/* prints `1, 2, 3` */\nJs.log(getIds(` { \"ids\" : [1, 2, 3 ] } `))\n```"
+ "`parseExn(s)` parses the `string` `s` into a JSON data structure.\nReturns a JSON data structure.\nRaises `SyntaxError` if the given string is not a valid JSON. Note: `SyntaxError` is a JavaScript exception.\n\nSee [`parse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse) on MDN.\n\n## Examples\n\n```rescript\n/* parse a simple JSON string */\n\nlet json = try Js.Json.parseExn(` \"hello\" `) catch {\n| _ => failwith(\"Error parsing JSON string\")\n}\n\nswitch Js.Json.classify(json) {\n| Js.Json.JSONString(value) => Js.log(value)\n| _ => failwith(\"Expected a string\")\n}\n```\n\n```rescript\n/* parse a complex JSON string */\n\nlet getIds = s => {\n let json = try Js.Json.parseExn(s) catch {\n | _ => failwith(\"Error parsing JSON string\")\n }\n\n switch Js.Json.classify(json) {\n | Js.Json.JSONObject(value) =>\n /* In this branch, compiler infer value : Js.Json.t dict */\n switch Js.Dict.get(value, \"ids\") {\n | Some(ids) =>\n switch Js.Json.classify(ids) {\n | Js.Json.JSONArray(ids) => /* In this branch compiler infer ids : Js.Json.t array */\n ids\n | _ => failwith(\"Expected an array\")\n }\n | None => failwith(\"Expected an `ids` property\")\n }\n | _ => failwith(\"Expected an object\")\n }\n}\n\n/* prints `1, 2, 3` */\nJs.log(getIds(` { \"ids\" : [1, 2, 3 ] } `))\n```"
],
"signature": "let parseExn: string => t"
},
@@ -11138,7 +7985,7 @@
"docstrings": [
"Identify an interval started by `Js.Global.setInterval`."
],
- "signature": "type intervalId"
+ "signature": "type intervalId = Global.intervalId"
},
{
"id": "Js.Global.timeoutId",
@@ -11147,7 +7994,7 @@
"docstrings": [
"Identify timeout started by `Js.Global.setTimeout`."
],
- "signature": "type timeoutId"
+ "signature": "type timeoutId = Global.timeoutId"
},
{
"id": "Js.Global.clearInterval",
@@ -11379,7 +8226,7 @@
"kind": "type",
"name": "t",
"docstrings": [],
- "signature": "type t"
+ "signature": "type t = Date.t"
},
{
"id": "Js.Date.valueOf",
@@ -12346,20 +9193,6 @@
"name": "catch",
"docstrings": [],
"signature": "let catch: (error => promise<'a>, promise<'a>) => promise<'a>"
- },
- {
- "id": "Js.Promise.unsafe_async",
- "kind": "value",
- "name": "unsafe_async",
- "docstrings": [],
- "signature": "let unsafe_async: 'a => promise<'a>"
- },
- {
- "id": "Js.Promise.unsafe_await",
- "kind": "value",
- "name": "unsafe_await",
- "docstrings": [],
- "signature": "let unsafe_await: promise<'a> => 'a"
}
]
},
@@ -12378,7 +9211,7 @@
"docstrings": [
"The RegExp object."
],
- "signature": "type t"
+ "signature": "type t = RegExp.t"
},
{
"id": "Js.Re.result",
@@ -12396,7 +9229,7 @@
"docstrings": [
"An `array` of the match and captures, the first is the full match and the\nremaining are the substring captures."
],
- "signature": "let captures: result => array>"
+ "signature": "let captures: result => array>"
},
{
"id": "Js.Re.matches",
@@ -12429,7 +9262,7 @@
"kind": "value",
"name": "fromString",
"docstrings": [
- "Constructs a RegExp object (Js.Re.t) from a `string`.\nRegex literals `%re(\"/.../\")` should generally be preferred, but `fromString`\nis useful when you need to dynamically construct a regex using strings,\nexactly like when you do so in JavaScript.\n\n## Examples\n\n```rescript\nlet firstReScriptFileExtension = (filename, content) => {\n let result = Js.Re.fromString(filename ++ \"\\.(res|resi)\")->Js.Re.exec_(content)\n switch result {\n | Some(r) => Js.Nullable.toOption(Js.Re.captures(r)[1])\n | None => None\n }\n}\n\n// outputs \"res\"\nfirstReScriptFileExtension(\"School\", \"School.res School.resi Main.js School.bs.js\")\n```"
+ "Constructs a RegExp object (Js.Re.t) from a `string`.\nRegex literals `/.../` should generally be preferred, but `fromString`\nis useful when you need to dynamically construct a regex using strings,\nexactly like when you do so in JavaScript.\n\n## Examples\n\n```rescript\nlet firstReScriptFileExtension = (filename, content) => {\n let result = Js.Re.fromString(filename ++ \"\\.(res|resi)\")->Js.Re.exec_(content)\n switch result {\n | Some(r) => Js.Nullable.toOption(Js.Re.captures(r)[1])\n | None => None\n }\n}\n\n// outputs \"res\"\nfirstReScriptFileExtension(\"School\", \"School.res School.resi Main.js School.bs.js\")\n```"
],
"signature": "let fromString: string => t"
},
@@ -12474,7 +9307,7 @@
"kind": "value",
"name": "lastIndex",
"docstrings": [
- "Returns the index where the next match will start its search. This property\nwill be modified when the RegExp object is used, if the global (\"g\") flag is\nset.\n\n## Examples\n\n```rescript\nlet re = %re(\"/ab*TODO/g\")\nlet str = \"abbcdefabh\"\n\nlet break = ref(false)\nwhile !break.contents {\n switch Js.Re.exec_(re, str) {\n | Some(result) => Js.Nullable.iter(Js.Re.captures(result)[0], (. match_) => {\n let next = Belt.Int.toString(Js.Re.lastIndex(re))\n Js.log(\"Found \" ++ (match_ ++ (\". Next match starts at \" ++ next)))\n })\n | None => break := true\n }\n}\n```\n\nSee\n[`RegExp: lastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/lastIndex)\non MDN."
+ "Returns the index where the next match will start its search. This property\nwill be modified when the RegExp object is used, if the global (\"g\") flag is\nset.\n\n## Examples\n\n```rescript\nlet re = /ab*TODO/g\nlet str = \"abbcdefabh\"\n\nlet break = ref(false)\nwhile !break.contents {\n switch Js.Re.exec_(re, str) {\n | Some(result) => Js.Nullable.iter(Js.Re.captures(result)[0], (. match_) => {\n let next = Belt.Int.toString(Js.Re.lastIndex(re))\n Js.log(\"Found \" ++ (match_ ++ (\". Next match starts at \" ++ next)))\n })\n | None => break := true\n }\n}\n```\n\nSee\n[`RegExp: lastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/lastIndex)\non MDN."
],
"signature": "let lastIndex: t => int"
},
@@ -12528,7 +9361,7 @@
"kind": "value",
"name": "exec_",
"docstrings": [
- "Executes a search on a given string using the given RegExp object.\nReturns `Some(Js.Re.result)` if a match is found, `None` otherwise.\n\n## Examples\n\n```rescript\n/* Match \"quick brown\" followed by \"jumps\", ignoring characters in between\n * Remember \"brown\" and \"jumps\"\n * Ignore case\n */\n\nlet re = %re(\"/quick\\s(brown).+?(jumps)/ig\")\nlet result = Js.Re.exec_(re, \"The Quick Brown Fox Jumps Over The Lazy Dog\")\n```\n\nSee [`RegExp.prototype.exec()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/exec)\non MDN."
+ "Executes a search on a given string using the given RegExp object.\nReturns `Some(Js.Re.result)` if a match is found, `None` otherwise.\n\n## Examples\n\n```rescript\n/* Match \"quick brown\" followed by \"jumps\", ignoring characters in between\n * Remember \"brown\" and \"jumps\"\n * Ignore case\n */\n\nlet re = /quick\\s(brown).+?(jumps)/ig\nlet result = Js.Re.exec_(re, \"The Quick Brown Fox Jumps Over The Lazy Dog\")\n```\n\nSee [`RegExp.prototype.exec()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/exec)\non MDN."
],
"signature": "let exec_: (t, string) => option"
},
@@ -12752,7 +9585,7 @@
"kind": "value",
"name": "match_",
"docstrings": [
- "`match(str, regexp)` matches a `string` against the given `regexp`. If there is\nno match, it returns `None`. For regular expressions without the g modifier, if\n there is a match, the return value is `Some(array)` where the array contains:\n- The entire matched string\n- Any capture groups if the regexp had parentheses\nFor regular expressions with the g modifier, a matched expression returns\n`Some(array)` with all the matched substrings and no capture groups.\n\nSee [`String.match`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/match)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.match_(\"The better bats\", %re(\"/b[aeiou]t/\")) == Some([\"bet\"])\nJs.String2.match_(\"The better bats\", %re(\"/b[aeiou]t/g\")) == Some([\"bet\", \"bat\"])\nJs.String2.match_(\"Today is 2018-04-05.\", %re(\"/(\\d+)-(\\d+)-(\\d+)/\")) ==\n Some([\"2018-04-05\", \"2018\", \"04\", \"05\"])\nJs.String2.match_(\"The large container.\", %re(\"/b[aeiou]g/\")) == None\n```"
+ "`match(str, regexp)` matches a `string` against the given `regexp`. If there is\nno match, it returns `None`. For regular expressions without the g modifier, if\n there is a match, the return value is `Some(array)` where the array contains:\n- The entire matched string\n- Any capture groups if the regexp had parentheses\nFor regular expressions with the g modifier, a matched expression returns\n`Some(array)` with all the matched substrings and no capture groups.\n\nSee [`String.match`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/match)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.match_(\"The better bats\", /b[aeiou]t/) == Some([\"bet\"])\nJs.String2.match_(\"The better bats\", /b[aeiou]t/g) == Some([\"bet\", \"bat\"])\nJs.String2.match_(\"Today is 2018-04-05.\", /(\\d+)-(\\d+)-(\\d+)/) ==\n Some([\"2018-04-05\", \"2018\", \"04\", \"05\"])\nJs.String2.match_(\"The large container.\", /b[aeiou]g/) == None\n```"
],
"signature": "let match_: (t, Js_re.t) => option>>"
},
@@ -12797,7 +9630,7 @@
"kind": "value",
"name": "replaceByRe",
"docstrings": [
- "`replaceByRe(str, regex, replacement)` returns a new `string` where occurrences\nmatching regex have been replaced by `replacement`.\n\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.replaceByRe(\"vowels be gone\", %re(\"/[aeiou]/g\"), \"x\") == \"vxwxls bx gxnx\"\nJs.String2.replaceByRe(\"Juan Fulano\", %re(\"/(\\w+) (\\w+)/\"), \"$2, $1\") == \"Fulano, Juan\"\n```"
+ "`replaceByRe(str, regex, replacement)` returns a new `string` where occurrences\nmatching regex have been replaced by `replacement`.\n\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.replaceByRe(\"vowels be gone\", /[aeiou]/g, \"x\") == \"vxwxls bx gxnx\"\nJs.String2.replaceByRe(\"Juan Fulano\", /(\\w+) (\\w+)/, \"$2, $1\") == \"Fulano, Juan\"\n```"
],
"signature": "let replaceByRe: (t, Js_re.t, t) => t"
},
@@ -12806,7 +9639,7 @@
"kind": "value",
"name": "unsafeReplaceBy0",
"docstrings": [
- "Returns a new `string` with some or all matches of a pattern with no capturing\nparentheses replaced by the value returned from the given function. The\nfunction receives as its parameters the matched string, the offset at which the\nmatch begins, and the whole string being matched.\n\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace)\non MDN.\n\n## Examples\n\n```rescript\nlet str = \"beautiful vowels\"\nlet re = %re(\"/[aeiou]/g\")\nlet matchFn = (matchPart, _offset, _wholeString) => Js.String2.toUpperCase(matchPart)\n\nJs.String2.unsafeReplaceBy0(str, re, matchFn) == \"bEAUtIfUl vOwEls\"\n```"
+ "Returns a new `string` with some or all matches of a pattern with no capturing\nparentheses replaced by the value returned from the given function. The\nfunction receives as its parameters the matched string, the offset at which the\nmatch begins, and the whole string being matched.\n\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace)\non MDN.\n\n## Examples\n\n```rescript\nlet str = \"beautiful vowels\"\nlet re = /[aeiou]/g\nlet matchFn = (matchPart, _offset, _wholeString) => Js.String2.toUpperCase(matchPart)\n\nJs.String2.unsafeReplaceBy0(str, re, matchFn) == \"bEAUtIfUl vOwEls\"\n```"
],
"signature": "let unsafeReplaceBy0: (t, Js_re.t, (t, int, t) => t) => t"
},
@@ -12815,7 +9648,7 @@
"kind": "value",
"name": "unsafeReplaceBy1",
"docstrings": [
- "Returns a new `string` with some or all matches of a pattern with one set of\ncapturing parentheses replaced by the value returned from the given function.\nThe function receives as its parameters the matched string, the captured\nstring, the offset at which the match begins, and the whole string being\nmatched.\n\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace)\non MDN.\n\n## Examples\n\n```rescript\nlet str = \"Jony is 40\"\nlet re = %re(\"/(Jony is )\\d+/g\")\nlet matchFn = (_match, part1, _offset, _wholeString) => {\n part1 ++ \"41\"\n}\n\nJs.String2.unsafeReplaceBy1(str, re, matchFn) == \"Jony is 41\"\n```"
+ "Returns a new `string` with some or all matches of a pattern with one set of\ncapturing parentheses replaced by the value returned from the given function.\nThe function receives as its parameters the matched string, the captured\nstring, the offset at which the match begins, and the whole string being\nmatched.\n\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace)\non MDN.\n\n## Examples\n\n```rescript\nlet str = \"Jony is 40\"\nlet re = /(Jony is )\\d+/g\nlet matchFn = (_match, part1, _offset, _wholeString) => {\n part1 ++ \"41\"\n}\n\nJs.String2.unsafeReplaceBy1(str, re, matchFn) == \"Jony is 41\"\n```"
],
"signature": "let unsafeReplaceBy1: (t, Js_re.t, (t, t, int, t) => t) => t"
},
@@ -12824,7 +9657,7 @@
"kind": "value",
"name": "unsafeReplaceBy2",
"docstrings": [
- "Returns a new `string` with some or all matches of a pattern with two sets of\ncapturing parentheses replaced by the value returned from the given function.\nThe function receives as its parameters the matched string, the captured\nstrings, the offset at which the match begins, and the whole string being\nmatched.\n\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace)\non MDN.\n\n## Examples\n\n```rescript\nlet str = \"7 times 6\"\nlet re = %re(\"/(\\d+) times (\\d+)/\")\nlet matchFn = (_match, p1, p2, _offset, _wholeString) => {\n switch (Belt.Int.fromString(p1), Belt.Int.fromString(p2)) {\n | (Some(x), Some(y)) => Belt.Int.toString(x * y)\n | _ => \"???\"\n }\n}\n\nJs.String2.unsafeReplaceBy2(str, re, matchFn) == \"42\"\n```"
+ "Returns a new `string` with some or all matches of a pattern with two sets of\ncapturing parentheses replaced by the value returned from the given function.\nThe function receives as its parameters the matched string, the captured\nstrings, the offset at which the match begins, and the whole string being\nmatched.\n\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace)\non MDN.\n\n## Examples\n\n```rescript\nlet str = \"7 times 6\"\nlet re = /(\\d+) times (\\d+)/\nlet matchFn = (_match, p1, p2, _offset, _wholeString) => {\n switch (Belt.Int.fromString(p1), Belt.Int.fromString(p2)) {\n | (Some(x), Some(y)) => Belt.Int.toString(x * y)\n | _ => \"???\"\n }\n}\n\nJs.String2.unsafeReplaceBy2(str, re, matchFn) == \"42\"\n```"
],
"signature": "let unsafeReplaceBy2: (t, Js_re.t, (t, t, t, int, t) => t) => t"
},
@@ -12842,7 +9675,7 @@
"kind": "value",
"name": "search",
"docstrings": [
- "`search(str, regexp)` returns the starting position of the first match of\n`regexp` in the given `str`, or -1 if there is no match.\n\nSee [`String.search`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/search)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.search(\"testing 1 2 3\", %re(\"/\\d+/\")) == 8\nJs.String2.search(\"no numbers\", %re(\"/\\d+/\")) == -1\n```"
+ "`search(str, regexp)` returns the starting position of the first match of\n`regexp` in the given `str`, or -1 if there is no match.\n\nSee [`String.search`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/search)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.search(\"testing 1 2 3\", /\\d+/) == 8\nJs.String2.search(\"no numbers\", /\\d+/) == -1\n```"
],
"signature": "let search: (t, Js_re.t) => int"
},
@@ -12887,7 +9720,7 @@
"kind": "value",
"name": "splitByRe",
"docstrings": [
- "`splitByRe(str, regex)` splits the given `str` at every occurrence of `regex`\nand returns an array of the resulting substrings.\n\nSee [`String.split`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.splitByRe(\"art; bed , cog ;dad\", %re(\"/\\s*[,;]\\s*TODO/\")) == [\n Some(\"art\"),\n Some(\"bed\"),\n Some(\"cog\"),\n Some(\"dad\"),\n ]\n```"
+ "`splitByRe(str, regex)` splits the given `str` at every occurrence of `regex`\nand returns an array of the resulting substrings.\n\nSee [`String.split`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split)\non MDN.\n\n## Examples\n\n```rescript\nJs.String2.splitByRe(\"art; bed , cog ;dad\", /\\s*[,;]\\s*TODO/) == [\n Some(\"art\"),\n Some(\"bed\"),\n Some(\"cog\"),\n Some(\"dad\"),\n ]\n```"
],
"signature": "let splitByRe: (t, Js_re.t) => array