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/js.json b/data/api/v12.0.0/js.json index c9b052ef9..482bb54dd 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", + "name": "filter", "docstrings": [ - "can throw" + "should we use `bool` or `boolean` seems they are intechangeable here" ], - "signature": "let fromBuffer: array_buffer => t" - }, + "signature": "let filter: (elt => bool) => t" + } + ] + }, + "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.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.ArrayBuffer.t", + "kind": "type", + "name": "t", + "docstrings": [], + "signature": "type t = array_buffer" }, { - "id": "Js.Typed_array.Int32Array.fromBufferRange", + "id": "Js.Typed_array.ArrayBuffer.make", "kind": "value", - "name": "fromBufferRange", + "name": "make", "docstrings": [ - "**raise** Js.Exn.Error raises Js exception\n\n **param** offset is in bytes, length in elements" + "takes length. initializes elements to 0" ], - "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" + "signature": "let make: int => t" }, { - "id": "Js.Typed_array.Int32Array.of_buffer", + "id": "Js.Typed_array.ArrayBuffer.byteLength", "kind": "value", - "name": "of_buffer", + "name": "byteLength", "docstrings": [], - "signature": "let of_buffer: array_buffer => t", - "deprecated": "use `fromBuffer` instead" + "signature": "let byteLength: t => int" } ] }, - "js/typed_array/uint16array": { - "id": "Js.Typed_array.Uint16Array", - "name": "Uint16Array", + "js/typed_array/type": { + "id": "Js.Typed_array.Type", + "name": "Type", "docstrings": [], "items": [ { - "id": "Js.Typed_array.Uint16Array.elt", + "id": "Js.Typed_array.Type.t", "kind": "type", - "name": "elt", - "docstrings": [ - "" - ], - "signature": "type elt = int" - }, + "name": "t", + "docstrings": [], + "signature": "type t" + } + ] + }, + "js/json/kind": { + "id": "Js.Json.Kind", + "name": "Kind", + "docstrings": [], + "items": [ { - "id": "Js.Typed_array.Uint16Array.typed_array", + "id": "Js.Json.Kind.json", "kind": "type", - "name": "typed_array", + "name": "json", "docstrings": [], - "signature": "type typed_array<\n 'a,\n> = Js_typed_array2.Uint16Array.typed_array<'a>" + "signature": "type json = t" }, { - "id": "Js.Typed_array.Uint16Array.t", + "id": "Js.Json.Kind.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" - }, + "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.Typed_array.Uint16Array.fillInPlace", - "kind": "value", - "name": "fillInPlace", + "id": "Js.WeakMap.t", + "kind": "type", + "name": "t", "docstrings": [], - "signature": "let fillInPlace: (elt, t) => t" - }, + "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.Typed_array.Uint16Array.fillFromInPlace", - "kind": "value", - "name": "fillFromInPlace", + "id": "Js.Map.t", + "kind": "type", + "name": "t", "docstrings": [], - "signature": "let fillFromInPlace: (elt, ~from: int, t) => t" - }, + "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.Typed_array.Uint16Array.fillRangeInPlace", - "kind": "value", - "name": "fillRangeInPlace", + "id": "Js.WeakSet.t", + "kind": "type", + "name": "t", "docstrings": [], - "signature": "let fillRangeInPlace: (elt, ~start: int, ~end_: int, t) => t" - }, + "signature": "type t<'a> = WeakSet.t<'a>" + } + ] + }, + "js/set": { + "id": "Js.Set", + "name": "Set", + "docstrings": [ + "Provides bindings for ES6 Set", + "ES6 Set API" + ], + "items": [ { - "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" - } - ] - }, - "js/vector": { - "id": "Js.Vector", - "name": "Vector", - "docstrings": [ - "Provides bindings for JS Vector" - ], - "items": [ - { - "id": "Js.Vector.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" - }, - { - "id": "Js.Vector.length", - "kind": "value", - "name": "length", - "docstrings": [ - "Return the length (number of elements) of the given array." - ], - "signature": "let length: t<'a> => int" - }, - { - "id": "Js.Vector.get", - "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" - }, - { - "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.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.Vector.init", - "kind": "value", - "name": "init", - "docstrings": [ - "Raises `RangeError` when n is negative.\nn : size" - ], - "signature": "let init: (int, int => 'a) => t<'a>" - }, - { - "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.Vector.unsafe_get", - "kind": "value", - "name": "unsafe_get", - "docstrings": [], - "signature": "let unsafe_get: (t<'a>, int) => 'a" - }, - { - "id": "Js.Vector.unsafe_set", - "kind": "value", - "name": "unsafe_set", + "id": "Js.Set.t", + "kind": "type", + "name": "t", "docstrings": [], - "signature": "let unsafe_set: (t<'a>, int, 'a) => unit" + "signature": "type t<'a> = Set.t<'a>" } ] }, - "js/list": { - "id": "Js.List", - "name": "List", + "js/console": { + "id": "Js.Console", + "name": "Console", "docstrings": [ - "Provide utilities for list" + "Provides bindings for console" ], "items": [ { - "id": "Js.List.t", - "kind": "type", - "name": "t", + "id": "Js.Console.log", + "kind": "value", + "name": "log", "docstrings": [], - "signature": "type t<'a> = list<'a>" + "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", @@ -12338,28 +9185,28 @@ "kind": "value", "name": "then_", "docstrings": [], - "signature": "let then_: ('a => promise<'b>, promise<'a>) => promise<'b>" + "signature": "let then_: (promise<'a>, 'a => promise<'b>) => promise<'b>" }, { - "id": "Js.Promise.catch", + "id": "Js.Promise.then_", "kind": "value", - "name": "catch", + "name": "then_", "docstrings": [], - "signature": "let catch: (error => promise<'a>, promise<'a>) => promise<'a>" + "signature": "let then_: ('a => promise<'b>, promise<'a>) => promise<'b>" }, { - "id": "Js.Promise.unsafe_async", + "id": "Js.Promise.catch", "kind": "value", - "name": "unsafe_async", + "name": "catch", "docstrings": [], - "signature": "let unsafe_async: 'a => promise<'a>" + "signature": "let catch: (promise<'a>, error => promise<'a>) => promise<'a>" }, { - "id": "Js.Promise.unsafe_await", + "id": "Js.Promise.catch", "kind": "value", - "name": "unsafe_await", + "name": "catch", "docstrings": [], - "signature": "let unsafe_await: promise<'a> => 'a" + "signature": "let catch: (error => promise<'a>, promise<'a>) => promise<'a>" } ] }, @@ -12378,7 +9225,7 @@ "docstrings": [ "The RegExp object." ], - "signature": "type t" + "signature": "type t = RegExp.t" }, { "id": "Js.Re.result", @@ -12396,7 +9243,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 +9276,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 +9321,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 +9375,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 +9599,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 +9644,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 +9653,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 +9662,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 +9671,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 +9689,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 +9734,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>" }, @@ -12896,7 +9743,7 @@ "kind": "value", "name": "splitByReAtMost", "docstrings": [ - "`splitByReAtMost(str, regex, ~limit:n)` splits the given `str` at every\noccurrence of `regex` and returns an array of the first `n` resulting\nsubstrings. If `n` is negative or greater than the number of substrings, the\narray will contain all the 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.splitByReAtMost(\"one: two: three: four\", %re(\"/\\s*:\\s*TODO/\"), ~limit=3) == [\n Some(\"one\"),\n Some(\"two\"),\n Some(\"three\"),\n ]\n\nJs.String2.splitByReAtMost(\"one: two: three: four\", %re(\"/\\s*:\\s*TODO/\"), ~limit=0) == []\n\nJs.String2.splitByReAtMost(\"one: two: three: four\", %re(\"/\\s*:\\s*TODO/\"), ~limit=8) == [\n Some(\"one\"),\n Some(\"two\"),\n Some(\"three\"),\n Some(\"four\"),\n ]\n```" + "`splitByReAtMost(str, regex, ~limit:n)` splits the given `str` at every\noccurrence of `regex` and returns an array of the first `n` resulting\nsubstrings. If `n` is negative or greater than the number of substrings, the\narray will contain all the 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.splitByReAtMost(\"one: two: three: four\", /\\s*:\\s*TODO/, ~limit=3) == [\n Some(\"one\"),\n Some(\"two\"),\n Some(\"three\"),\n ]\n\nJs.String2.splitByReAtMost(\"one: two: three: four\", /\\s*:\\s*TODO/, ~limit=0) == []\n\nJs.String2.splitByReAtMost(\"one: two: three: four\", /\\s*:\\s*TODO/, ~limit=8) == [\n Some(\"one\"),\n Some(\"two\"),\n Some(\"three\"),\n Some(\"four\"),\n ]\n```" ], "signature": "let splitByReAtMost: (t, Js_re.t, ~limit: int) => array>" }, @@ -13106,6 +9953,15 @@ ], "signature": "let get: (t, int) => t" }, + { + "id": "Js.String.charAt", + "kind": "value", + "name": "charAt", + "docstrings": [ + "`charAt(n, s)` gets the character at index `n` within string `s`. If `n` is\nnegative or greater than the length of `s`, it returns the empty string. If the\nstring contains characters outside the range \\u0000-\\uffff, it will return the\nfirst 16-bit value at that position in the string.\n\nSee [`String.charAt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/charAt)\non MDN.\n\n## Examples\n\n```rescript\nJs.String.charAt(0, \"Reason\") == \"R\"\nJs.String.charAt(12, \"Reason\") == \"\"\nJs.String.charAt(5, `Rẽasöń`) == `ń`\n```" + ], + "signature": "let charAt: (t, int) => t" + }, { "id": "Js.String.charAt", "kind": "value", @@ -13113,6 +9969,15 @@ "docstrings": [], "signature": "let charAt: (int, t) => t" }, + { + "id": "Js.String.charCodeAt", + "kind": "value", + "name": "charCodeAt", + "docstrings": [ + "`charCodeAt(n, s)` returns the character code at position `n` in string `s`;\nthe result is in the range 0-65535, unlke `codePointAt`, so it will not work\ncorrectly for characters with code points greater than or equal to 0x10000. The\nreturn type is `float` because this function returns NaN if `n` is less than\nzero or greater than the length of the string.\n\nSee [`String.charCodeAt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/charCodeAt)\non MDN.\n\n## Examples\n\n```rescript\nJs.String.charCodeAt(0, `😺`) == 0xd83d->Belt.Int.toFloat\nJs.String.codePointAt(0, `😺`) == Some(0x1f63a)\n```" + ], + "signature": "let charCodeAt: (t, int) => float" + }, { "id": "Js.String.charCodeAt", "kind": "value", @@ -13120,6 +9985,15 @@ "docstrings": [], "signature": "let charCodeAt: (int, t) => float" }, + { + "id": "Js.String.codePointAt", + "kind": "value", + "name": "codePointAt", + "docstrings": [ + "`codePointAt(n, s)` returns the code point at position `n` within string `s` as\na `Some(value)`. The return value handles code points greater than or equal to\n0x10000. If there is no code point at the given position, the function returns\n`None`.\n\nSee [`String.codePointAt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/codePointAt)\non MDN.\n\n## Examples\n\n```rescript\nJs.String.codePointAt(1, `¿😺?`) == Some(0x1f63a)\nJs.String.codePointAt(5, \"abc\") == None\n```" + ], + "signature": "let codePointAt: (t, int) => option" + }, { "id": "Js.String.codePointAt", "kind": "value", @@ -13127,6 +10001,15 @@ "docstrings": [], "signature": "let codePointAt: (int, t) => option" }, + { + "id": "Js.String.concat", + "kind": "value", + "name": "concat", + "docstrings": [ + "`concat(append, original)` returns a new `string` with `append` added after\n`original`.\n\nSee [`String.concat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/concat)\non MDN.\n\n## Examples\n\n```rescript\nJs.String.concat(\"bell\", \"cow\") == \"cowbell\"\n```" + ], + "signature": "let concat: (t, t) => t" + }, { "id": "Js.String.concat", "kind": "value", @@ -13134,6 +10017,15 @@ "docstrings": [], "signature": "let concat: (t, t) => t" }, + { + "id": "Js.String.concatMany", + "kind": "value", + "name": "concatMany", + "docstrings": [ + "`concat(arr, original)` returns a new `string` consisting of each item of an\narray of strings added to the `original` string.\n\nSee [`String.concat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/concat)\non MDN.\n\n## Examples\n\n```rescript\nJs.String.concatMany([\"2nd\", \"3rd\", \"4th\"], \"1st\") == \"1st2nd3rd4th\"\n```" + ], + "signature": "let concatMany: (t, array) => t" + }, { "id": "Js.String.concatMany", "kind": "value", @@ -13141,6 +10033,15 @@ "docstrings": [], "signature": "let concatMany: (array, t) => t" }, + { + "id": "Js.String.endsWith", + "kind": "value", + "name": "endsWith", + "docstrings": [ + "ES2015: `endsWith(substr, str)` returns `true` if the `str` ends with `substr`,\n`false` otherwise.\n\nSee [`String.endsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith)\non MDN.\n\n## Examples\n\n```rescript\nJs.String.endsWith(\"Script\", \"ReScript\") == true\nJs.String.endsWith(\"Script\", \"C++\") == false\n```" + ], + "signature": "let endsWith: (t, t) => bool" + }, { "id": "Js.String.endsWith", "kind": "value", @@ -13148,6 +10049,15 @@ "docstrings": [], "signature": "let endsWith: (t, t) => bool" }, + { + "id": "Js.String.endsWithFrom", + "kind": "value", + "name": "endsWithFrom", + "docstrings": [ + "`endsWithFrom(ending, len, str)` returns `true` if the first len characters of\n`str` end with `ending`, `false` otherwise. If `len` is greater than or equal\nto the length of `str`, then it works like `endsWith`. (Honestly, this should\nhave been named endsWithAt, but oh well.)\n\nSee [`String.endsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith)\non MDN.\n\n## Examples\n\n```rescript\nJs.String.endsWithFrom(\"cd\", 4, \"abcd\") == true\nJs.String.endsWithFrom(\"cd\", 3, \"abcde\") == false\nJs.String.endsWithFrom(\"cde\", 99, \"abcde\") == true\nJs.String.endsWithFrom(\"ple\", 7, \"example.dat\") == true\n```" + ], + "signature": "let endsWithFrom: (t, t, int) => bool" + }, { "id": "Js.String.endsWithFrom", "kind": "value", @@ -13155,6 +10065,15 @@ "docstrings": [], "signature": "let endsWithFrom: (t, int, t) => bool" }, + { + "id": "Js.String.includes", + "kind": "value", + "name": "includes", + "docstrings": [ + "ES2015: `includes(searchValue, str)` returns `true` if `searchValue` is found\nanywhere within `str`, false otherwise.\n\nSee [`String.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes)\non MDN.\n\n## Examples\n\n```rescript\nJs.String.includes(\"gram\", \"programmer\") == true\nJs.String.includes(\"er\", \"programmer\") == true\nJs.String.includes(\"pro\", \"programmer\") == true\nJs.String.includes(\"xyz\", \"programmer.dat\") == false\n```" + ], + "signature": "let includes: (t, t) => bool" + }, { "id": "Js.String.includes", "kind": "value", @@ -13162,6 +10081,15 @@ "docstrings": [], "signature": "let includes: (t, t) => bool" }, + { + "id": "Js.String.includesFrom", + "kind": "value", + "name": "includesFrom", + "docstrings": [ + "ES2015: `includes(searchValue start, str)` returns `true` if `searchValue` is\nfound anywhere within `str` starting at character number `start` (where 0 is\nthe first character), `false` otherwise.\n\nSee [`String.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes)\non MDN.\n\n## Examples\n\n```rescript\nJs.String.includesFrom(\"gram\", 1, \"programmer\") == true\nJs.String.includesFrom(\"gram\", 4, \"programmer\") == false\nJs.String.includesFrom(`한`, 1, `대한민국`) == true\n```" + ], + "signature": "let includesFrom: (t, t, int) => bool" + }, { "id": "Js.String.includesFrom", "kind": "value", @@ -13169,6 +10097,15 @@ "docstrings": [], "signature": "let includesFrom: (t, int, t) => bool" }, + { + "id": "Js.String.indexOf", + "kind": "value", + "name": "indexOf", + "docstrings": [ + "ES2015: `indexOf(searchValue, str)` returns the position at which `searchValue`\nwas first found within `str`, or -1 if `searchValue` is not in `str`.\n\nSee [`String.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf)\non MDN.\n\n## Examples\n\n```rescript\nJs.String.indexOf(\"ok\", \"bookseller\") == 2\nJs.String.indexOf(\"sell\", \"bookseller\") == 4\nJs.String.indexOf(\"ee\", \"beekeeper\") == 1\nJs.String.indexOf(\"xyz\", \"bookseller\") == -1\n```" + ], + "signature": "let indexOf: (t, t) => int" + }, { "id": "Js.String.indexOf", "kind": "value", @@ -13176,6 +10113,15 @@ "docstrings": [], "signature": "let indexOf: (t, t) => int" }, + { + "id": "Js.String.indexOfFrom", + "kind": "value", + "name": "indexOfFrom", + "docstrings": [ + "`indexOfFrom(searchValue, start, str)` returns the position at which\n`searchValue` was found within `str` starting at character position `start`, or\n-1 if `searchValue` is not found in that portion of `str`. The return value is\nrelative to the beginning of the string, no matter where the search started\nfrom.\n\nSee [`String.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf)\non MDN.\n\n## Examples\n\n```rescript\nJs.String.indexOfFrom(\"ok\", 1, \"bookseller\") == 2\nJs.String.indexOfFrom(\"sell\", 2, \"bookseller\") == 4\nJs.String.indexOfFrom(\"sell\", 5, \"bookseller\") == -1\n```" + ], + "signature": "let indexOfFrom: (t, t, int) => int" + }, { "id": "Js.String.indexOfFrom", "kind": "value", @@ -13183,6 +10129,15 @@ "docstrings": [], "signature": "let indexOfFrom: (t, int, t) => int" }, + { + "id": "Js.String.lastIndexOf", + "kind": "value", + "name": "lastIndexOf", + "docstrings": [ + "`lastIndexOf(searchValue, str)` returns the position of the last occurrence of\n`searchValue` within `str`, searching backwards from the end of the string.\nReturns -1 if `searchValue` is not in `str`. The return value is always\nrelative to the beginning of the string.\n\nSee [`String.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/lastIndexOf)\non MDN.\n\n## Examples\n\n```rescript\nJs.String.lastIndexOf(\"ok\", \"bookseller\") == 2\nJs.String.lastIndexOf(\"ee\", \"beekeeper\") == 4\nJs.String.lastIndexOf(\"xyz\", \"abcdefg\") == -1\n```" + ], + "signature": "let lastIndexOf: (t, t) => int" + }, { "id": "Js.String.lastIndexOf", "kind": "value", @@ -13190,6 +10145,15 @@ "docstrings": [], "signature": "let lastIndexOf: (t, t) => int" }, + { + "id": "Js.String.lastIndexOfFrom", + "kind": "value", + "name": "lastIndexOfFrom", + "docstrings": [ + "`lastIndexOfFrom(searchValue, start, str)` returns the position of the last\noccurrence of `searchValue` within `str`, searching backwards from the given\nstart position. Returns -1 if `searchValue` is not in `str`. The return value\nis always relative to the beginning of the string.\n\nSee [`String.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/lastIndexOf)\non MDN.\n\n## Examples\n\n```rescript\nJs.String.lastIndexOfFrom(\"ok\", 6, \"bookseller\") == 2\nJs.String.lastIndexOfFrom(\"ee\", 8, \"beekeeper\") == 4\nJs.String.lastIndexOfFrom(\"ee\", 3, \"beekeeper\") == 1\nJs.String.lastIndexOfFrom(\"xyz\", 4, \"abcdefg\") == -1\n```" + ], + "signature": "let lastIndexOfFrom: (t, t, int) => int" + }, { "id": "Js.String.lastIndexOfFrom", "kind": "value", @@ -13197,6 +10161,15 @@ "docstrings": [], "signature": "let lastIndexOfFrom: (t, int, t) => int" }, + { + "id": "Js.String.localeCompare", + "kind": "value", + "name": "localeCompare", + "docstrings": [ + "`localeCompare(comparison, reference)` returns\n- a negative value if reference comes before comparison in sort order\n- zero if reference and comparison have the same sort order\n- a positive value if reference comes after comparison in sort order\n\nSee [`String.localeCompare`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/localeCompare) on MDN.\n\n## Examples\n\n```rescript\nJs.String.localeCompare(\"ant\", \"zebra\") > 0.0\nJs.String.localeCompare(\"zebra\", \"ant\") < 0.0\nJs.String.localeCompare(\"cat\", \"cat\") == 0.0\nJs.String.localeCompare(\"cat\", \"CAT\") > 0.0\n```" + ], + "signature": "let localeCompare: (t, t) => float" + }, { "id": "Js.String.localeCompare", "kind": "value", @@ -13204,6 +10177,15 @@ "docstrings": [], "signature": "let localeCompare: (t, t) => float" }, + { + "id": "Js.String.match_", + "kind": "value", + "name": "match_", + "docstrings": [ + "`match(regexp, str)` 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\n\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.String.match_(/b[aeiou]t/, \"The better bats\") == Some([\"bet\"])\nJs.String.match_(/b[aeiou]t/g, \"The better bats\") == Some([\"bet\", \"bat\"])\nJs.String.match_(/(\\d+)-(\\d+)-(\\d+)/, \"Today is 2018-04-05.\") ==\n Some([\"2018-04-05\", \"2018\", \"04\", \"05\"])\nJs.String.match_(/b[aeiou]g/, \"The large container.\") == None\n```" + ], + "signature": "let match_: (t, Js_re.t) => option>>" + }, { "id": "Js.String.match_", "kind": "value", @@ -13220,6 +10202,15 @@ ], "signature": "let normalize: t => t" }, + { + "id": "Js.String.normalizeByForm", + "kind": "value", + "name": "normalizeByForm", + "docstrings": [ + "ES2015: `normalize(form, str)` returns the normalized Unicode string using the specified form of normalization, which may be one of:\n- \"NFC\" — Normalization Form Canonical Composition.\n- \"NFD\" — Normalization Form Canonical Decomposition.\n- \"NFKC\" — Normalization Form Compatibility Composition.\n- \"NFKD\" — Normalization Form Compatibility Decomposition.\n\nSee [`String.normalize`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize) on MDN.\n\nSee also [Unicode technical report #15](https://unicode.org/reports/tr15/) for details." + ], + "signature": "let normalizeByForm: (t, t) => t" + }, { "id": "Js.String.normalizeByForm", "kind": "value", @@ -13227,6 +10218,15 @@ "docstrings": [], "signature": "let normalizeByForm: (t, t) => t" }, + { + "id": "Js.String.repeat", + "kind": "value", + "name": "repeat", + "docstrings": [ + "`repeat(n, str)` returns a `string` that consists of `n` repetitions of `str`.\nRaises `RangeError` if `n` is negative.\n\nSee [`String.repeat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/repeat)\non MDN.\n\n## Examples\n\n```rescript\nJs.String.repeat(3, \"ha\") == \"hahaha\"\nJs.String.repeat(0, \"empty\") == \"\"\n```" + ], + "signature": "let repeat: (t, int) => t" + }, { "id": "Js.String.repeat", "kind": "value", @@ -13234,6 +10234,15 @@ "docstrings": [], "signature": "let repeat: (int, t) => t" }, + { + "id": "Js.String.replace", + "kind": "value", + "name": "replace", + "docstrings": [ + "ES2015: `replace(substr, newSubstr, str)` returns a new `string` which is\nidentical to `str` except with the first matching instance of `substr` replaced\nby `newSubstr`. `substr` is treated as a verbatim string to match, not a\nregular expression.\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.String.replace(\"old\", \"new\", \"old string\") == \"new string\"\nJs.String.replace(\"the\", \"this\", \"the cat and the dog\") == \"this cat and the dog\"\n```" + ], + "signature": "let replace: (t, t, t) => t" + }, { "id": "Js.String.replace", "kind": "value", @@ -13241,6 +10250,15 @@ "docstrings": [], "signature": "let replace: (t, t, t) => t" }, + { + "id": "Js.String.replaceByRe", + "kind": "value", + "name": "replaceByRe", + "docstrings": [ + "`replaceByRe(regex, replacement, str)` 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.String.replaceByRe(/[aeiou]/g, \"x\", \"vowels be gone\") == \"vxwxls bx gxnx\"\nJs.String.replaceByRe(/(\\w+) (\\w+)/, \"$2, $1\", \"Juan Fulano\") == \"Fulano, Juan\"\n```" + ], + "signature": "let replaceByRe: (t, Js_re.t, t) => t" + }, { "id": "Js.String.replaceByRe", "kind": "value", @@ -13248,6 +10266,15 @@ "docstrings": [], "signature": "let replaceByRe: (Js_re.t, t, t) => t" }, + { + "id": "Js.String.unsafeReplaceBy0", + "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 = /[aeiou]/g\nlet matchFn = (matchPart, _offset, _wholeString) => Js.String.toUpperCase(matchPart)\n\nJs.String.unsafeReplaceBy0(re, matchFn, str) == \"bEAUtIfUl vOwEls\"\n```" + ], + "signature": "let unsafeReplaceBy0: (t, Js_re.t, (t, int, t) => t) => t" + }, { "id": "Js.String.unsafeReplaceBy0", "kind": "value", @@ -13255,6 +10282,15 @@ "docstrings": [], "signature": "let unsafeReplaceBy0: (Js_re.t, (t, int, t) => t, t) => t" }, + { + "id": "Js.String.unsafeReplaceBy1", + "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 = /(Jony is )\\d+/g\nlet matchFn = (_match, part1, _offset, _wholeString) => {\n part1 ++ \"41\"\n}\n\nJs.String.unsafeReplaceBy1(re, matchFn, str) == \"Jony is 41\"\n```" + ], + "signature": "let unsafeReplaceBy1: (t, Js_re.t, (t, t, int, t) => t) => t" + }, { "id": "Js.String.unsafeReplaceBy1", "kind": "value", @@ -13262,6 +10298,15 @@ "docstrings": [], "signature": "let unsafeReplaceBy1: (Js_re.t, (t, t, int, t) => t, t) => t" }, + { + "id": "Js.String.unsafeReplaceBy2", + "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 = /(\\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.String.unsafeReplaceBy2(re, matchFn, str) == \"42\"\n```" + ], + "signature": "let unsafeReplaceBy2: (t, Js_re.t, (t, t, t, int, t) => t) => t" + }, { "id": "Js.String.unsafeReplaceBy2", "kind": "value", @@ -13269,6 +10314,15 @@ "docstrings": [], "signature": "let unsafeReplaceBy2: (Js_re.t, (t, t, t, int, t) => t, t) => t" }, + { + "id": "Js.String.unsafeReplaceBy3", + "kind": "value", + "name": "unsafeReplaceBy3", + "docstrings": [ + "Returns a new `string` with some or all matches of a pattern with three 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." + ], + "signature": "let unsafeReplaceBy3: (t, Js_re.t, (t, t, t, t, int, t) => t) => t" + }, { "id": "Js.String.unsafeReplaceBy3", "kind": "value", @@ -13276,6 +10330,15 @@ "docstrings": [], "signature": "let unsafeReplaceBy3: (Js_re.t, (t, t, t, t, int, t) => t, t) => t" }, + { + "id": "Js.String.search", + "kind": "value", + "name": "search", + "docstrings": [ + "`search(regexp, str)` 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.String.search(/\\d+/, \"testing 1 2 3\") == 8\nJs.String.search(/\\d+/, \"no numbers\") == -1\n```" + ], + "signature": "let search: (t, Js_re.t) => int" + }, { "id": "Js.String.search", "kind": "value", @@ -13283,6 +10346,15 @@ "docstrings": [], "signature": "let search: (Js_re.t, t) => int" }, + { + "id": "Js.String.slice", + "kind": "value", + "name": "slice", + "docstrings": [ + "`slice(from:n1, to_:n2, str)` returns the substring of `str` starting at\ncharacter `n1` up to but not including `n2`.\n- If either `n1` or `n2` is negative, then it is evaluated as `length(str - n1)` or `length(str - n2)`.\n- If `n2` is greater than the length of `str`, then it is treated as `length(str)`.\n- If `n1` is greater than `n2`, slice returns the empty string.\n\nSee [`String.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) on MDN.\n\n## Examples\n\n```rescript\nJs.String.slice(~from=2, ~to_=5, \"abcdefg\") == \"cde\"\nJs.String.slice(~from=2, ~to_=9, \"abcdefg\") == \"cdefg\"\nJs.String.slice(~from=-4, ~to_=-2, \"abcdefg\") == \"de\"\nJs.String.slice(~from=5, ~to_=1, \"abcdefg\") == \"\"\n```" + ], + "signature": "let slice: (t, ~from: int, ~to_: int) => t" + }, { "id": "Js.String.slice", "kind": "value", @@ -13290,6 +10362,15 @@ "docstrings": [], "signature": "let slice: (~from: int, ~to_: int, t) => t" }, + { + "id": "Js.String.sliceToEnd", + "kind": "value", + "name": "sliceToEnd", + "docstrings": [ + "`sliceToEnd(str, from:n)` returns the substring of `str` starting at character\n`n` to the end of the string.\n- If `n` is negative, then it is evaluated as `length(str - n)`.\n- If `n` is greater than the length of `str`, then sliceToEnd returns the empty string.\n\nSee [`String.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) on MDN.\n\n## Examples\n\n```rescript\nJs.String.sliceToEnd(~from=4, \"abcdefg\") == \"efg\"\nJs.String.sliceToEnd(~from=-2, \"abcdefg\") == \"fg\"\nJs.String.sliceToEnd(~from=7, \"abcdefg\") == \"\"\n```" + ], + "signature": "let sliceToEnd: (t, ~from: int) => t" + }, { "id": "Js.String.sliceToEnd", "kind": "value", @@ -13297,6 +10378,15 @@ "docstrings": [], "signature": "let sliceToEnd: (~from: int, t) => t" }, + { + "id": "Js.String.split", + "kind": "value", + "name": "split", + "docstrings": [ + "`split(delimiter, str)` splits the given `str` at every occurrence of\n`delimiter` and 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.String.split(\"-\", \"2018-01-02\") == [\"2018\", \"01\", \"02\"]\nJs.String.split(\",\", \"a,b,,c\") == [\"a\", \"b\", \"\", \"c\"]\nJs.String.split(\"::\", \"good::bad as great::awful\") == [\"good\", \"bad as great\", \"awful\"]\nJs.String.split(\";\", \"has-no-delimiter\") == [\"has-no-delimiter\"]\n```" + ], + "signature": "let split: (t, t) => array" + }, { "id": "Js.String.split", "kind": "value", @@ -13304,6 +10394,15 @@ "docstrings": [], "signature": "let split: (t, t) => array" }, + { + "id": "Js.String.splitAtMost", + "kind": "value", + "name": "splitAtMost", + "docstrings": [ + "`splitAtMost(delimiter, ~limit:n, str)` splits the given `str` at every\noccurrence of `delimiter` and returns an array of the first `n` resulting\nsubstrings. If `n` is negative or greater than the number of substrings, the\narray will contain all the 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.String.splitAtMost(\"/\", ~limit=3, \"ant/bee/cat/dog/elk\") == [\"ant\", \"bee\", \"cat\"]\nJs.String.splitAtMost(\"/\", ~limit=0, \"ant/bee/cat/dog/elk\") == []\nJs.String.splitAtMost(\"/\", ~limit=9, \"ant/bee/cat/dog/elk\") == [\"ant\", \"bee\", \"cat\", \"dog\", \"elk\"]\n```" + ], + "signature": "let splitAtMost: (t, t, ~limit: int) => array" + }, { "id": "Js.String.splitAtMost", "kind": "value", @@ -13311,6 +10410,15 @@ "docstrings": [], "signature": "let splitAtMost: (t, ~limit: int, t) => array" }, + { + "id": "Js.String.splitByRe", + "kind": "value", + "name": "splitByRe", + "docstrings": [ + "`splitByRe(regex, str)` 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.String.splitByRe(%re(\"/\\s*[,;]\\s*TODO/\"), \"art; bed , cog ;dad\") == [\n Some(\"art\"),\n Some(\"bed\"),\n Some(\"cog\"),\n Some(\"dad\"),\n ]\n```" + ], + "signature": "let splitByRe: (t, Js_re.t) => array>" + }, { "id": "Js.String.splitByRe", "kind": "value", @@ -13318,6 +10426,15 @@ "docstrings": [], "signature": "let splitByRe: (Js_re.t, t) => array>" }, + { + "id": "Js.String.splitByReAtMost", + "kind": "value", + "name": "splitByReAtMost", + "docstrings": [ + "`splitByReAtMost(regex, ~limit:n, str)` splits the given `str` at every\noccurrence of `regex` and returns an array of the first `n` resulting\nsubstrings. If `n` is negative or greater than the number of substrings, the\narray will contain all the 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.String.splitByReAtMost(%re(\"/\\s*[,;]\\s*TODO/\"), ~limit=3, \"one: two: three: four\") == [\n Some(\"one\"),\n Some(\"two\"),\n Some(\"three\"),\n ]\n\nJs.String.splitByReAtMost(%re(\"/\\s*[,;]\\s*TODO/\"), ~limit=0, \"one: two: three: four\") == []\n\nJs.String.splitByReAtMost(%re(\"/\\s*[,;]\\s*TODO/\"), ~limit=8, \"one: two: three: four\") == [\n Some(\"one\"),\n Some(\"two\"),\n Some(\"three\"),\n Some(\"four\"),\n ]\n```" + ], + "signature": "let splitByReAtMost: (t, Js_re.t, ~limit: int) => array>" + }, { "id": "Js.String.splitByReAtMost", "kind": "value", @@ -13325,6 +10442,15 @@ "docstrings": [], "signature": "let splitByReAtMost: (Js_re.t, ~limit: int, t) => array>" }, + { + "id": "Js.String.startsWith", + "kind": "value", + "name": "startsWith", + "docstrings": [ + "ES2015: `startsWith(substr, str)` returns `true` if the `str` starts with\n`substr`, `false` otherwise.\n\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith)\non MDN.\n\n## Examples\n\n```rescript\nJs.String.startsWith(\"Re\", \"ReScript\") == true\nJs.String.startsWith(\"\", \"ReScript\") == true\nJs.String.startsWith(\"Re\", \"JavaScript\") == false\n```" + ], + "signature": "let startsWith: (t, t) => bool" + }, { "id": "Js.String.startsWith", "kind": "value", @@ -13332,6 +10458,15 @@ "docstrings": [], "signature": "let startsWith: (t, t) => bool" }, + { + "id": "Js.String.startsWithFrom", + "kind": "value", + "name": "startsWithFrom", + "docstrings": [ + "ES2015: `startsWithFrom(substr, n, str)` returns `true` if the `str` starts\nwith `substr` starting at position `n`, false otherwise. If `n` is negative,\nthe search starts at the beginning of `str`.\n\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith)\non MDN.\n\n## Examples\n\n```rescript\nJs.String.startsWithFrom(\"Scri\", 2, \"ReScript\") == true\nJs.String.startsWithFrom(\"\", 2, \"ReScript\") == true\nJs.String.startsWithFrom(\"Scri\", 2, \"JavaScript\") == false\n```" + ], + "signature": "let startsWithFrom: (t, t, int) => bool" + }, { "id": "Js.String.startsWithFrom", "kind": "value", @@ -13339,6 +10474,15 @@ "docstrings": [], "signature": "let startsWithFrom: (t, int, t) => bool" }, + { + "id": "Js.String.substr", + "kind": "value", + "name": "substr", + "docstrings": [ + "`substr(~from:n, str)` returns the substring of `str` from position `n` to the\nend of the string.\n- If `n` is less than zero, the starting position is the length of `str - n`.\n- If `n` is greater than or equal to the length of `str`, returns the empty string.\n\nJavaScript’s `String.substr()` is a legacy function. When possible, use\n`substring()` instead.\n\nSee [`String.substr`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substr)\non MDN.\n\n## Examples\n\n```rescript\nJs.String.substr(~from=3, \"abcdefghij\") == \"defghij\"\nJs.String.substr(~from=-3, \"abcdefghij\") == \"hij\"\nJs.String.substr(~from=12, \"abcdefghij\") == \"\"\n```" + ], + "signature": "let substr: (t, ~from: int) => t" + }, { "id": "Js.String.substr", "kind": "value", @@ -13346,6 +10490,15 @@ "docstrings": [], "signature": "let substr: (~from: int, t) => t" }, + { + "id": "Js.String.substrAtMost", + "kind": "value", + "name": "substrAtMost", + "docstrings": [ + "`substrAtMost(~from: pos, ~length: n, str)` returns the substring of `str` of\nlength `n` starting at position `pos`.\n- If `pos` is less than zero, the starting position is the length of `str - pos`.\n- If `pos` is greater than or equal to the length of `str`, returns the empty string.\n- If `n` is less than or equal to zero, returns the empty string.\n\nJavaScript’s `String.substr()` is a legacy function. When possible, use\n`substring()` instead.\n\nSee [`String.substr`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substr)\non MDN.\n\n## Examples\n\n```rescript\nJs.String.substrAtMost(~from=3, ~length=4, \"abcdefghij\") == \"defg\"\nJs.String.substrAtMost(~from=-3, ~length=4, \"abcdefghij\") == \"hij\"\nJs.String.substrAtMost(~from=12, ~length=2, \"abcdefghij\") == \"\"\n```" + ], + "signature": "let substrAtMost: (t, ~from: int, ~length: int) => t" + }, { "id": "Js.String.substrAtMost", "kind": "value", @@ -13353,6 +10506,15 @@ "docstrings": [], "signature": "let substrAtMost: (~from: int, ~length: int, t) => t" }, + { + "id": "Js.String.substring", + "kind": "value", + "name": "substring", + "docstrings": [ + "`substring(~from: start, ~to_: finish, str)` returns characters `start` up to\nbut not including finish from `str`.\n- If `start` is less than zero, it is treated as zero.\n- If `finish` is zero or negative, the empty string is returned.\n- If `start` is greater than `finish`, the `start` and `finish` points are swapped.\n\nSee [`String.substring`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substring) on MDN.\n\n## Examples\n\n```rescript\nJs.String.substring(~from=3, ~to_=6, \"playground\") == \"ygr\"\nJs.String.substring(~from=6, ~to_=3, \"playground\") == \"ygr\"\nJs.String.substring(~from=4, ~to_=12, \"playground\") == \"ground\"\n```" + ], + "signature": "let substring: (t, ~from: int, ~to_: int) => t" + }, { "id": "Js.String.substring", "kind": "value", @@ -13360,6 +10522,15 @@ "docstrings": [], "signature": "let substring: (~from: int, ~to_: int, t) => t" }, + { + "id": "Js.String.substringToEnd", + "kind": "value", + "name": "substringToEnd", + "docstrings": [ + "`substringToEnd(~from: start, str)` returns the substring of `str` from\nposition `start` to the end.\n- If `start` is less than or equal to zero, the entire string is returned.\n- If `start` is greater than or equal to the length of `str`, the empty string is returned.\n\nSee [`String.substring`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substring) on MDN.\n\n## Examples\n\n```rescript\nJs.String.substringToEnd(~from=4, \"playground\") == \"ground\"\nJs.String.substringToEnd(~from=-3, \"playground\") == \"playground\"\nJs.String.substringToEnd(~from=12, \"playground\") == \"\"\n```" + ], + "signature": "let substringToEnd: (t, ~from: int) => t" + }, { "id": "Js.String.substringToEnd", "kind": "value", @@ -13412,6 +10583,15 @@ ], "signature": "let trim: t => t" }, + { + "id": "Js.String.anchor", + "kind": "value", + "name": "anchor", + "docstrings": [ + "`anchor(anchorName, anchorText)` creates a string with an HTML `` element\nwith name attribute of `anchorName` and `anchorText` as its content. Please do\nnot use this method, as it has been removed from the relevant web standards.\n\nSee [`String.anchor`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/anchor)\non MDN.\n\n## Examples\n\n```rescript\nJs.String.anchor(\"page1\", \"Page One\") == \"Page One\"\n```" + ], + "signature": "let anchor: (t, t) => t" + }, { "id": "Js.String.anchor", "kind": "value", @@ -13419,6 +10599,15 @@ "docstrings": [], "signature": "let anchor: (t, t) => t" }, + { + "id": "Js.String.link", + "kind": "value", + "name": "link", + "docstrings": [ + "ES2015: `link(urlText, linkText)` creates a string with an HTML `` element\nwith href attribute of `urlText` and `linkText` as its content. Please do not\nuse this method, as it has been removed from the relevant web standards.\n\nSee [`String.link`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/link)\non MDN.\n\n## Examples\n\n```rescript\nJs.String.link(\"page2.html\", \"Go to page two\") == \"Go to page two\"\n```" + ], + "signature": "let link: (t, t) => t" + }, { "id": "Js.String.link", "kind": "value", @@ -13461,7 +10650,7 @@ "docstrings": [ "A type used to describe JavaScript objects that are like an array or are iterable." ], - "signature": "type array_like<'a>" + "signature": "type array_like<'a> = Array.arrayLike<'a>" }, { "id": "Js.Array2.from", @@ -14028,47 +11217,101 @@ ], "signature": "let length: array<'a> => int" }, + { + "id": "Js.Array.copyWithin", + "kind": "value", + "name": "copyWithin", + "docstrings": [ + "Copies from the first element in the given array to the designated `~to_` position, returning the resulting array. *This function modifies the original array.* See [`Array.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104]\nJs.Array.copyWithin(~to_=2, arr) == [100, 101, 100, 101, 102]\narr == [100, 101, 100, 101, 102]\n```" + ], + "signature": "let copyWithin: (t<'a>, ~to_: int) => 'this" + }, { "id": "Js.Array.copyWithin", "kind": "value", "name": "copyWithin", "docstrings": [], - "signature": "let copyWithin: (~to_: int, t<'a>) => t<'a>" + "signature": "let copyWithin: (~to_: int, t<'a>) => 'b" + }, + { + "id": "Js.Array.copyWithinFrom", + "kind": "value", + "name": "copyWithinFrom", + "docstrings": [ + "Copies starting at element `~from` in the given array to the designated `~to_` position, returning the resulting array. *This function modifies the original array.* See [`Array.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104]\nJs.Array.copyWithinFrom(~from=2, ~to_=0, arr) == [102, 103, 104, 103, 104]\narr == [102, 103, 104, 103, 104]\n```" + ], + "signature": "let copyWithinFrom: (t<'a>, ~to_: int, ~from: int) => 'this" }, { "id": "Js.Array.copyWithinFrom", "kind": "value", "name": "copyWithinFrom", "docstrings": [], - "signature": "let copyWithinFrom: (~to_: int, ~from: int, t<'a>) => t<'a>" + "signature": "let copyWithinFrom: (~to_: int, ~from: int, t<'a>) => 'b" + }, + { + "id": "Js.Array.copyWithinFromRange", + "kind": "value", + "name": "copyWithinFromRange", + "docstrings": [ + "Copies starting at element `~start` in the given array up to but not including `~end_` to the designated `~to_` position, returning the resulting array. *This function modifies the original array.* See [`Array.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104, 105]\nJs.Array.copyWithinFromRange(~start=2, ~end_=5, ~to_=1, arr) == [100, 102, 103, 104, 104, 105]\narr == [100, 102, 103, 104, 104, 105]\n```" + ], + "signature": "let copyWithinFromRange: (t<'a>, ~to_: int, ~start: int, ~end_: int) => 'this" }, { "id": "Js.Array.copyWithinFromRange", "kind": "value", "name": "copyWithinFromRange", "docstrings": [], - "signature": "let copyWithinFromRange: (~to_: int, ~start: int, ~end_: int, t<'a>) => t<'a>" + "signature": "let copyWithinFromRange: (~to_: int, ~start: int, ~end_: int, t<'a>) => 'b" + }, + { + "id": "Js.Array.fillInPlace", + "kind": "value", + "name": "fillInPlace", + "docstrings": [ + "Sets all elements of the given array (the second arumgent) to the designated value (the first argument), returning the resulting array. *This function modifies the original array.* See [`Array.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/fill) on MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104]\nJs.Array.fillInPlace(99, arr) == [99, 99, 99, 99, 99]\narr == [99, 99, 99, 99, 99]\n```" + ], + "signature": "let fillInPlace: (t<'a>, 'a) => 'this" }, { "id": "Js.Array.fillInPlace", "kind": "value", "name": "fillInPlace", "docstrings": [], - "signature": "let fillInPlace: ('a, t<'a>) => t<'a>" + "signature": "let fillInPlace: ('a, t<'a>) => 'b" + }, + { + "id": "Js.Array.fillFromInPlace", + "kind": "value", + "name": "fillFromInPlace", + "docstrings": [ + "Sets all elements of the given array (the last arumgent) from position `~from` to the end to the designated value (the first argument), returning the resulting array. *This function modifies the original array.* See [`Array.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/fill) on MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104]\nJs.Array.fillFromInPlace(99, ~from=2, arr) == [100, 101, 99, 99, 99]\narr == [100, 101, 99, 99, 99]\n```" + ], + "signature": "let fillFromInPlace: (t<'a>, 'a, ~from: int) => 'this" }, { "id": "Js.Array.fillFromInPlace", "kind": "value", "name": "fillFromInPlace", "docstrings": [], - "signature": "let fillFromInPlace: ('a, ~from: int, t<'a>) => t<'a>" + "signature": "let fillFromInPlace: ('a, ~from: int, t<'a>) => 'b" + }, + { + "id": "Js.Array.fillRangeInPlace", + "kind": "value", + "name": "fillRangeInPlace", + "docstrings": [ + "Sets the elements of the given array (the last arumgent) from position `~start` up to but not including position `~end_` to the designated value (the first argument), returning the resulting array. *This function modifies the original array.* See [`Array.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/fill) on MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104]\nJs.Array.fillRangeInPlace(99, ~start=1, ~end_=4, arr) == [100, 99, 99, 99, 104]\narr == [100, 99, 99, 99, 104]\n```" + ], + "signature": "let fillRangeInPlace: (t<'a>, 'a, ~start: int, ~end_: int) => 'this" }, { "id": "Js.Array.fillRangeInPlace", "kind": "value", "name": "fillRangeInPlace", "docstrings": [], - "signature": "let fillRangeInPlace: ('a, ~start: int, ~end_: int, t<'a>) => t<'a>" + "signature": "let fillRangeInPlace: ('a, ~start: int, ~end_: int, t<'a>) => 'b" }, { "id": "Js.Array.pop", @@ -14079,6 +11322,15 @@ ], "signature": "let pop: t<'a> => option<'a>" }, + { + "id": "Js.Array.push", + "kind": "value", + "name": "push", + "docstrings": [ + "Appends the given value to the array, returning the number of elements in the updated array. *This function modifies the original array.* See [`Array.push`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/push) on MDN.\n\n## Examples\n\n```rescript\nlet arr = [\"ant\", \"bee\", \"cat\"]\nJs.Array.push(\"dog\", arr) == 4\narr == [\"ant\", \"bee\", \"cat\", \"dog\"]\n```" + ], + "signature": "let push: (t<'a>, 'a) => int" + }, { "id": "Js.Array.push", "kind": "value", @@ -14086,6 +11338,15 @@ "docstrings": [], "signature": "let push: ('a, t<'a>) => int" }, + { + "id": "Js.Array.pushMany", + "kind": "value", + "name": "pushMany", + "docstrings": [ + "Appends the values from one array (the first argument) to another (the second argument), returning the number of elements in the updated array. *This function modifies the original array.* See [`Array.push`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/push) on MDN.\n\n## Examples\n\n```rescript\nlet arr = [\"ant\", \"bee\", \"cat\"]\nJs.Array.pushMany([\"dog\", \"elk\"], arr) == 5\narr == [\"ant\", \"bee\", \"cat\", \"dog\", \"elk\"]\n```" + ], + "signature": "let pushMany: (t<'a>, array<'a>) => int" + }, { "id": "Js.Array.pushMany", "kind": "value", @@ -14100,7 +11361,7 @@ "docstrings": [ "Returns an array with the elements of the input array in reverse order. *This function modifies the original array.* See [`Array.reverse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reverse) on MDN.\n\n## Examples\n\n```rescript\nlet arr = [\"ant\", \"bee\", \"cat\"]\nJs.Array.reverseInPlace(arr) == [\"cat\", \"bee\", \"ant\"]\narr == [\"cat\", \"bee\", \"ant\"]\n```" ], - "signature": "let reverseInPlace: t<'a> => t<'a>" + "signature": "let reverseInPlace: t<'a> => 'this" }, { "id": "Js.Array.shift", @@ -14118,35 +11379,80 @@ "docstrings": [ "Sorts the given array in place and returns the sorted array. JavaScript sorts the array by converting the arguments to UTF-16 strings and sorting them. See the second example with sorting numbers, which does not do a numeric sort. *This function modifies the original array.* See [`Array.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort) on MDN.\n\n## Examples\n\n```rescript\nlet words = [\"bee\", \"dog\", \"ant\", \"cat\"]\nJs.Array.sortInPlace(words) == [\"ant\", \"bee\", \"cat\", \"dog\"]\nwords == [\"ant\", \"bee\", \"cat\", \"dog\"]\n\nlet numbers = [3, 30, 10, 1, 20, 2]\nJs.Array.sortInPlace(numbers) == [1, 10, 2, 20, 3, 30]\nnumbers == [1, 10, 2, 20, 3, 30]\n```" ], - "signature": "let sortInPlace: t<'a> => t<'a>" + "signature": "let sortInPlace: t<'a> => 'this" + }, + { + "id": "Js.Array.sortInPlaceWith", + "kind": "value", + "name": "sortInPlaceWith", + "docstrings": [ + "Sorts the given array in place and returns the sorted array. *This function modifies the original array.*\n\nThe first argument to `sortInPlaceWith()` is a function that compares two items from the array and returns:\n\n* an integer less than zero if the first item is less than the second item\n* zero if the items are equal\n* an integer greater than zero if the first item is greater than the second item\n\nSee [`Array.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort) on MDN.\n\n## Examples\n\n```rescript\n// sort by word length\nlet words = [\"horse\", \"aardvark\", \"dog\", \"camel\"]\nlet byLength = (s1, s2) => Js.String.length(s1) - Js.String.length(s2)\n\nJs.Array.sortInPlaceWith(byLength, words) == [\"dog\", \"horse\", \"camel\", \"aardvark\"]\n\n// sort in reverse numeric order\nlet numbers = [3, 30, 10, 1, 20, 2]\nlet reverseNumeric = (n1, n2) => n2 - n1\nJs.Array.sortInPlaceWith(reverseNumeric, numbers) == [30, 20, 10, 3, 2, 1]\n```" + ], + "signature": "let sortInPlaceWith: (t<'a>, ('a, 'a) => int) => 'this" }, { "id": "Js.Array.sortInPlaceWith", "kind": "value", "name": "sortInPlaceWith", "docstrings": [], - "signature": "let sortInPlaceWith: (('a, 'a) => int, t<'a>) => t<'a>" + "signature": "let sortInPlaceWith: (('a, 'a) => int, t<'a>) => 'b" + }, + { + "id": "Js.Array.spliceInPlace", + "kind": "value", + "name": "spliceInPlace", + "docstrings": [ + "Starting at position `~pos`, remove `~remove` elements and then add the\nelements from the `~add` array. Returns an array consisting of the removed\nitems. *This function modifies the original array.* See\n[`Array.splice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [\"a\", \"b\", \"c\", \"d\", \"e\", \"f\"]\nJs.Array.spliceInPlace(~pos=2, ~remove=2, ~add=[\"x\", \"y\", \"z\"], arr) == [\"c\", \"d\"]\narr == [\"a\", \"b\", \"x\", \"y\", \"z\", \"e\", \"f\"]\n\nlet arr2 = [\"a\", \"b\", \"c\", \"d\"]\nJs.Array.spliceInPlace(~pos=3, ~remove=0, ~add=[\"x\", \"y\"], arr2) == []\narr2 == [\"a\", \"b\", \"c\", \"x\", \"y\", \"d\"]\n\nlet arr3 = [\"a\", \"b\", \"c\", \"d\", \"e\", \"f\"]\nJs.Array.spliceInPlace(~pos=9, ~remove=2, ~add=[\"x\", \"y\", \"z\"], arr3) == []\narr3 == [\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"x\", \"y\", \"z\"]\n```" + ], + "signature": "let spliceInPlace: (t<'a>, ~pos: int, ~remove: int, ~add: array<'a>) => 'this" }, { "id": "Js.Array.spliceInPlace", "kind": "value", "name": "spliceInPlace", "docstrings": [], - "signature": "let spliceInPlace: (~pos: int, ~remove: int, ~add: array<'a>, t<'a>) => t<'a>" + "signature": "let spliceInPlace: (~pos: int, ~remove: int, ~add: array<'a>, t<'a>) => 'b" + }, + { + "id": "Js.Array.removeFromInPlace", + "kind": "value", + "name": "removeFromInPlace", + "docstrings": [ + "Removes elements from the given array starting at position `~pos` to the end\nof the array, returning the removed elements. *This function modifies the\noriginal array.* See\n[`Array.splice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [\"a\", \"b\", \"c\", \"d\", \"e\", \"f\"]\nJs.Array.removeFromInPlace(~pos=4, arr) == [\"e\", \"f\"]\narr == [\"a\", \"b\", \"c\", \"d\"]\n```" + ], + "signature": "let removeFromInPlace: (t<'a>, ~pos: int) => 'this" }, { "id": "Js.Array.removeFromInPlace", "kind": "value", "name": "removeFromInPlace", "docstrings": [], - "signature": "let removeFromInPlace: (~pos: int, t<'a>) => t<'a>" + "signature": "let removeFromInPlace: (~pos: int, t<'a>) => 'b" + }, + { + "id": "Js.Array.removeCountInPlace", + "kind": "value", + "name": "removeCountInPlace", + "docstrings": [ + "Removes `~count` elements from the given array starting at position `~pos`,\nreturning the removed elements. *This function modifies the original array.*\nSee\n[`Array.splice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [\"a\", \"b\", \"c\", \"d\", \"e\", \"f\"]\nJs.Array.removeCountInPlace(~pos=2, ~count=3, arr) == [\"c\", \"d\", \"e\"]\narr == [\"a\", \"b\", \"f\"]\n```" + ], + "signature": "let removeCountInPlace: (t<'a>, ~pos: int, ~count: int) => 'this" }, { "id": "Js.Array.removeCountInPlace", "kind": "value", "name": "removeCountInPlace", "docstrings": [], - "signature": "let removeCountInPlace: (~pos: int, ~count: int, t<'a>) => t<'a>" + "signature": "let removeCountInPlace: (~pos: int, ~count: int, t<'a>) => 'b" + }, + { + "id": "Js.Array.unshift", + "kind": "value", + "name": "unshift", + "docstrings": [ + "Adds the given element to the array, returning the new number of elements in\nthe array. *This function modifies the original array.* See\n[`Array.unshift`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/unshift)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [\"b\", \"c\", \"d\"]\nJs.Array.unshift(\"a\", arr) == 4\narr == [\"a\", \"b\", \"c\", \"d\"]\n```" + ], + "signature": "let unshift: (t<'a>, 'a) => int" }, { "id": "Js.Array.unshift", @@ -14155,6 +11461,15 @@ "docstrings": [], "signature": "let unshift: ('a, t<'a>) => int" }, + { + "id": "Js.Array.unshiftMany", + "kind": "value", + "name": "unshiftMany", + "docstrings": [ + "Adds the elements in the first array argument at the beginning of the second\narray argument, returning the new number of elements in the array. *This\nfunction modifies the original array.* See\n[`Array.unshift`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/unshift)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [\"d\", \"e\"]\nJs.Array.unshiftMany([\"a\", \"b\", \"c\"], arr) == 5\narr == [\"a\", \"b\", \"c\", \"d\", \"e\"]\n```" + ], + "signature": "let unshiftMany: (t<'a>, array<'a>) => int" + }, { "id": "Js.Array.unshiftMany", "kind": "value", @@ -14162,19 +11477,46 @@ "docstrings": [], "signature": "let unshiftMany: (array<'a>, t<'a>) => int" }, + { + "id": "Js.Array.concat", + "kind": "value", + "name": "concat", + "docstrings": [ + "Concatenates the first array argument to the second array argument, returning\na new array. The original arrays are not modified. See\n[`Array.concat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/concat)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array.concat([\"c\", \"d\", \"e\"], [\"a\", \"b\"]) == [\"a\", \"b\", \"c\", \"d\", \"e\"]\n```" + ], + "signature": "let concat: (t<'a>, 'this) => 'this" + }, { "id": "Js.Array.concat", "kind": "value", "name": "concat", "docstrings": [], - "signature": "let concat: (t<'a>, t<'a>) => t<'a>" + "signature": "let concat: ('a, t<'b>) => 'a" + }, + { + "id": "Js.Array.concatMany", + "kind": "value", + "name": "concatMany", + "docstrings": [ + "The first argument to `concatMany()` is an array of arrays; these are added\nat the end of the second argument, returning a new array. See\n[`Array.concat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/concat)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array.concatMany([[\"d\", \"e\"], [\"f\", \"g\", \"h\"]], [\"a\", \"b\", \"c\"]) == [\n \"a\",\n \"b\",\n \"c\",\n \"d\",\n \"e\",\n \"f\",\n \"g\",\n \"h\",\n ]\n```" + ], + "signature": "let concatMany: (t<'a>, array<'this>) => 'this" }, { "id": "Js.Array.concatMany", "kind": "value", "name": "concatMany", "docstrings": [], - "signature": "let concatMany: (array>, t<'a>) => t<'a>" + "signature": "let concatMany: (array<'a>, t<'b>) => 'a" + }, + { + "id": "Js.Array.includes", + "kind": "value", + "name": "includes", + "docstrings": [ + "Returns true if the given value is in the array, `false` otherwise. See\n[`Array.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/includes)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array.includes(\"b\", [\"a\", \"b\", \"c\"]) == true\nJs.Array.includes(\"x\", [\"a\", \"b\", \"c\"]) == false\n```" + ], + "signature": "let includes: (t<'a>, 'a) => bool" }, { "id": "Js.Array.includes", @@ -14183,6 +11525,15 @@ "docstrings": [], "signature": "let includes: ('a, t<'a>) => bool" }, + { + "id": "Js.Array.indexOf", + "kind": "value", + "name": "indexOf", + "docstrings": [ + "Returns the index of the first element in the array that has the given value.\nIf the value is not in the array, returns -1. See\n[`Array.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array.indexOf(102, [100, 101, 102, 103]) == 2\nJs.Array.indexOf(999, [100, 101, 102, 103]) == -1\n```" + ], + "signature": "let indexOf: (t<'a>, 'a) => int" + }, { "id": "Js.Array.indexOf", "kind": "value", @@ -14190,6 +11541,15 @@ "docstrings": [], "signature": "let indexOf: ('a, t<'a>) => int" }, + { + "id": "Js.Array.indexOfFrom", + "kind": "value", + "name": "indexOfFrom", + "docstrings": [ + "Returns the index of the first element in the array with the given value. The\nsearch starts at position `~from`. See\n[`Array.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array.indexOfFrom(\"a\", ~from=2, [\"a\", \"b\", \"a\", \"c\", \"a\"]) == 2\nJs.Array.indexOfFrom(\"a\", ~from=3, [\"a\", \"b\", \"a\", \"c\", \"a\"]) == 4\nJs.Array.indexOfFrom(\"b\", ~from=2, [\"a\", \"b\", \"a\", \"c\", \"a\"]) == -1\n```" + ], + "signature": "let indexOfFrom: (t<'a>, 'a, ~from: int) => int" + }, { "id": "Js.Array.indexOfFrom", "kind": "value", @@ -14205,6 +11565,15 @@ "signature": "let join: t<'a> => string", "deprecated": "please use joinWith instead" }, + { + "id": "Js.Array.joinWith", + "kind": "value", + "name": "joinWith", + "docstrings": [ + "This function converts each element of the array to a string (via JavaScript)\nand concatenates them, separated by the string given in the first argument,\ninto a single string. See\n[`Array.join`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/join)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array.joinWith(\"--\", [\"ant\", \"bee\", \"cat\"]) == \"ant--bee--cat\"\nJs.Array.joinWith(\"\", [\"door\", \"bell\"]) == \"doorbell\"\nJs.Array.joinWith(\"/\", [2020, 9, 4]) == \"2020/9/4\"\nJs.Array.joinWith(\";\", [2.5, 3.6, 3e-2]) == \"2.5;3.6;0.03\"\n```" + ], + "signature": "let joinWith: (t<'a>, string) => string" + }, { "id": "Js.Array.joinWith", "kind": "value", @@ -14212,6 +11581,15 @@ "docstrings": [], "signature": "let joinWith: (string, t<'a>) => string" }, + { + "id": "Js.Array.lastIndexOf", + "kind": "value", + "name": "lastIndexOf", + "docstrings": [ + "Returns the index of the last element in the array that has the given value.\nIf the value is not in the array, returns -1. See\n[`Array.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/lastIndexOf)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array.lastIndexOf(\"a\", [\"a\", \"b\", \"a\", \"c\"]) == 2\nJs.Array.lastIndexOf(\"x\", [\"a\", \"b\", \"a\", \"c\"]) == -1\n```" + ], + "signature": "let lastIndexOf: (t<'a>, 'a) => int" + }, { "id": "Js.Array.lastIndexOf", "kind": "value", @@ -14219,6 +11597,15 @@ "docstrings": [], "signature": "let lastIndexOf: ('a, t<'a>) => int" }, + { + "id": "Js.Array.lastIndexOfFrom", + "kind": "value", + "name": "lastIndexOfFrom", + "docstrings": [ + "Returns the index of the last element in the array that has the given value,\nsearching from position `~from` down to the start of the array. If the value\nis not in the array, returns -1. See\n[`Array.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/lastIndexOf)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array.lastIndexOfFrom(\"a\", ~from=3, [\"a\", \"b\", \"a\", \"c\", \"a\", \"d\"]) == 2\nJs.Array.lastIndexOfFrom(\"c\", ~from=2, [\"a\", \"b\", \"a\", \"c\", \"a\", \"d\"]) == -1\n```" + ], + "signature": "let lastIndexOfFrom: (t<'a>, 'a, ~from: int) => int" + }, { "id": "Js.Array.lastIndexOfFrom", "kind": "value", @@ -14226,12 +11613,21 @@ "docstrings": [], "signature": "let lastIndexOfFrom: ('a, ~from: int, t<'a>) => int" }, + { + "id": "Js.Array.slice", + "kind": "value", + "name": "slice", + "docstrings": [ + "Returns a shallow copy of the given array from the `~start` index up to but\nnot including the `~end_` position. Negative numbers indicate an offset from\nthe end of the array. See\n[`Array.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice)\non MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104, 105, 106]\nJs.Array.slice(~start=2, ~end_=5, arr) == [102, 103, 104]\nJs.Array.slice(~start=-3, ~end_=-1, arr) == [104, 105]\nJs.Array.slice(~start=9, ~end_=10, arr) == []\n```" + ], + "signature": "let slice: (t<'a>, ~start: int, ~end_: int) => 'this" + }, { "id": "Js.Array.slice", "kind": "value", "name": "slice", "docstrings": [], - "signature": "let slice: (~start: int, ~end_: int, t<'a>) => t<'a>" + "signature": "let slice: (int, ~end_: int, ~obj: t<'a>) => 'b" }, { "id": "Js.Array.copy", @@ -14240,14 +11636,23 @@ "docstrings": [ "Returns a copy of the entire array. Same as `Js.Array.Slice(~start=0,\n~end_=Js.Array.length(arr), arr)`. See\n[`Array.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice)\non MDN." ], - "signature": "let copy: t<'a> => t<'a>" + "signature": "let copy: t<'a> => 'this" + }, + { + "id": "Js.Array.sliceFrom", + "kind": "value", + "name": "sliceFrom", + "docstrings": [ + "Returns a shallow copy of the given array from the given index to the end. \nSee [`Array.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice) on MDN.\n\n## Examples\n\n```rescript\nJs.Array.sliceFrom(2, [100, 101, 102, 103, 104]) == [102, 103, 104]\n```" + ], + "signature": "let sliceFrom: (t<'a>, int) => 'this" }, { "id": "Js.Array.sliceFrom", "kind": "value", "name": "sliceFrom", "docstrings": [], - "signature": "let sliceFrom: (int, t<'a>) => t<'a>" + "signature": "let sliceFrom: (int, t<'a>) => 'b" }, { "id": "Js.Array.toString", @@ -14267,6 +11672,15 @@ ], "signature": "let toLocaleString: t<'a> => string" }, + { + "id": "Js.Array.every", + "kind": "value", + "name": "every", + "docstrings": [ + "The first argument to `every()` is a predicate function that returns a boolean. The `every()` function returns `true` if the predicate function is true for all items in the given array. If given an empty array, returns `true`. See [`Array.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every) on MDN.\n\n## Examples\n\n```rescript\nlet isEven = x => mod(x, 2) == 0\nJs.Array.every(isEven, [6, 22, 8, 4]) == true\nJs.Array.every(isEven, [6, 22, 7, 4]) == false\n```" + ], + "signature": "let every: (t<'a>, 'a => bool) => bool" + }, { "id": "Js.Array.every", "kind": "value", @@ -14274,6 +11688,15 @@ "docstrings": [], "signature": "let every: ('a => bool, t<'a>) => bool" }, + { + "id": "Js.Array.everyi", + "kind": "value", + "name": "everyi", + "docstrings": [ + "The first argument to `everyi()` is a predicate function with two arguments: an array element and that element’s index; it returns a boolean. The `everyi()` function returns `true` if the predicate function is true for all items in the given array. If given an empty array, returns `true`. See [`Array.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every) on MDN.\n\n## Examples\n\n```rescript\n// determine if all even-index items are positive\nlet evenIndexPositive = (item, index) => mod(index, 2) == 0 ? item > 0 : true\n\nJs.Array.everyi(evenIndexPositive, [6, -3, 5, 8]) == true\nJs.Array.everyi(evenIndexPositive, [6, 3, -5, 8]) == false\n```" + ], + "signature": "let everyi: (t<'a>, ('a, int) => bool) => bool" + }, { "id": "Js.Array.everyi", "kind": "value", @@ -14281,19 +11704,46 @@ "docstrings": [], "signature": "let everyi: (('a, int) => bool, t<'a>) => bool" }, + { + "id": "Js.Array.filter", + "kind": "value", + "name": "filter", + "docstrings": [ + "Applies the given predicate function to each element in the array; the result is an array of those elements for which the predicate function returned `true`. See [`Array.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter) on MDN.\n\n## Examples\n\n```rescript\nlet nonEmpty = s => s != \"\"\nJs.Array.filter(nonEmpty, [\"abc\", \"\", \"\", \"def\", \"ghi\"]) == [\"abc\", \"def\", \"ghi\"]\n```" + ], + "signature": "let filter: (t<'a>, 'a => bool) => 'this" + }, { "id": "Js.Array.filter", "kind": "value", "name": "filter", "docstrings": [], - "signature": "let filter: ('a => bool, t<'a>) => t<'a>" + "signature": "let filter: ('a => bool, t<'a>) => 'b" + }, + { + "id": "Js.Array.filteri", + "kind": "value", + "name": "filteri", + "docstrings": [ + "Each element of the given array are passed to the predicate function. The\nreturn value is an array of all those elements for which the predicate\nfunction returned `true`. See\n[`Array.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter)\non MDN.\n\n## Examples\n\n```rescript\n// keep only positive elements at odd indices\nlet positiveOddElement = (item, index) => mod(index, 2) == 1 && item > 0\n\nJs.Array.filteri(positiveOddElement, [6, 3, 5, 8, 7, -4, 1]) == [3, 8]\n```" + ], + "signature": "let filteri: (t<'a>, ('a, int) => bool) => 'this" }, { "id": "Js.Array.filteri", "kind": "value", "name": "filteri", "docstrings": [], - "signature": "let filteri: (('a, int) => bool, t<'a>) => t<'a>" + "signature": "let filteri: (('a, int) => bool, t<'a>) => 'b" + }, + { + "id": "Js.Array.find", + "kind": "value", + "name": "find", + "docstrings": [ + "Returns `Some(value)` for the first element in the array that satisifies the\ngiven predicate function, or `None` if no element satisifies the predicate.\nSee\n[`Array.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find)\non MDN.\n\n## Examples\n\n```rescript\n// find first negative element\nJs.Array.find(x => x < 0, [33, 22, -55, 77, -44]) == Some(-55)\nJs.Array.find(x => x < 0, [33, 22, 55, 77, 44]) == None\n```" + ], + "signature": "let find: (t<'a>, 'a => bool) => option<'a>" }, { "id": "Js.Array.find", @@ -14302,6 +11752,15 @@ "docstrings": [], "signature": "let find: ('a => bool, t<'a>) => option<'a>" }, + { + "id": "Js.Array.findi", + "kind": "value", + "name": "findi", + "docstrings": [ + "Returns `Some(value)` for the first element in the array that satisifies the given predicate function, or `None` if no element satisifies the predicate. The predicate function takes an array element and an index as its parameters. See [`Array.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find) on MDN.\n\n## Examples\n\n```rescript\n// find first positive item at an odd index\nlet positiveOddElement = (item, index) => mod(index, 2) == 1 && item > 0\n\nJs.Array.findi(positiveOddElement, [66, -33, 55, 88, 22]) == Some(88)\nJs.Array.findi(positiveOddElement, [66, -33, 55, -88, 22]) == None\n```" + ], + "signature": "let findi: (t<'a>, ('a, int) => bool) => option<'a>" + }, { "id": "Js.Array.findi", "kind": "value", @@ -14309,6 +11768,15 @@ "docstrings": [], "signature": "let findi: (('a, int) => bool, t<'a>) => option<'a>" }, + { + "id": "Js.Array.findIndex", + "kind": "value", + "name": "findIndex", + "docstrings": [ + "Returns the index of the first element in the array that satisifies the given predicate function, or -1 if no element satisifies the predicate. See [`Array.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find) on MDN.\n\n## Examples\n\n```rescript\nJs.Array.findIndex(x => x < 0, [33, 22, -55, 77, -44]) == 2\nJs.Array.findIndex(x => x < 0, [33, 22, 55, 77, 44]) == -1\n```" + ], + "signature": "let findIndex: (t<'a>, 'a => bool) => int" + }, { "id": "Js.Array.findIndex", "kind": "value", @@ -14316,6 +11784,15 @@ "docstrings": [], "signature": "let findIndex: ('a => bool, t<'a>) => int" }, + { + "id": "Js.Array.findIndexi", + "kind": "value", + "name": "findIndexi", + "docstrings": [ + "Returns `Some(value)` for the first element in the array that satisifies the given predicate function, or `None` if no element satisifies the predicate. The predicate function takes an array element and an index as its parameters. See [`Array.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find) on MDN.\n\n## Examples\n\n```rescript\n// find index of first positive item at an odd index\nlet positiveOddElement = (item, index) => mod(index, 2) == 1 && item > 0\n\nJs.Array.findIndexi(positiveOddElement, [66, -33, 55, 88, 22]) == 3\nJs.Array.findIndexi(positiveOddElement, [66, -33, 55, -88, 22]) == -1\n```" + ], + "signature": "let findIndexi: (t<'a>, ('a, int) => bool) => int" + }, { "id": "Js.Array.findIndexi", "kind": "value", @@ -14323,6 +11800,15 @@ "docstrings": [], "signature": "let findIndexi: (('a, int) => bool, t<'a>) => int" }, + { + "id": "Js.Array.forEach", + "kind": "value", + "name": "forEach", + "docstrings": [ + "The `forEach()` function applies the function given as the first argument to each element in the array. The function you provide returns `unit`, and the `forEach()` function also returns `unit`. You use `forEach()` when you need to process each element in the array but not return any new array or value; for example, to print the items in an array. See [`Array.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach) on MDN.\n\n## Examples\n\n```rescript\n// display all elements in an array\nJs.Array.forEach(x => Js.log(x), [\"a\", \"b\", \"c\"]) == ()\n```" + ], + "signature": "let forEach: (t<'a>, 'a => unit) => unit" + }, { "id": "Js.Array.forEach", "kind": "value", @@ -14330,6 +11816,15 @@ "docstrings": [], "signature": "let forEach: ('a => unit, t<'a>) => unit" }, + { + "id": "Js.Array.forEachi", + "kind": "value", + "name": "forEachi", + "docstrings": [ + "The `forEachi()` function applies the function given as the first argument to each element in the array. The function you provide takes an item in the array and its index number, and returns `unit`. The `forEachi()` function also returns `unit`. You use `forEachi()` when you need to process each element in the array but not return any new array or value; for example, to print the items in an array. See [`Array.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach) on MDN.\n\n## Examples\n\n```rescript\n// display all elements in an array as a numbered list\nJs.Array.forEachi((item, index) => Js.log2(index + 1, item), [\"a\", \"b\", \"c\"]) == ()\n```" + ], + "signature": "let forEachi: (t<'a>, ('a, int) => unit) => unit" + }, { "id": "Js.Array.forEachi", "kind": "value", @@ -14337,6 +11832,15 @@ "docstrings": [], "signature": "let forEachi: (('a, int) => unit, t<'a>) => unit" }, + { + "id": "Js.Array.map", + "kind": "value", + "name": "map", + "docstrings": [ + "Applies the function (given as the first argument) to each item in the array,\nreturning a new array. The result array does not have to have elements of the\nsame type as the input array. See\n[`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map)\non MDN.\n\n## Examples\n\n```rescript\nJs.Array.map(x => x * x, [12, 4, 8]) == [144, 16, 64]\nJs.Array.map(Js.String.length, [\"animal\", \"vegetable\", \"mineral\"]) == [6, 9, 7]\n```" + ], + "signature": "let map: (t<'a>, 'a => 'b) => t<'b>" + }, { "id": "Js.Array.map", "kind": "value", @@ -14344,6 +11848,15 @@ "docstrings": [], "signature": "let map: ('a => 'b, t<'a>) => t<'b>" }, + { + "id": "Js.Array.mapi", + "kind": "value", + "name": "mapi", + "docstrings": [ + "Applies the function (given as the first argument) to each item in the array,\nreturning a new array. The function acceps two arguments: an item from the\narray and its index number. The result array does not have to have elements\nof the same type as the input array. See\n[`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map)\non MDN.\n\n## Examples\n\n```rescript\n// multiply each item in array by its position\nlet product = (item, index) => item * index\nJs.Array.mapi(product, [10, 11, 12]) == [0, 11, 24]\n```" + ], + "signature": "let mapi: (t<'a>, ('a, int) => 'b) => t<'b>" + }, { "id": "Js.Array.mapi", "kind": "value", @@ -14351,6 +11864,15 @@ "docstrings": [], "signature": "let mapi: (('a, int) => 'b, t<'a>) => t<'b>" }, + { + "id": "Js.Array.reduce", + "kind": "value", + "name": "reduce", + "docstrings": [ + "The `reduce()` function takes three parameters: a *reducer function*, a\nbeginning accumulator value, and an array. The reducer function has two\nparameters: an accumulated value and an element of the array.\n\n`reduce()` first calls the reducer function with the beginning value and the\nfirst element in the array. The result becomes the new accumulator value, which\nis passed in to the reducer function along with the second element in the\narray. `reduce()` proceeds through the array, passing in the result of each\nstage as the accumulator to the reducer function.\n\nWhen all array elements are processed, the final value of the accumulator\nbecomes the return value of `reduce()`. See\n[`Array.reduce`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce)\non MDN.\n\n## Examples\n\n```rescript\nlet sumOfSquares = (accumulator, item) => accumulator + item * item\n\nJs.Array.reduce(sumOfSquares, 0, [10, 2, 4]) == 120\nJs.Array.reduce(\\\"*\", 1, [10, 2, 4]) == 80\nJs.Array.reduce(\n (acc, item) => acc + Js.String.length(item),\n 0,\n [\"animal\", \"vegetable\", \"mineral\"],\n) == 22 // 6 + 9 + 7\nJs.Array.reduce((acc, item) => item /. acc, 1.0, [2.0, 4.0]) == 2.0 // 4.0 / (2.0 / 1.0)\n```" + ], + "signature": "let reduce: (t<'a>, ('b, 'a) => 'b, 'b) => 'b" + }, { "id": "Js.Array.reduce", "kind": "value", @@ -14358,6 +11880,15 @@ "docstrings": [], "signature": "let reduce: (('a, 'b) => 'a, 'a, t<'b>) => 'a" }, + { + "id": "Js.Array.reducei", + "kind": "value", + "name": "reducei", + "docstrings": [ + "The `reducei()` function takes three parameters: a *reducer function*, a\nbeginning accumulator value, and an array. The reducer function has three\nparameters: an accumulated value, an element of the array, and the index of\nthat element.\n\n`reducei()` first calls the reducer function with the beginning value, the\nfirst element in the array, and zero (its index). The result becomes the new\naccumulator value, which is passed to the reducer function along with the\nsecond element in the array and one (its index). `reducei()` proceeds from left\nto right through the array, passing in the result of each stage as the\naccumulator to the reducer function.\n\nWhen all array elements are processed, the final value of the accumulator\nbecomes the return value of `reducei()`. See\n[`Array.reduce`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce)\non MDN.\n\n## Examples\n\n```rescript\n// find sum of even-index elements in array\nlet sumOfEvens = (accumulator, item, index) =>\n if mod(index, 2) == 0 {\n accumulator + item\n } else {\n accumulator\n }\n\nJs.Array.reducei(sumOfEvens, 0, [2, 5, 1, 4, 3]) == 6\n```" + ], + "signature": "let reducei: (t<'a>, ('b, 'a, int) => 'b, 'b) => 'b" + }, { "id": "Js.Array.reducei", "kind": "value", @@ -14365,6 +11896,15 @@ "docstrings": [], "signature": "let reducei: (('a, 'b, int) => 'a, 'a, t<'b>) => 'a" }, + { + "id": "Js.Array.reduceRight", + "kind": "value", + "name": "reduceRight", + "docstrings": [ + "The `reduceRight()` function takes three parameters: a *reducer function*, a\nbeginning accumulator value, and an array. The reducer function has two\nparameters: an accumulated value and an element of the array.\n\n`reduceRight()` first calls the reducer function with the beginning value and\nthe last element in the array. The result becomes the new accumulator value,\nwhich is passed in to the reducer function along with the next-to-last element\nin the array. `reduceRight()` proceeds from right to left through the array,\npassing in the result of each stage as the accumulator to the reducer function.\n\nWhen all array elements are processed, the final value of the accumulator\nbecomes the return value of `reduceRight()`. See\n[`Array.reduceRight`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduceRight)\non MDN.\n\n**NOTE:** In many cases, `reduce()` and `reduceRight()` give the same result. However, see the last example here and compare it to the example from `reduce()`, where order makes a difference.\n\n## Examples\n\n```rescript\nlet sumOfSquares = (accumulator, item) => accumulator + item * item\n\nJs.Array.reduceRight(sumOfSquares, 0, [10, 2, 4]) == 120\nJs.Array.reduceRight((acc, item) => item /. acc, 1.0, [2.0, 4.0]) == 0.5 // 2.0 / (4.0 / 1.0)\n```" + ], + "signature": "let reduceRight: (t<'a>, ('b, 'a) => 'b, 'b) => 'b" + }, { "id": "Js.Array.reduceRight", "kind": "value", @@ -14372,6 +11912,15 @@ "docstrings": [], "signature": "let reduceRight: (('a, 'b) => 'a, 'a, t<'b>) => 'a" }, + { + "id": "Js.Array.reduceRighti", + "kind": "value", + "name": "reduceRighti", + "docstrings": [ + "The `reduceRighti()` function takes three parameters: a *reducer function*, a\nbeginning accumulator value, and an array. The reducer function has three\nparameters: an accumulated value, an element of the array, and the index of\nthat element. `reduceRighti()` first calls the reducer function with the\nbeginning value, the last element in the array, and its index (length of array\nminus one). The result becomes the new accumulator value, which is passed in to\nthe reducer function along with the second element in the array and one (its\nindex). `reduceRighti()` proceeds from right to left through the array, passing\nin the result of each stage as the accumulator to the reducer function.\n\nWhen all array elements are processed, the final value of the accumulator\nbecomes the return value of `reduceRighti()`. See\n[`Array.reduceRight`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduceRight)\non MDN.\n\n**NOTE:** In many cases, `reducei()` and `reduceRighti()` give the same result.\nHowever, there are cases where the order in which items are processed makes a\ndifference.\n\n## Examples\n\n```rescript\n// find sum of even-index elements in array\nlet sumOfEvens = (accumulator, item, index) =>\n if mod(index, 2) == 0 {\n accumulator + item\n } else {\n accumulator\n }\n\nJs.Array.reduceRighti(sumOfEvens, 0, [2, 5, 1, 4, 3]) == 6\n```" + ], + "signature": "let reduceRighti: (t<'a>, ('b, 'a, int) => 'b, 'b) => 'b" + }, { "id": "Js.Array.reduceRighti", "kind": "value", @@ -14379,6 +11928,15 @@ "docstrings": [], "signature": "let reduceRighti: (('a, 'b, int) => 'a, 'a, t<'b>) => 'a" }, + { + "id": "Js.Array.some", + "kind": "value", + "name": "some", + "docstrings": [ + "Returns `true` if the predicate function given as the first argument to\n`some()` returns `true` for any element in the array; `false` otherwise.\n\n## Examples\n\n```rescript\nlet isEven = x => mod(x, 2) == 0\n\nJs.Array.some(isEven, [3, 7, 5, 2, 9]) == true\nJs.Array.some(isEven, [3, 7, 5, 1, 9]) == false\n```" + ], + "signature": "let some: (t<'a>, 'a => bool) => bool" + }, { "id": "Js.Array.some", "kind": "value", @@ -14386,6 +11944,15 @@ "docstrings": [], "signature": "let some: ('a => bool, t<'a>) => bool" }, + { + "id": "Js.Array.somei", + "kind": "value", + "name": "somei", + "docstrings": [ + "Returns `true` if the predicate function given as the first argument to\n`somei()` returns `true` for any element in the array; `false` otherwise. The\npredicate function has two arguments: an item from the array and the index\nvalue\n\n## Examples\n\n```rescript\n// Does any string in the array\n// have the same length as its index?\n\nlet sameLength = (str, index) => Js.String.length(str) == index\n\n// \"ef\" has length 2 and is it at index 2\nJs.Array.somei(sameLength, [\"ab\", \"cd\", \"ef\", \"gh\"]) == true\n// no item has the same length as its index\nJs.Array.somei(sameLength, [\"a\", \"bc\", \"def\", \"gh\"]) == false\n```" + ], + "signature": "let somei: (t<'a>, ('a, int) => bool) => bool" + }, { "id": "Js.Array.somei", "kind": "value", @@ -14428,60 +11995,58 @@ "docstrings": [ "Represents a JS exception" ], - "signature": "type t" + "signature": "type t", + "deprecated": "Use `JsExn.t` instead" }, { "id": "Js.Exn.asJsExn", "kind": "value", "name": "asJsExn", "docstrings": [], - "signature": "let asJsExn: exn => option" + "signature": "let asJsExn: exn => option", + "deprecated": "Use `JsExn.fromException` instead" }, { "id": "Js.Exn.stack", "kind": "value", "name": "stack", "docstrings": [], - "signature": "let stack: t => option" + "signature": "let stack: t => option", + "deprecated": "Use `JsExn.stack` instead" }, { "id": "Js.Exn.message", "kind": "value", "name": "message", "docstrings": [], - "signature": "let message: t => option" + "signature": "let message: t => option", + "deprecated": "Use `JsExn.message` instead" }, { "id": "Js.Exn.name", "kind": "value", "name": "name", "docstrings": [], - "signature": "let name: t => option" + "signature": "let name: t => option", + "deprecated": "Use `JsExn.name` instead" }, { "id": "Js.Exn.fileName", "kind": "value", "name": "fileName", "docstrings": [], - "signature": "let fileName: t => option" - }, - { - "id": "Js.Exn.isCamlExceptionOrOpenVariant", - "kind": "value", - "name": "isCamlExceptionOrOpenVariant", - "docstrings": [ - "internal use only" - ], - "signature": "let isCamlExceptionOrOpenVariant: 'a => bool" + "signature": "let fileName: t => option", + "deprecated": "Use `JsExn.fileName` instead" }, { "id": "Js.Exn.anyToExnInternal", "kind": "value", "name": "anyToExnInternal", "docstrings": [ - "`anyToExnInternal(obj)` will take any value `obj` and wrap it\nin a Js.Exn.Error if given value is not an exn already. If\n`obj` is an exn, it will return `obj` without any changes.\n\nThis function is mostly useful for cases where you want to unify a type of a value\nthat potentially is either exn, a JS error, or any other JS value really (e.g. for\na value passed to a Promise.catch callback)\n\n**IMPORTANT**: This is an internal API and may be changed / removed any time in the future.\n\n## Examples\n\n```rescript\nswitch (Js.Exn.unsafeAnyToExn(\"test\")) {\n| Js.Exn.Error(v) =>\n switch(Js.Exn.message(v)) {\n | Some(str) => Js.log(\"We won't end up here\")\n | None => Js.log2(\"We will land here: \", v)\n }\n}\n```" + "`anyToExnInternal(obj)` will take any value `obj` and wrap it\nin a Exn.Error if given value is not an exn already. If\n`obj` is an exn, it will return `obj` without any changes.\n\nThis function is mostly useful for cases where you want to unify a type of a value\nthat potentially is either exn, a JS error, or any other JS value really (e.g. for\na value passed to a Promise.catch callback)\n\n**IMPORTANT**: This is an internal API and may be changed / removed any time in the future." ], - "signature": "let anyToExnInternal: 'a => exn" + "signature": "let anyToExnInternal: 'a => exn", + "deprecated": "Use `JsExn.anyToExnInternal` instead" }, { "id": "Js.Exn.raiseError", @@ -14490,49 +12055,66 @@ "docstrings": [ "Raise Js exception Error object with stacktrace" ], - "signature": "let raiseError: string => 'a" + "signature": "let raiseError: string => 'a", + "deprecated": "Use `JsError.throwWithMessage` instead" }, { "id": "Js.Exn.raiseEvalError", "kind": "value", "name": "raiseEvalError", "docstrings": [], - "signature": "let raiseEvalError: string => 'a" + "signature": "let raiseEvalError: string => 'a", + "deprecated": "Use `JsError.EvalError.throwWithMessage` instead" }, { "id": "Js.Exn.raiseRangeError", "kind": "value", "name": "raiseRangeError", "docstrings": [], - "signature": "let raiseRangeError: string => 'a" + "signature": "let raiseRangeError: string => 'a", + "deprecated": "Use `JsError.RangeError.throwWithMessage` instead" }, { "id": "Js.Exn.raiseReferenceError", "kind": "value", "name": "raiseReferenceError", "docstrings": [], - "signature": "let raiseReferenceError: string => 'a" + "signature": "let raiseReferenceError: string => 'a", + "deprecated": "Use `JsError.ReferenceError.throwWithMessage` instead" }, { "id": "Js.Exn.raiseSyntaxError", "kind": "value", "name": "raiseSyntaxError", "docstrings": [], - "signature": "let raiseSyntaxError: string => 'a" + "signature": "let raiseSyntaxError: string => 'a", + "deprecated": "Use `JsError.SyntaxError.throwWithMessage` instead" }, { "id": "Js.Exn.raiseTypeError", "kind": "value", "name": "raiseTypeError", "docstrings": [], - "signature": "let raiseTypeError: string => 'a" + "signature": "let raiseTypeError: string => 'a", + "deprecated": "Use `JsError.TypeError.throwWithMessage` instead" }, { "id": "Js.Exn.raiseUriError", "kind": "value", "name": "raiseUriError", "docstrings": [], - "signature": "let raiseUriError: string => 'a" + "signature": "let raiseUriError: string => 'a", + "deprecated": "Use `JsError.URIError.throwWithMessage` instead" + }, + { + "id": "Js.Exn.ignore", + "kind": "value", + "name": "ignore", + "docstrings": [ + "`ignore(exn)` ignores the provided exn and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." + ], + "signature": "let ignore: t => unit", + "deprecated": "Use `JsExn.ignore` instead" } ] }, @@ -14547,10 +12129,8 @@ "id": "Js.Null_undefined.t", "kind": "type", "name": "t", - "docstrings": [ - "Local alias for `Js.null_undefined<'a>`." - ], - "signature": "type t<'a> = Js.nullable<'a> = Value('a) | Null | Undefined" + "docstrings": [], + "signature": "@unboxed\ntype t<'a> = nullable<'a> =\n | Value('a)\n | @as(null) Null\n | @as(undefined) Undefined" }, { "id": "Js.Null_undefined.return", @@ -14654,10 +12234,8 @@ "id": "Js.Nullable.t", "kind": "type", "name": "t", - "docstrings": [ - "Local alias for `Js.null_undefined<'a>`." - ], - "signature": "type t<'a> = Js.nullable<'a> = Value('a) | Null | Undefined" + "docstrings": [], + "signature": "@unboxed\ntype t<'a> = nullable<'a> =\n | Value('a)\n | @as(null) Null\n | @as(undefined) Undefined" }, { "id": "Js.Nullable.return", @@ -14764,7 +12342,7 @@ "docstrings": [ "Local alias for `Js.undefined<'a>`" ], - "signature": "type t<'a> = Js.undefined<'a>" + "signature": "type t<'a> = undefined<'a>" }, { "id": "Js.Undefined.return", @@ -14883,10 +12461,8 @@ "id": "Js.Null.t", "kind": "type", "name": "t", - "docstrings": [ - "Local alias for `Js.null<'a>`" - ], - "signature": "type t<'a> = Js.null<'a> = Value('a) | Null" + "docstrings": [], + "signature": "@unboxed\ntype t<'a> = null<'a> =\n | Value('a)\n | @as(null) Null" }, { "id": "Js.Null.return", diff --git a/data/api/v12.0.0/core.json b/data/api/v12.0.0/stdlib.json similarity index 64% rename from data/api/v12.0.0/core.json rename to data/api/v12.0.0/stdlib.json index ab511e0aa..72d67d901 100644 --- a/data/api/v12.0.0/core.json +++ b/data/api/v12.0.0/stdlib.json @@ -1,83 +1,83 @@ { - "core": { - "id": "Core", - "name": "Core", + "stdlib": { + "id": "Stdlib", + "name": "Stdlib", "docstrings": [], "items": [ { - "id": "Core.timeoutId", + "id": "Stdlib.timeoutId", "kind": "type", "name": "timeoutId", "docstrings": [ "An `id` representing a timeout started via `setTimeout`.\n\nSee [`setTimeout`](https://developer.mozilla.org/en-US/docs/Web/API/setTimeout) on MDN." ], - "signature": "type timeoutId = Js.Global.timeoutId" + "signature": "type timeoutId = Global.timeoutId" }, { - "id": "Core.setTimeout", + "id": "Stdlib.setTimeout", "kind": "value", "name": "setTimeout", "docstrings": [ - "`setTimeout(callback, durationInMilliseconds)` starts a timer that will execute `callback` after `durationInMilliseconds`.\n\nSee [`setTimeout`](https://developer.mozilla.org/en-US/docs/Web/API/setTimeout) on MDN.\n\n## Examples\n```rescript\n// Log to the console after 2 seconds (2000 milliseconds).\nlet timeoutId = setTimeout(() => {\n Console.log(\"This prints in 2 seconds.\")\n}, 2000)\n```" + "`setTimeout(callback, durationInMilliseconds)` starts a timer that will execute `callback` after `durationInMilliseconds`.\n\nSee [`setTimeout`](https://developer.mozilla.org/en-US/docs/Web/API/setTimeout) on MDN.\n\n## Examples\n\n```rescript\n// Log to the console after 200 milliseconds.\nlet timeoutId = setTimeout(() => {\n Console.log(\"This prints in 200 ms.\")\n}, 200)\n```" ], "signature": "let setTimeout: (unit => unit, int) => timeoutId" }, { - "id": "Core.setTimeoutFloat", + "id": "Stdlib.setTimeoutFloat", "kind": "value", "name": "setTimeoutFloat", "docstrings": [ - "`setTimeoutFloat(callback, durationInMilliseconds)` starts a timer that will execute `callback` after `durationInMilliseconds`.\n\nThe same as `setTimeout`, but allows you to pass a `float` instead of an `int` for the duration.\n\nSee [`setTimeout`](https://developer.mozilla.org/en-US/docs/Web/API/setTimeout) on MDN.\n\n## Examples\n```rescript\n// Log to the console after 2 seconds (2000 milliseconds).\nlet timeoutId = setTimeoutFloat(() => {\n Console.log(\"This prints in 2 seconds.\")\n}, 2000.)\n```" + "`setTimeoutFloat(callback, durationInMilliseconds)` starts a timer that will execute `callback` after `durationInMilliseconds`.\n\nThe same as `setTimeout`, but allows you to pass a `float` instead of an `int` for the duration.\n\nSee [`setTimeout`](https://developer.mozilla.org/en-US/docs/Web/API/setTimeout) on MDN.\n\n## Examples\n\n```rescript\n// Log to the console after 200 milliseconds.\nlet timeoutId = setTimeoutFloat(() => {\n Console.log(\"This prints in 200 ms.\")\n}, 200.)\n```" ], "signature": "let setTimeoutFloat: (unit => unit, float) => timeoutId" }, { - "id": "Core.clearTimeout", + "id": "Stdlib.clearTimeout", "kind": "value", "name": "clearTimeout", "docstrings": [ - "`clearTimeout(timeoutId)` clears a scheduled timeout if it hasn't already executed.\n\nSee [`clearTimeout`](https://developer.mozilla.org/en-US/docs/Web/API/clearTimeout) on MDN.\n\n## Examples\n```rescript\nlet timeoutId = setTimeout(() => {\n Console.log(\"This prints in 2 seconds.\")\n}, 2000)\n\n// Clearing the timeout right away, before 2 seconds has passed, means that the above callback logging to the console will never run.\nclearTimeout(timeoutId)\n```" + "`clearTimeout(timeoutId)` clears a scheduled timeout if it hasn't already executed.\n\nSee [`clearTimeout`](https://developer.mozilla.org/en-US/docs/Web/API/clearTimeout) on MDN.\n\n## Examples\n\n```rescript\nlet timeoutId = setTimeout(() => {\n Console.log(\"This prints in 2 seconds.\")\n}, 2000)\n\n// Clearing the timeout right away, before 2 seconds has passed, means that the above callback logging to the console will never run.\nclearTimeout(timeoutId)\n```" ], "signature": "let clearTimeout: timeoutId => unit" }, { - "id": "Core.intervalId", + "id": "Stdlib.intervalId", "kind": "type", "name": "intervalId", "docstrings": [ "An `id` representing an interval started via `setInterval`.\n\nSee [`setInterval`](https://developer.mozilla.org/en-US/docs/Web/API/setInterval) on MDN." ], - "signature": "type intervalId = Js.Global.intervalId" + "signature": "type intervalId = Global.intervalId" }, { - "id": "Core.setInterval", + "id": "Stdlib.setInterval", "kind": "value", "name": "setInterval", "docstrings": [ - "`setInterval(callback, intervalInMilliseconds)` starts an interval that will execute `callback` every `durationInMilliseconds` milliseconds.\n\nSee [`setInterval`](https://developer.mozilla.org/en-US/docs/Web/API/setInterval) on MDN.\n\n## Examples\n```rescript\n// Log to the console ever 2 seconds (2000 milliseconds).\nlet intervalId = setInterval(() => {\n Console.log(\"This prints every 2 seconds.\")\n}, 2000)\n```" + "`setInterval(callback, intervalInMilliseconds)` starts an interval that will execute `callback` every `durationInMilliseconds` milliseconds.\n\nSee [`setInterval`](https://developer.mozilla.org/en-US/docs/Web/API/setInterval) on MDN.\n\n## Examples\n\n```rescript\n// Log to the console ever 200 ms (200 milliseconds).\nlet intervalId = setInterval(() => {\n Console.log(\"This prints every 200 ms.\")\n}, 200)\n\nlet timeoutId = setTimeout(() => {\n clearInterval(intervalId)\n}, 500)\n```" ], "signature": "let setInterval: (unit => unit, int) => intervalId" }, { - "id": "Core.setIntervalFloat", + "id": "Stdlib.setIntervalFloat", "kind": "value", "name": "setIntervalFloat", "docstrings": [ - "`setIntervalFloat(callback, intervalInMilliseconds)` starts an interval that will execute `callback` every `durationInMilliseconds` milliseconds.\n\nThe same as `setInterval`, but allows you to pass a `float` instead of an `int` for the duration.\n\nSee [`setInterval`](https://developer.mozilla.org/en-US/docs/Web/API/setInterval) on MDN.\n\n## Examples\n```rescript\n// Log to the console ever 2 seconds (2000 milliseconds).\nlet intervalId = setIntervalFloat(() => {\n Console.log(\"This prints every 2 seconds.\")\n}, 2000.)\n```" + "`setIntervalFloat(callback, intervalInMilliseconds)` starts an interval that will execute `callback` every `durationInMilliseconds` milliseconds.\n\nThe same as `setInterval`, but allows you to pass a `float` instead of an `int` for the duration.\n\nSee [`setInterval`](https://developer.mozilla.org/en-US/docs/Web/API/setInterval) on MDN.\n\n## Examples\n\n```rescript\n// Log to the console ever 2 seconds (200 milliseconds).\nlet intervalId = setIntervalFloat(() => {\n Console.log(\"This prints every 200 ms\")\n}, 200.)\n\n// Stop the interval after 500 ms\nlet timeoutId = setTimeoutFloat(() => {\n clearInterval(intervalId)\n}, 500.0)\n```" ], "signature": "let setIntervalFloat: (unit => unit, float) => intervalId" }, { - "id": "Core.clearInterval", + "id": "Stdlib.clearInterval", "kind": "value", "name": "clearInterval", "docstrings": [ - "`clearInterval(intervalId)` clears a scheduled interval.\n\nSee [`clearInterval`](https://developer.mozilla.org/en-US/docs/Web/API/clearInterval) on MDN.\n\n## Examples\n```rescript\nlet intervalId = setInterval(() => {\n Console.log(\"This prints in 2 seconds.\")\n}, 2000)\n\n// Stop the interval after 10 seconds\nlet timeoutId = setTimeout(() => {\n clearInterval(intervalId)\n}, 10000)\n```" + "`clearInterval(intervalId)` clears a scheduled interval.\n\nSee [`clearInterval`](https://developer.mozilla.org/en-US/docs/Web/API/clearInterval) on MDN.\n\n## Examples\n\n```rescript\nlet intervalId = setInterval(() => {\n Console.log(\"This prints in 100 ms\")\n}, 100)\n\n// Stop the interval after 500 ms\nlet timeoutId = setTimeout(() => {\n clearInterval(intervalId)\n}, 500)\n```" ], "signature": "let clearInterval: intervalId => unit" }, { - "id": "Core.encodeURI", + "id": "Stdlib.encodeURI", "kind": "value", "name": "encodeURI", "docstrings": [ @@ -86,7 +86,7 @@ "signature": "let encodeURI: string => string" }, { - "id": "Core.decodeURI", + "id": "Stdlib.decodeURI", "kind": "value", "name": "decodeURI", "docstrings": [ @@ -95,7 +95,7 @@ "signature": "let decodeURI: string => string" }, { - "id": "Core.encodeURIComponent", + "id": "Stdlib.encodeURIComponent", "kind": "value", "name": "encodeURIComponent", "docstrings": [ @@ -104,7 +104,7 @@ "signature": "let encodeURIComponent: string => string" }, { - "id": "Core.decodeURIComponent", + "id": "Stdlib.decodeURIComponent", "kind": "value", "name": "decodeURIComponent", "docstrings": [ @@ -113,482 +113,1325 @@ "signature": "let decodeURIComponent: string => string" }, { - "id": "Core.window", - "kind": "value", - "name": "window", + "id": "Stdlib.date", + "kind": "type", + "name": "date", "docstrings": [], - "signature": "let window: Dom.window" + "signature": "type date = Date.t" }, { - "id": "Core.document", - "kind": "value", - "name": "document", + "id": "Stdlib.null", + "kind": "type", + "name": "null", "docstrings": [], - "signature": "let document: Dom.document" + "signature": "type null<'a> = null<'a>" }, { - "id": "Core.globalThis", - "kind": "value", - "name": "globalThis", + "id": "Stdlib.undefined", + "kind": "type", + "name": "undefined", "docstrings": [], - "signature": "let globalThis: {..}" + "signature": "type undefined<'a> = undefined<'a>" + }, + { + "id": "Stdlib.nullable", + "kind": "type", + "name": "nullable", + "docstrings": [], + "signature": "type nullable<'a> = nullable<'a>" + }, + { + "id": "Stdlib.lazy_t", + "kind": "type", + "name": "lazy_t", + "docstrings": [], + "signature": "type lazy_t<'a> = Lazy.t<'a>", + "deprecated": "Use Lazy.t instead" }, { - "id": "Core.null", + "id": "Stdlib.window", "kind": "value", - "name": "null", + "name": "window", "docstrings": [], - "signature": "let null: Core__Nullable.t<'a>" + "signature": "let window: Dom.window", + "deprecated": "Use rescript-webapi instead" }, { - "id": "Core.undefined", + "id": "Stdlib.document", "kind": "value", - "name": "undefined", + "name": "document", "docstrings": [], - "signature": "let undefined: Core__Nullable.t<'a>" + "signature": "let document: Dom.document", + "deprecated": "Use rescript-webapi instead" }, { - "id": "Core.typeof", + "id": "Stdlib.globalThis", "kind": "value", - "name": "typeof", + "name": "globalThis", "docstrings": [], - "signature": "let typeof: 'a => Core__Type.t" + "signature": "let globalThis: {..}" }, { - "id": "Core.import", + "id": "Stdlib.import", "kind": "value", "name": "import", "docstrings": [ - "`import(value)` dynamically import a value or function from a ReScript\nmodule. The import call will return a `promise`, resolving to the dynamically loaded\nvalue.\n\n## Examples\n\n`Core__Array.res` file:\n\n```rescript\n@send external indexOf: (array<'a>, 'a) => int = \"indexOf\"\n\nlet indexOfOpt = (arr, item) =>\n switch arr->indexOf(item) {\n | -1 => None\n | index => Some(index)\n }\n```\nIn other file you can import the `indexOfOpt` value defined in `Core__Array.res`\n\n```rescript\nlet main = async () => {\n let indexOfOpt = await import(Core__Array.indexOfOpt)\n let index = indexOfOpt([1, 2], 2)\n Console.log(index)\n}\n```\n\nCompiles to:\n\n```javascript\nasync function main() {\n var add = await import(\"./Core__Array.mjs\").then(function(m) {\n return m.indexOfOpt;\n });\n var index = indexOfOpt([1, 2], 2);\n console.log(index);\n}\n```" + "`import(value)` dynamically import a value or function from a ReScript\nmodule. The import call will return a `promise`, resolving to the dynamically loaded\nvalue.\n\n## Examples\n\n`Array.res` file:\n\n```rescript\n@send external indexOf: (array<'a>, 'a) => int = \"indexOf\"\n\nlet indexOfOpt = (arr, item) =>\n switch arr->indexOf(item) {\n | -1 => None\n | index => Some(index)\n }\n```\nIn other file you can import the `indexOfOpt` value defined in `Array.res`\n\n```rescript\nlet main = async () => {\n let indexOfOpt = await import(Array.indexOfOpt)\n let index = indexOfOpt([1, 2], 2)\n Console.log(index)\n}\n```\n\nCompiles to:\n\n```javascript\nasync function main() {\n var add = await import(\"./Array.mjs\").then(function(m) {\n return m.indexOfOpt;\n });\n var index = indexOfOpt([1, 2], 2);\n console.log(index);\n}\n```" ], "signature": "let import: 'a => promise<'a>" }, { - "id": "Core.null", - "kind": "type", - "name": "null", + "id": "Stdlib.panic", + "kind": "value", + "name": "panic", "docstrings": [], - "signature": "type null<'a> = Js.null<'a>" + "signature": "let panic: string => 'a" }, { - "id": "Core.undefined", - "kind": "type", - "name": "undefined", + "id": "Stdlib.assertEqual", + "kind": "value", + "name": "assertEqual", + "docstrings": [ + "`assertEqual(a, b)` check if `a` is equal `b`. If not raise a panic exception\n\n## Examples\n\n```rescript\nlist{1, 2}\n->List.tailExn\n->assertEqual(list{2})\n```" + ], + "signature": "let assertEqual: ('a, 'a) => unit" + }, + { + "id": "Stdlib.null", + "kind": "value", + "name": "null", "docstrings": [], - "signature": "type undefined<'a> = Js.undefined<'a>" + "signature": "let null: nullable<'a>" }, { - "id": "Core.nullable", - "kind": "type", - "name": "nullable", + "id": "Stdlib.undefined", + "kind": "value", + "name": "undefined", "docstrings": [], - "signature": "type nullable<'a> = Js.nullable<'a>" + "signature": "let undefined: nullable<'a>" }, { - "id": "Core.panic", + "id": "Stdlib.typeof", "kind": "value", - "name": "panic", + "name": "typeof", "docstrings": [], - "signature": "let panic: string => 'a" + "signature": "let typeof: 'a => Type.t" } ] }, - "core/intl/numberformat/grouping": { - "id": "Core.Intl.NumberFormat.Grouping", + "stdlib/intl/numberformat/grouping": { + "id": "Stdlib.Intl.NumberFormat.Grouping", "name": "Grouping", "docstrings": [], "items": [ { - "id": "Core.Intl.NumberFormat.Grouping.t", + "id": "Stdlib.Intl.NumberFormat.Grouping.t", "kind": "type", "name": "t", "docstrings": [], "signature": "type t" }, { - "id": "Core.Intl.NumberFormat.Grouping.parsed", + "id": "Stdlib.Intl.NumberFormat.Grouping.parsed", "kind": "type", "name": "parsed", "docstrings": [], "signature": "type parsed = [#always | #auto | #bool(bool) | #min2]" }, { - "id": "Core.Intl.NumberFormat.Grouping.fromBool", + "id": "Stdlib.Intl.NumberFormat.Grouping.fromBool", "kind": "value", "name": "fromBool", "docstrings": [], "signature": "let fromBool: bool => t" }, { - "id": "Core.Intl.NumberFormat.Grouping.fromString", + "id": "Stdlib.Intl.NumberFormat.Grouping.fromString", "kind": "value", "name": "fromString", "docstrings": [], "signature": "let fromString: [#always | #auto | #min2] => t" }, { - "id": "Core.Intl.NumberFormat.Grouping.parseJsValue", + "id": "Stdlib.Intl.NumberFormat.Grouping.parseJsValue", "kind": "value", "name": "parseJsValue", "docstrings": [], "signature": "let parseJsValue: 'a => option<[> #always | #auto | #bool(bool) | #min2]>" + }, + { + "id": "Stdlib.Intl.NumberFormat.Grouping.ignore", + "kind": "value", + "name": "ignore", + "docstrings": [ + "`ignore(grouping)` ignores the provided grouping and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." + ], + "signature": "let ignore: t => unit" } ] }, - "core/intl/segments": { - "id": "Core.Intl.Segments", - "name": "Segments", - "docstrings": [ - "A Segments instance is an object that represents the segments of a specific string, subject to the locale and options of its constructing Intl.Segmenter instance.\nhttps://tc39.es/ecma402/#sec-segments-objects" - ], + "stdlib/biguint64array/constants": { + "id": "Stdlib.BigUint64Array.Constants", + "name": "Constants", + "docstrings": [], "items": [ { - "id": "Core.Intl.Segments.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - }, - { - "id": "Core.Intl.Segments.segmentData", - "kind": "type", - "name": "segmentData", - "docstrings": [], - "signature": "type segmentData = {\n segment: string,\n index: int,\n isWordLike: option,\n input: string,\n}" - }, - { - "id": "Core.Intl.Segments.containing", + "id": "Stdlib.BigUint64Array.Constants.bytesPerElement", "kind": "value", - "name": "containing", - "docstrings": [], - "signature": "let containing: t => segmentData" - }, + "name": "bytesPerElement", + "docstrings": [ + "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)" + ], + "signature": "let bytesPerElement: int" + } + ] + }, + "stdlib/bigint64array/constants": { + "id": "Stdlib.BigInt64Array.Constants", + "name": "Constants", + "docstrings": [], + "items": [ { - "id": "Core.Intl.Segments.containingWithIndex", + "id": "Stdlib.BigInt64Array.Constants.bytesPerElement", "kind": "value", - "name": "containingWithIndex", - "docstrings": [], - "signature": "let containingWithIndex: (t, int) => segmentData" + "name": "bytesPerElement", + "docstrings": [ + "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)" + ], + "signature": "let bytesPerElement: int" } ] }, - "core/intl/segmenter": { - "id": "Core.Intl.Segmenter", - "name": "Segmenter", - "docstrings": [ - "Not supported in Firefox" - ], + "stdlib/uint8clampedarray/constants": { + "id": "Stdlib.Uint8ClampedArray.Constants", + "name": "Constants", + "docstrings": [], "items": [ { - "id": "Core.Intl.Segmenter.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" - }, - { - "id": "Core.Intl.Segmenter.granularity", - "kind": "type", - "name": "granularity", - "docstrings": [], - "signature": "type granularity = [#grapheme | #sentence | #word]" - }, + "id": "Stdlib.Uint8ClampedArray.Constants.bytesPerElement", + "kind": "value", + "name": "bytesPerElement", + "docstrings": [ + "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)" + ], + "signature": "let bytesPerElement: int" + } + ] + }, + "stdlib/uint32array/constants": { + "id": "Stdlib.Uint32Array.Constants", + "name": "Constants", + "docstrings": [], + "items": [ { - "id": "Core.Intl.Segmenter.options", - "kind": "type", - "name": "options", - "docstrings": [], - "signature": "type options = {\n localeMatcher?: Core__Intl__Common.localeMatcher,\n granularity?: granularity,\n}" - }, + "id": "Stdlib.Uint32Array.Constants.bytesPerElement", + "kind": "value", + "name": "bytesPerElement", + "docstrings": [ + "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)" + ], + "signature": "let bytesPerElement: int" + } + ] + }, + "stdlib/uint16array/constants": { + "id": "Stdlib.Uint16Array.Constants", + "name": "Constants", + "docstrings": [], + "items": [ { - "id": "Core.Intl.Segmenter.pluralCategories", - "kind": "type", - "name": "pluralCategories", - "docstrings": [], - "signature": "type pluralCategories = [\n | #few\n | #many\n | #one\n | #other\n | #two\n | #zero\n]" - }, + "id": "Stdlib.Uint16Array.Constants.bytesPerElement", + "kind": "value", + "name": "bytesPerElement", + "docstrings": [ + "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)" + ], + "signature": "let bytesPerElement: int" + } + ] + }, + "stdlib/uint8array/constants": { + "id": "Stdlib.Uint8Array.Constants", + "name": "Constants", + "docstrings": [], + "items": [ { - "id": "Core.Intl.Segmenter.resolvedOptions", - "kind": "type", - "name": "resolvedOptions", - "docstrings": [], - "signature": "type resolvedOptions = {\n locale: string,\n granularity: granularity,\n}" - }, + "id": "Stdlib.Uint8Array.Constants.bytesPerElement", + "kind": "value", + "name": "bytesPerElement", + "docstrings": [ + "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)" + ], + "signature": "let bytesPerElement: int" + } + ] + }, + "stdlib/int32array/constants": { + "id": "Stdlib.Int32Array.Constants", + "name": "Constants", + "docstrings": [], + "items": [ { - "id": "Core.Intl.Segmenter.supportedLocalesOptions", - "kind": "type", - "name": "supportedLocalesOptions", - "docstrings": [], - "signature": "type supportedLocalesOptions = {\n localeMatcher: Core__Intl__Common.localeMatcher,\n}" - }, + "id": "Stdlib.Int32Array.Constants.bytesPerElement", + "kind": "value", + "name": "bytesPerElement", + "docstrings": [ + "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)" + ], + "signature": "let bytesPerElement: int" + } + ] + }, + "stdlib/int16array/constants": { + "id": "Stdlib.Int16Array.Constants", + "name": "Constants", + "docstrings": [], + "items": [ { - "id": "Core.Intl.Segmenter.make", + "id": "Stdlib.Int16Array.Constants.bytesPerElement", "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: (~locales: array=?, ~options: options=?) => t" - }, + "name": "bytesPerElement", + "docstrings": [ + "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)" + ], + "signature": "let bytesPerElement: int" + } + ] + }, + "stdlib/int8array/constants": { + "id": "Stdlib.Int8Array.Constants", + "name": "Constants", + "docstrings": [], + "items": [ { - "id": "Core.Intl.Segmenter.supportedLocalesOf", + "id": "Stdlib.Int8Array.Constants.bytesPerElement", "kind": "value", - "name": "supportedLocalesOf", - "docstrings": [], - "signature": "let supportedLocalesOf: (array, ~options: supportedLocalesOptions=?) => t" - }, + "name": "bytesPerElement", + "docstrings": [ + "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)" + ], + "signature": "let bytesPerElement: int" + } + ] + }, + "stdlib/float64array/constants": { + "id": "Stdlib.Float64Array.Constants", + "name": "Constants", + "docstrings": [], + "items": [ { - "id": "Core.Intl.Segmenter.resolvedOptions", + "id": "Stdlib.Float64Array.Constants.bytesPerElement", "kind": "value", - "name": "resolvedOptions", - "docstrings": [], - "signature": "let resolvedOptions: t => resolvedOptions" - }, + "name": "bytesPerElement", + "docstrings": [ + "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)" + ], + "signature": "let bytesPerElement: int" + } + ] + }, + "stdlib/float32array/constants": { + "id": "Stdlib.Float32Array.Constants", + "name": "Constants", + "docstrings": [], + "items": [ { - "id": "Core.Intl.Segmenter.segment", + "id": "Stdlib.Float32Array.Constants.bytesPerElement", "kind": "value", - "name": "segment", - "docstrings": [], - "signature": "let segment: (t, string) => Core__Intl__Segments.t" + "name": "bytesPerElement", + "docstrings": [ + "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)" + ], + "signature": "let bytesPerElement: int" } ] }, - "core/intl/relativetimeformat": { - "id": "Core.Intl.RelativeTimeFormat", - "name": "RelativeTimeFormat", + "stdlib/type/classify": { + "id": "Stdlib.Type.Classify", + "name": "Classify", "docstrings": [], "items": [ { - "id": "Core.Intl.RelativeTimeFormat.t", + "id": "Stdlib.Type.Classify.function", "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t" + "name": "function", + "docstrings": [ + "An abstract type representing a JavaScript function.\n\n See [`function`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function) on MDN." + ], + "signature": "type function" }, { - "id": "Core.Intl.RelativeTimeFormat.numeric", + "id": "Stdlib.Type.Classify.object", "kind": "type", - "name": "numeric", - "docstrings": [], - "signature": "type numeric = [#always | #auto]" - }, - { - "id": "Core.Intl.RelativeTimeFormat.style", + "name": "object", + "docstrings": [ + "An abstract type representing a JavaScript object.\n\n See [`object`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object) on MDN." + ], + "signature": "type object" + }, + { + "id": "Stdlib.Type.Classify.t", + "kind": "type", + "name": "t", + "docstrings": [ + "The type representing a classified JavaScript value." + ], + "signature": "type t =\n | Bool(bool)\n | Null\n | Undefined\n | String(string)\n | Number(float)\n | Object(object)\n | Function(function)\n | Symbol(Symbol.t)\n | BigInt(bigint)" + }, + { + "id": "Stdlib.Type.Classify.classify", + "kind": "value", + "name": "classify", + "docstrings": [ + "`classify(anyValue)`\nClassifies a JavaScript value.\n\n## Examples\n```rescript\nswitch %raw(`null`)->Type.Classify.classify {\n| Null => Console.log(\"Yup, that's null.\")\n| _ => Console.log(\"This doesn't actually appear to be null...\")\n}\n```" + ], + "signature": "let classify: 'a => t" + } + ] + }, + "stdlib/regexp/result": { + "id": "Stdlib.RegExp.Result", + "name": "Result", + "docstrings": [], + "items": [ + { + "id": "Stdlib.RegExp.Result.t", + "kind": "type", + "name": "t", + "docstrings": [ + "Type representing the result of a `RegExp` execution." + ], + "signature": "type t = array>" + }, + { + "id": "Stdlib.RegExp.Result.fullMatch", + "kind": "value", + "name": "fullMatch", + "docstrings": [ + "`fullMatch(regExpResult)` returns the full string that matched in this result.\n\n ## Examples\n ```rescript\n // Match the first two words separated by a space\n let regexp = RegExp.fromString(\"(\\\\w+) (\\\\w+)\")\n\n switch regexp->RegExp.exec(\"ReScript is pretty cool, right?\") {\n | None => Console.log(\"Nope, no match...\")\n | Some(result) => Console.log(result->RegExp.Result.fullMatch) // Prints the full string that matched, \"ReScript is\"\n }\n ```" + ], + "signature": "let fullMatch: t => string" + }, + { + "id": "Stdlib.RegExp.Result.matches", + "kind": "value", + "name": "matches", + "docstrings": [ + "`matches(regExpResult)` returns all matches for `regExpResult`.\n\n ## Examples\n ```rescript\n // Match the first two words separated by a space\n let regexp = RegExp.fromString(\"(\\\\w+) (\\\\w+)\")\n\n // This below will log \"ReScript\" and \"is\" to the console.\n switch regexp->RegExp.exec(\"ReScript is pretty cool, right?\") {\n | None => Console.log(\"Nope, no match...\")\n | Some(result) => switch result->RegExp.Result.matches->Array.keepSome {\n | [firstWord, secondWord] => Console.log2(firstWord, secondWord)\n | _ => Console.log(\"Didn't find exactly two words...\")\n }\n }\n ```" + ], + "signature": "let matches: t => array>" + }, + { + "id": "Stdlib.RegExp.Result.index", + "kind": "value", + "name": "index", + "docstrings": [], + "signature": "let index: t => int" + }, + { + "id": "Stdlib.RegExp.Result.input", + "kind": "value", + "name": "input", + "docstrings": [ + "`input(regExpResult)` returns the full input string that was passed to what produced the `RegExp.Result.t`.\n\n ## Examples\n ```rescript\n // Match the first two words separated by a space\n let regexp = RegExp.fromString(\"(\\\\w+) (\\\\w+)\")\n\n // This below will log the full input string \"ReScript is pretty cool, right?\" to the console.\n switch regexp->RegExp.exec(\"ReScript is pretty cool, right?\") {\n | None => Console.log(\"Nope, no match...\")\n | Some(result) => Console.log(result->RegExp.Result.input)\n }\n ```" + ], + "signature": "let input: t => string" + } + ] + }, + "stdlib/math/int": { + "id": "Stdlib.Math.Int", + "name": "Int", + "docstrings": [ + "Provide Math utilities for `int`" + ], + "items": [ + { + "id": "Stdlib.Math.Int.abs", + "kind": "value", + "name": "abs", + "docstrings": [ + "`abs(v)` returns absolute value of `v`.\n See [`Math.abs`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/abs) on MDN.\n\n ## Examples\n\n ```rescript\n assertEqual(Math.Int.abs(-2), 2)\n assertEqual(Math.Int.abs(3), 3)\n ```" + ], + "signature": "let abs: int => int" + }, + { + "id": "Stdlib.Math.Int.clz32", + "kind": "value", + "name": "clz32", + "docstrings": [ + "`clz32(v)` returns the number of leading zero bits of the argument's 32 bit\n int representation.\n See [`Math.clz32`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/clz32) on MDN.\n\n ## Examples\n\n ```rescript\n // 00000000000000000000000000000001\n assertEqual(Math.Int.clz32(1), 31)\n // 00000000000000000000000000000100\n assertEqual(Math.Int.clz32(4), 29)\n ```" + ], + "signature": "let clz32: int => int" + }, + { + "id": "Stdlib.Math.Int.imul", + "kind": "value", + "name": "imul", + "docstrings": [ + "`imul(a, b)` returns 32-bit integer multiplication. Use this only when you\n need to optimize performance of multiplication of numbers stored as 32-bit\n integers.\n See [`Math.imul`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/imul) on MDN.\n\n ## Examples\n\n ```rescript\n assertEqual(Math.Int.imul(3, 4), 12)\n assertEqual(Math.Int.imul(-5, 12), -60)\n ```" + ], + "signature": "let imul: (int, int) => int" + }, + { + "id": "Stdlib.Math.Int.min", + "kind": "value", + "name": "min", + "docstrings": [ + "`min(a, b)` returns the minimum of its two integer arguments.\n See [`Math.min`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/min) on MDN.\n\n ## Examples\n\n ```rescript\n assertEqual(Math.Int.min(1, 2), 1)\n assertEqual(Math.Int.min(-1, -2), -2)\n ```" + ], + "signature": "let min: (int, int) => int" + }, + { + "id": "Stdlib.Math.Int.minMany", + "kind": "value", + "name": "minMany", + "docstrings": [ + "`minMany(arr)` returns the minimum of the integers in the given array `arr`.\n Returns `Infinity` if `arr` is empty.\n See [`Math.min`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/min) on MDN.\n\n ## Examples\n\n ```rescript\n assertEqual(Math.Int.minMany([1, 2]), 1)\n assertEqual(Math.Int.minMany([-1, -2]), -2)\n assertEqual(Math.Int.minMany([])->Int.toFloat->Float.isFinite, false)\n ```" + ], + "signature": "let minMany: array => int" + }, + { + "id": "Stdlib.Math.Int.max", + "kind": "value", + "name": "max", + "docstrings": [ + "`max(a, b)` returns the maximum of its two integer arguments.\n See [`Math.max`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/max) on MDN.\n\n ## Examples\n\n ```rescript\n assertEqual(Math.Int.max(1, 2), 2)\n assertEqual(Math.Int.max(-1, -2), -1)\n ```" + ], + "signature": "let max: (int, int) => int" + }, + { + "id": "Stdlib.Math.Int.maxMany", + "kind": "value", + "name": "maxMany", + "docstrings": [ + "`maxMany(arr)` returns the maximum of the integers in the given array `arr`.\n Returns `Infinity` if `arr` is empty.\n See [`Math.max`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/max) on MDN.\n\n ## Examples\n\n ```rescript\n assertEqual(Math.Int.maxMany([1, 2]), 2)\n assertEqual(Math.Int.maxMany([-1, -2]), -1)\n assertEqual(Math.Int.maxMany([])->Int.toFloat->Float.isFinite, false)\n ```" + ], + "signature": "let maxMany: array => int" + }, + { + "id": "Stdlib.Math.Int.pow", + "kind": "value", + "name": "pow", + "docstrings": [ + "`pow(a, ~exp)` raises the given base `a` to the given exponent `exp`.\n See [`Math.pow`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/pow) on MDN.\n\n ## Examples\n\n ```rescript\n assertEqual(Math.Int.pow(2, ~exp=4), 16)\n assertEqual(Math.Int.pow(3, ~exp=4), 81)\n ```" + ], + "signature": "let pow: (int, ~exp: int) => int" + }, + { + "id": "Stdlib.Math.Int.sign", + "kind": "value", + "name": "sign", + "docstrings": [ + "`sign(v)` returns the sign of its integer argument: `-1` if negative, `0` if\n zero, `1` if positive.\n See [`Math.sign`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sign) on MDN.\n\n ## Examples\n\n ```rescript\n assertEqual(Math.Int.sign(3), 1)\n assertEqual(Math.Int.sign(-3), -1)\n assertEqual(Math.Int.sign(0), 0)\n ```" + ], + "signature": "let sign: int => int" + }, + { + "id": "Stdlib.Math.Int.floor", + "kind": "value", + "name": "floor", + "docstrings": [ + "floor(v) returns the largest `int` less than or equal to the argument; \n See [`Math.floor`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/floor)\n on MDN.\n\n ## Examples\n\n ```rescript\n assertEqual(Math.Int.floor(3.7), 3)\n assertEqual(Math.Int.floor(3.0), 3)\n assertEqual(Math.Int.floor(-3.1), -4)\n ```" + ], + "signature": "let floor: float => int" + }, + { + "id": "Stdlib.Math.Int.ceil", + "kind": "value", + "name": "ceil", + "docstrings": [ + "ceil(v) returns the smallest `int` greater than or equal to the argument;\n See [`Math.floor`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/floor)\n on MDN.\n\n ## Examples\n\n ```rescript\n assertEqual(Math.Int.ceil(3.7), 4)\n assertEqual(Math.Int.ceil(3.0), 3)\n assertEqual(Math.Int.ceil(-3.1), -3)\n ```" + ], + "signature": "let ceil: float => int" + }, + { + "id": "Stdlib.Math.Int.random", + "kind": "value", + "name": "random", + "docstrings": [ + "`random(minVal, maxVal)` returns a random integer number in the half-closed interval [minVal, maxVal).\n See [`Math.random`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random)\n on MDN.\n\n ## Examples\n\n ```rescript\n Math.Int.random(2, 5)\n Math.Int.random(505, 2000)\n Math.Int.random(-7, -2)\n ```" + ], + "signature": "let random: (int, int) => int" + } + ] + }, + "stdlib/math/constants": { + "id": "Stdlib.Math.Constants", + "name": "Constants", + "docstrings": [ + "Mathematical Constants" + ], + "items": [ + { + "id": "Stdlib.Math.Constants.e", + "kind": "value", + "name": "e", + "docstrings": [ + "`Math.Constants.e` returns Euler's number, ≈ 2.718281828459045.\n See [`Math.E`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/E) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Constants.e\n ```" + ], + "signature": "let e: float" + }, + { + "id": "Stdlib.Math.Constants.ln2", + "kind": "value", + "name": "ln2", + "docstrings": [ + "`Math.Constants.ln2` returns Natural logarithm of 2, ≈ 0.6931471805599453.\n See [`Math.LN2`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/LN2) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Constants.ln2\n ```" + ], + "signature": "let ln2: float" + }, + { + "id": "Stdlib.Math.Constants.ln10", + "kind": "value", + "name": "ln10", + "docstrings": [ + "`Math.Constants.ln10` returns Natural logarithm of 10, ≈ 2.302585092994046.\n See [`Math.LN10`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/LN10) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Constants.ln10\n ```" + ], + "signature": "let ln10: float" + }, + { + "id": "Stdlib.Math.Constants.log2e", + "kind": "value", + "name": "log2e", + "docstrings": [ + "`Math.Constants.log2e` returns Base 2 logarithm of E, ≈ 1.4426950408889634.\n See [`Math.LOG2E`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/LOG2E) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Constants.log2e\n ```" + ], + "signature": "let log2e: float" + }, + { + "id": "Stdlib.Math.Constants.log10e", + "kind": "value", + "name": "log10e", + "docstrings": [ + "`Math.Constants.log10e` returns Base 10 logarithm of E, ≈ 0.4342944819032518.\n See [`Math.LOG10E`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/LOG10E) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Constants.log10e\n ```" + ], + "signature": "let log10e: float" + }, + { + "id": "Stdlib.Math.Constants.pi", + "kind": "value", + "name": "pi", + "docstrings": [ + "`Math.Constants.pi` returns Pi - ratio of the circumference to the diameter\n of a circle, ≈ 3.141592653589793.\n See [`Math.PI`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/PI) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Constants.pi\n ```" + ], + "signature": "let pi: float" + }, + { + "id": "Stdlib.Math.Constants.sqrt1_2", + "kind": "value", + "name": "sqrt1_2", + "docstrings": [ + "`Math.Constants.sqrt1_2` returns Square root of 1/2, ≈ 0.7071067811865476.\n See [`Math.SQRT1_2`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/SQRT1_2) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Constants.sqrt1_2\n ```" + ], + "signature": "let sqrt1_2: float" + }, + { + "id": "Stdlib.Math.Constants.sqrt2", + "kind": "value", + "name": "sqrt2", + "docstrings": [ + "`Math.Constants.e` returns Absolute value for integer argument.\n See [`Math.abs`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/abs) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Constants.sqrt2\n ```" + ], + "signature": "let sqrt2: float" + } + ] + }, + "stdlib/json/decode": { + "id": "Stdlib.JSON.Decode", + "name": "Decode", + "docstrings": [], + "items": [ + { + "id": "Stdlib.JSON.Decode.bool", + "kind": "value", + "name": "bool", + "docstrings": [ + "Decodes a single JSON value. If the value is a bool, it will return `Some(bool)` - otherwise it will return `None`.\n\n ## Examples\n ```rescript\n JSON.parseOrThrow(`true`)->JSON.Decode.bool\n // Some(true)\n\n JSON.parseOrThrow(`\"hello world\"`)->JSON.Decode.bool\n // None\n ```" + ], + "signature": "let bool: t => option" + }, + { + "id": "Stdlib.JSON.Decode.null", + "kind": "value", + "name": "null", + "docstrings": [ + "Decodes a single JSON value. If the value is null, it will return `Some(Null.t)` - otherwise it will return `None`.\n\n ## Examples\n ```rescript\n JSON.parseOrThrow(`null`)->JSON.Decode.null\n // Some(null)\n\n JSON.parseOrThrow(`\"hello world\"`)->JSON.Decode.null\n // None\n ```" + ], + "signature": "let null: t => option>" + }, + { + "id": "Stdlib.JSON.Decode.string", + "kind": "value", + "name": "string", + "docstrings": [ + "Decodes a single JSON value. If the value is a string, it will return `Some(string)` - otherwise it will return `None`.\n\n ## Examples\n ```rescript\n JSON.parseOrThrow(`\"hello world\"`)->JSON.Decode.string\n // Some(\"hello world\")\n\n JSON.parseOrThrow(`42`)->JSON.Decode.string\n // None \n ```" + ], + "signature": "let string: t => option" + }, + { + "id": "Stdlib.JSON.Decode.float", + "kind": "value", + "name": "float", + "docstrings": [ + "Decodes a single JSON value. If the value is a float, it will return `Some(float)` - otherwise it will return `None`.\n\n ## Examples\n ```rescript\n JSON.parseOrThrow(`42.0`)->JSON.Decode.float\n // Some(42.0)\n\n JSON.parseOrThrow(`\"hello world\"`)->JSON.Decode.float\n // None\n ```" + ], + "signature": "let float: t => option" + }, + { + "id": "Stdlib.JSON.Decode.object", + "kind": "value", + "name": "object", + "docstrings": [ + "Decodes a single JSON value. If the value is an object, it will return `Some(dict)` - otherwise it will return `None`.\n\n ## Examples\n ```rescript\n JSON.parseOrThrow(`{\"foo\":\"bar\"}`)->JSON.Decode.object\n // Some({ foo: 'bar' })\n\n JSON.parseOrThrow(`\"hello world\"`)->JSON.Decode.object\n // None\n ```" + ], + "signature": "let object: t => option>" + }, + { + "id": "Stdlib.JSON.Decode.array", + "kind": "value", + "name": "array", + "docstrings": [ + "Decodes a single JSON value. If the value is an array, it will return `Some(array)` - otherwise it will return `None`.\n\n ## Examples\n ```rescript\n JSON.parseOrThrow(`[\"foo\", \"bar\"]`)->JSON.Decode.array\n // Some([ 'foo', 'bar' ])\n\n JSON.parseOrThrow(`\"hello world\"`)->JSON.Decode.array\n // None\n ```" + ], + "signature": "let array: t => option>" + } + ] + }, + "stdlib/json/encode": { + "id": "Stdlib.JSON.Encode", + "name": "Encode", + "docstrings": [], + "items": [ + { + "id": "Stdlib.JSON.Encode.bool", + "kind": "value", + "name": "bool", + "docstrings": [ + "Returns a boolean as a JSON object.\n\n ## Examples\n ```rescript\n JSON.Encode.bool(true)\n ```" + ], + "signature": "let bool: bool => t" + }, + { + "id": "Stdlib.JSON.Encode.null", + "kind": "value", + "name": "null", + "docstrings": [ + "Returns null as a JSON object.\n\n ## Examples\n ```rescript\n JSON.Encode.null\n ```" + ], + "signature": "let null: t" + }, + { + "id": "Stdlib.JSON.Encode.string", + "kind": "value", + "name": "string", + "docstrings": [ + "Returns a string as a JSON object.\n\n ## Examples\n ```rescript\n JSON.Encode.string(\"hello world\")\n ```" + ], + "signature": "let string: string => t" + }, + { + "id": "Stdlib.JSON.Encode.int", + "kind": "value", + "name": "int", + "docstrings": [ + "Returns an int as a JSON object.\n\n ## Examples\n ```rescript\n JSON.Encode.int(42)\n ```" + ], + "signature": "let int: int => t" + }, + { + "id": "Stdlib.JSON.Encode.float", + "kind": "value", + "name": "float", + "docstrings": [ + "Returns a float as a JSON object.\n\n ## Examples\n ```rescript\n JSON.Encode.float(42.0)\n ```" + ], + "signature": "let float: float => t" + }, + { + "id": "Stdlib.JSON.Encode.object", + "kind": "value", + "name": "object", + "docstrings": [ + "Returns a dict as a JSON object.\n\n ## Examples\n ```rescript\n let dict = Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n ])\n\n JSON.Encode.object(dict)\n ```" + ], + "signature": "let object: dict => t" + }, + { + "id": "Stdlib.JSON.Encode.array", + "kind": "value", + "name": "array", + "docstrings": [ + "Returns an array as a JSON object.\n\n ## Examples\n ```rescript\n let array = [JSON.Encode.string(\"hello world\"), JSON.Encode.int(42)]\n\n JSON.Encode.array(array)\n ```" + ], + "signature": "let array: array => t" + } + ] + }, + "stdlib/json/classify": { + "id": "Stdlib.JSON.Classify", + "name": "Classify", + "docstrings": [], + "items": [ + { + "id": "Stdlib.JSON.Classify.t", + "kind": "type", + "name": "t", + "docstrings": [ + "A type representing a JavaScript type." + ], + "signature": "type t =\n | Bool(bool)\n | Null\n | String(string)\n | Number(float)\n | Object(dict)\n | Array(array)" + }, + { + "id": "Stdlib.JSON.Classify.classify", + "kind": "value", + "name": "classify", + "docstrings": [ + "Returns the JSON type of any value.\n\n ## Examples\n ```rescript\n JSON.Classify.classify(\"hello world\")\n // String(\"hello world\")\n\n JSON.Classify.classify(42)\n // Number(42)\n ```" + ], + "signature": "let classify: 'a => t", + "deprecated": "Directly switch on the JSON object instead" + } + ] + }, + "stdlib/jserror/urierror": { + "id": "Stdlib.JsError.URIError", + "name": "URIError", + "docstrings": [], + "items": [ + { + "id": "Stdlib.JsError.URIError.make", + "kind": "value", + "name": "make", + "docstrings": [ + "Creates a new `URIError` with the provided `message`.\n\n See [`URIError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/URIError) on MDN." + ], + "signature": "let make: string => t" + }, + { + "id": "Stdlib.JsError.URIError.throwWithMessage", + "kind": "value", + "name": "throwWithMessage", + "docstrings": [ + "Creates a new `URIError` with the provided `message` and throws it.\n\n `JsError.URIError.throwWithMessage(\"message\")` is equivalent to `JsError.URIError.make(\"message\")->JsError.throw`.\n\n See [`URIError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/URIError) on MDN." + ], + "signature": "let throwWithMessage: string => 'a" + } + ] + }, + "stdlib/jserror/typeerror": { + "id": "Stdlib.JsError.TypeError", + "name": "TypeError", + "docstrings": [], + "items": [ + { + "id": "Stdlib.JsError.TypeError.make", + "kind": "value", + "name": "make", + "docstrings": [ + "Creates a new `TypeError` with the provided `message`.\n\n See [`TypeError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError) on MDN." + ], + "signature": "let make: string => t" + }, + { + "id": "Stdlib.JsError.TypeError.throwWithMessage", + "kind": "value", + "name": "throwWithMessage", + "docstrings": [ + "Creates a new `TypeError` with the provided `message` and throws it.\n\n `JsError.TypeError.throwWithMessage(\"message\")` is equivalent to `JsError.TypeError.make(\"message\")->JsError.throw`.\n\n See [`TypeError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError) on MDN." + ], + "signature": "let throwWithMessage: string => 'a" + } + ] + }, + "stdlib/jserror/syntaxerror": { + "id": "Stdlib.JsError.SyntaxError", + "name": "SyntaxError", + "docstrings": [], + "items": [ + { + "id": "Stdlib.JsError.SyntaxError.make", + "kind": "value", + "name": "make", + "docstrings": [ + "Creates a new `SyntaxError` with the provided `message`.\n\n See [`SyntaxError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SyntaxError) on MDN." + ], + "signature": "let make: string => t" + }, + { + "id": "Stdlib.JsError.SyntaxError.throwWithMessage", + "kind": "value", + "name": "throwWithMessage", + "docstrings": [ + "Creates a new `SyntaxError` with the provided `message` and throws it.\n \n `JsError.SyntaxError.throwWithMessage(\"message\")` is equivalent to `JsError.SyntaxError.make(\"message\")->JsError.throw`.\n \n See [`SyntaxError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SyntaxError) on MDN." + ], + "signature": "let throwWithMessage: string => 'a" + } + ] + }, + "stdlib/jserror/referenceerror": { + "id": "Stdlib.JsError.ReferenceError", + "name": "ReferenceError", + "docstrings": [], + "items": [ + { + "id": "Stdlib.JsError.ReferenceError.make", + "kind": "value", + "name": "make", + "docstrings": [ + "Creates a new `ReferenceError` with the provided `message`.\n\n See [`ReferenceError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ReferenceError) on MDN." + ], + "signature": "let make: string => t" + }, + { + "id": "Stdlib.JsError.ReferenceError.throwWithMessage", + "kind": "value", + "name": "throwWithMessage", + "docstrings": [ + "Creates a new `ReferenceError` with the provided `message` and throws it.\n\n `JsError.ReferenceError.throwWithMessage(\"message\")` is equivalent to `JsError.ReferenceError.make(\"message\")->JsError.throw`.\n\n See [`ReferenceError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ReferenceError) on MDN." + ], + "signature": "let throwWithMessage: string => 'a" + } + ] + }, + "stdlib/jserror/rangeerror": { + "id": "Stdlib.JsError.RangeError", + "name": "RangeError", + "docstrings": [], + "items": [ + { + "id": "Stdlib.JsError.RangeError.make", + "kind": "value", + "name": "make", + "docstrings": [ + "Creates a new `RangeError` with the provided `message`.\n\n See [`RangeError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RangeError) on MDN." + ], + "signature": "let make: string => t" + }, + { + "id": "Stdlib.JsError.RangeError.throwWithMessage", + "kind": "value", + "name": "throwWithMessage", + "docstrings": [ + "Creates a new `RangeError` with the provided `message` and throws it.\n \n `JsError.RangeError.throwWithMessage(\"message\")` is equivalent to `JsError.RangeError.make(\"message\")->JsError.throw`.\n\n See [`RangeError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RangeError) on MDN." + ], + "signature": "let throwWithMessage: string => 'a" + } + ] + }, + "stdlib/jserror/evalerror": { + "id": "Stdlib.JsError.EvalError", + "name": "EvalError", + "docstrings": [], + "items": [ + { + "id": "Stdlib.JsError.EvalError.make", + "kind": "value", + "name": "make", + "docstrings": [ + "Creates a new `EvalError` with the provided `message`.\n\n See [`EvalError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/EvalError) on MDN." + ], + "signature": "let make: string => t" + }, + { + "id": "Stdlib.JsError.EvalError.throwWithMessage", + "kind": "value", + "name": "throwWithMessage", + "docstrings": [ + "Creates a new `EvalError` with the provided `message` and throws it.\n\n `JsError.EvalError.throwWithMessage(\"message\")` is equivalent to `JsError.EvalError.make(\"message\")->JsError.throw`.\n\n See [`EvalError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/EvalError) on MDN." + ], + "signature": "let throwWithMessage: string => 'a" + } + ] + }, + "stdlib/intl/segments": { + "id": "Stdlib.Intl.Segments", + "name": "Segments", + "docstrings": [ + "A Segments instance is an object that represents the segments of a specific string, subject to the locale and options of its constructing Intl.Segmenter instance.\nhttps://tc39.es/ecma402/#sec-segments-objects" + ], + "items": [ + { + "id": "Stdlib.Intl.Segments.t", + "kind": "type", + "name": "t", + "docstrings": [], + "signature": "type t" + }, + { + "id": "Stdlib.Intl.Segments.segmentData", + "kind": "type", + "name": "segmentData", + "docstrings": [], + "signature": "type segmentData = {\n segment: string,\n index: int,\n isWordLike: option,\n input: string,\n}" + }, + { + "id": "Stdlib.Intl.Segments.containing", + "kind": "value", + "name": "containing", + "docstrings": [], + "signature": "let containing: t => segmentData" + }, + { + "id": "Stdlib.Intl.Segments.containingWithIndex", + "kind": "value", + "name": "containingWithIndex", + "docstrings": [], + "signature": "let containingWithIndex: (t, int) => segmentData" + }, + { + "id": "Stdlib.Intl.Segments.ignore", + "kind": "value", + "name": "ignore", + "docstrings": [ + "`ignore(segments)` ignores the provided segments and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." + ], + "signature": "let ignore: t => unit" + } + ] + }, + "stdlib/intl/segmenter": { + "id": "Stdlib.Intl.Segmenter", + "name": "Segmenter", + "docstrings": [], + "items": [ + { + "id": "Stdlib.Intl.Segmenter.t", + "kind": "type", + "name": "t", + "docstrings": [], + "signature": "type t" + }, + { + "id": "Stdlib.Intl.Segmenter.granularity", + "kind": "type", + "name": "granularity", + "docstrings": [], + "signature": "type granularity = [#grapheme | #sentence | #word]" + }, + { + "id": "Stdlib.Intl.Segmenter.options", + "kind": "type", + "name": "options", + "docstrings": [], + "signature": "type options = {\n localeMatcher?: Intl_Common.localeMatcher,\n granularity?: granularity,\n}" + }, + { + "id": "Stdlib.Intl.Segmenter.pluralCategories", + "kind": "type", + "name": "pluralCategories", + "docstrings": [], + "signature": "type pluralCategories = [\n | #few\n | #many\n | #one\n | #other\n | #two\n | #zero\n]" + }, + { + "id": "Stdlib.Intl.Segmenter.resolvedOptions", + "kind": "type", + "name": "resolvedOptions", + "docstrings": [], + "signature": "type resolvedOptions = {\n locale: string,\n granularity: granularity,\n}" + }, + { + "id": "Stdlib.Intl.Segmenter.supportedLocalesOptions", + "kind": "type", + "name": "supportedLocalesOptions", + "docstrings": [], + "signature": "type supportedLocalesOptions = {\n localeMatcher: Intl_Common.localeMatcher,\n}" + }, + { + "id": "Stdlib.Intl.Segmenter.make", + "kind": "value", + "name": "make", + "docstrings": [], + "signature": "let make: (~locales: array=?, ~options: options=?) => t" + }, + { + "id": "Stdlib.Intl.Segmenter.supportedLocalesOf", + "kind": "value", + "name": "supportedLocalesOf", + "docstrings": [], + "signature": "let supportedLocalesOf: (array, ~options: supportedLocalesOptions=?) => t" + }, + { + "id": "Stdlib.Intl.Segmenter.resolvedOptions", + "kind": "value", + "name": "resolvedOptions", + "docstrings": [], + "signature": "let resolvedOptions: t => resolvedOptions" + }, + { + "id": "Stdlib.Intl.Segmenter.segment", + "kind": "value", + "name": "segment", + "docstrings": [], + "signature": "let segment: (t, string) => Intl_Segments.t" + }, + { + "id": "Stdlib.Intl.Segmenter.ignore", + "kind": "value", + "name": "ignore", + "docstrings": [ + "`ignore(segmenter)` ignores the provided segmenter and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." + ], + "signature": "let ignore: t => unit" + } + ] + }, + "stdlib/intl/relativetimeformat": { + "id": "Stdlib.Intl.RelativeTimeFormat", + "name": "RelativeTimeFormat", + "docstrings": [], + "items": [ + { + "id": "Stdlib.Intl.RelativeTimeFormat.t", + "kind": "type", + "name": "t", + "docstrings": [], + "signature": "type t" + }, + { + "id": "Stdlib.Intl.RelativeTimeFormat.numeric", + "kind": "type", + "name": "numeric", + "docstrings": [], + "signature": "type numeric = [#always | #auto]" + }, + { + "id": "Stdlib.Intl.RelativeTimeFormat.style", "kind": "type", "name": "style", "docstrings": [], "signature": "type style = [#long | #narrow | #short]" }, { - "id": "Core.Intl.RelativeTimeFormat.timeUnit", + "id": "Stdlib.Intl.RelativeTimeFormat.timeUnit", "kind": "type", "name": "timeUnit", "docstrings": [], "signature": "type timeUnit = [\n | #day\n | #hour\n | #minute\n | #month\n | #quarter\n | #second\n | #week\n | #year\n]" }, { - "id": "Core.Intl.RelativeTimeFormat.options", + "id": "Stdlib.Intl.RelativeTimeFormat.options", "kind": "type", "name": "options", "docstrings": [], - "signature": "type options = {\n localeMatcher?: Core__Intl__Common.localeMatcher,\n numeric?: numeric,\n style?: style,\n}" + "signature": "type options = {\n localeMatcher?: Intl_Common.localeMatcher,\n numeric?: numeric,\n style?: style,\n}" }, { - "id": "Core.Intl.RelativeTimeFormat.supportedLocalesOptions", + "id": "Stdlib.Intl.RelativeTimeFormat.supportedLocalesOptions", "kind": "type", "name": "supportedLocalesOptions", "docstrings": [], - "signature": "type supportedLocalesOptions = {\n localeMatcher: Core__Intl__Common.localeMatcher,\n}" + "signature": "type supportedLocalesOptions = {\n localeMatcher: Intl_Common.localeMatcher,\n}" }, { - "id": "Core.Intl.RelativeTimeFormat.resolvedOptions", + "id": "Stdlib.Intl.RelativeTimeFormat.resolvedOptions", "kind": "type", "name": "resolvedOptions", "docstrings": [], "signature": "type resolvedOptions = {\n locale: string,\n numeric: numeric,\n style: style,\n numberingSystem: string,\n}" }, { - "id": "Core.Intl.RelativeTimeFormat.relativeTimePartComponent", + "id": "Stdlib.Intl.RelativeTimeFormat.relativeTimePartComponent", "kind": "type", "name": "relativeTimePartComponent", "docstrings": [], "signature": "type relativeTimePartComponent = [#integer | #literal]" }, { - "id": "Core.Intl.RelativeTimeFormat.relativeTimePart", + "id": "Stdlib.Intl.RelativeTimeFormat.relativeTimePart", "kind": "type", "name": "relativeTimePart", "docstrings": [], "signature": "type relativeTimePart = {\n \\\"type\": relativeTimePartComponent,\n value: string,\n unit?: timeUnit,\n}" }, { - "id": "Core.Intl.RelativeTimeFormat.make", + "id": "Stdlib.Intl.RelativeTimeFormat.make", "kind": "value", "name": "make", "docstrings": [], "signature": "let make: (~locales: array=?, ~options: options=?) => t" }, { - "id": "Core.Intl.RelativeTimeFormat.supportedLocalesOf", + "id": "Stdlib.Intl.RelativeTimeFormat.supportedLocalesOf", "kind": "value", "name": "supportedLocalesOf", "docstrings": [], "signature": "let supportedLocalesOf: (array, ~options: supportedLocalesOptions=?) => t" }, { - "id": "Core.Intl.RelativeTimeFormat.resolvedOptions", + "id": "Stdlib.Intl.RelativeTimeFormat.resolvedOptions", "kind": "value", "name": "resolvedOptions", "docstrings": [], "signature": "let resolvedOptions: t => resolvedOptions" }, { - "id": "Core.Intl.RelativeTimeFormat.format", + "id": "Stdlib.Intl.RelativeTimeFormat.format", "kind": "value", "name": "format", "docstrings": [], "signature": "let format: (t, int, timeUnit) => string" }, { - "id": "Core.Intl.RelativeTimeFormat.formatToParts", + "id": "Stdlib.Intl.RelativeTimeFormat.formatToParts", "kind": "value", "name": "formatToParts", "docstrings": [], "signature": "let formatToParts: (t, int, timeUnit) => array" + }, + { + "id": "Stdlib.Intl.RelativeTimeFormat.ignore", + "kind": "value", + "name": "ignore", + "docstrings": [ + "`ignore(relativeTimeFormat)` ignores the provided relativeTimeFormat and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." + ], + "signature": "let ignore: t => unit" } ] }, - "core/intl/pluralrules": { - "id": "Core.Intl.PluralRules", + "stdlib/intl/pluralrules": { + "id": "Stdlib.Intl.PluralRules", "name": "PluralRules", "docstrings": [], "items": [ { - "id": "Core.Intl.PluralRules.t", + "id": "Stdlib.Intl.PluralRules.t", "kind": "type", "name": "t", "docstrings": [], "signature": "type t" }, { - "id": "Core.Intl.PluralRules.localeType", + "id": "Stdlib.Intl.PluralRules.localeType", "kind": "type", "name": "localeType", "docstrings": [], "signature": "type localeType = [#cardinal | #ordinal]" }, { - "id": "Core.Intl.PluralRules.options", + "id": "Stdlib.Intl.PluralRules.options", "kind": "type", "name": "options", "docstrings": [], - "signature": "type options = {\n localeMatcher?: Core__Intl__Common.localeMatcher,\n \\\"type\"?: localeType,\n minimumIntegerDigits?: Core__Intl__Common.oneTo21,\n minimumFractionDigits?: Core__Intl__Common.zeroTo20,\n maximumFractionDigits?: Core__Intl__Common.zeroTo20,\n minimumSignificantDigits?: Core__Intl__Common.oneTo21,\n maximumSignificantDigits?: Core__Intl__Common.oneTo21,\n}" + "signature": "type options = {\n localeMatcher?: Intl_Common.localeMatcher,\n \\\"type\"?: localeType,\n minimumIntegerDigits?: Intl_Common.oneTo21,\n minimumFractionDigits?: Intl_Common.zeroTo20,\n maximumFractionDigits?: Intl_Common.zeroTo20,\n minimumSignificantDigits?: Intl_Common.oneTo21,\n maximumSignificantDigits?: Intl_Common.oneTo21,\n}" }, { - "id": "Core.Intl.PluralRules.pluralCategories", + "id": "Stdlib.Intl.PluralRules.pluralCategories", "kind": "type", "name": "pluralCategories", "docstrings": [], "signature": "type pluralCategories = [\n | #few\n | #many\n | #one\n | #other\n | #two\n | #zero\n]" }, { - "id": "Core.Intl.PluralRules.resolvedOptions", + "id": "Stdlib.Intl.PluralRules.resolvedOptions", "kind": "type", "name": "resolvedOptions", "docstrings": [], - "signature": "type resolvedOptions = {\n locale: string,\n pluralCategories: array,\n \\\"type\": localeType,\n minimumIntegerDigits?: Core__Intl__Common.oneTo21,\n minimumFractionDigits?: Core__Intl__Common.zeroTo20,\n maximumFractionDigits?: Core__Intl__Common.zeroTo20,\n minimumSignificantDigits?: Core__Intl__Common.oneTo21,\n maximumSignificantDigits?: Core__Intl__Common.oneTo21,\n}" + "signature": "type resolvedOptions = {\n locale: string,\n pluralCategories: array,\n \\\"type\": localeType,\n minimumIntegerDigits?: Intl_Common.oneTo21,\n minimumFractionDigits?: Intl_Common.zeroTo20,\n maximumFractionDigits?: Intl_Common.zeroTo20,\n minimumSignificantDigits?: Intl_Common.oneTo21,\n maximumSignificantDigits?: Intl_Common.oneTo21,\n}" }, { - "id": "Core.Intl.PluralRules.supportedLocalesOptions", + "id": "Stdlib.Intl.PluralRules.supportedLocalesOptions", "kind": "type", "name": "supportedLocalesOptions", "docstrings": [], - "signature": "type supportedLocalesOptions = {\n localeMatcher: Core__Intl__Common.localeMatcher,\n}" + "signature": "type supportedLocalesOptions = {\n localeMatcher: Intl_Common.localeMatcher,\n}" }, { - "id": "Core.Intl.PluralRules.make", + "id": "Stdlib.Intl.PluralRules.make", "kind": "value", "name": "make", "docstrings": [], "signature": "let make: (~locales: array=?, ~options: options=?) => t" }, { - "id": "Core.Intl.PluralRules.supportedLocalesOf", + "id": "Stdlib.Intl.PluralRules.supportedLocalesOf", "kind": "value", "name": "supportedLocalesOf", "docstrings": [], "signature": "let supportedLocalesOf: (array, ~options: supportedLocalesOptions=?) => t" }, { - "id": "Core.Intl.PluralRules.resolvedOptions", + "id": "Stdlib.Intl.PluralRules.resolvedOptions", "kind": "value", "name": "resolvedOptions", "docstrings": [], "signature": "let resolvedOptions: t => resolvedOptions" }, { - "id": "Core.Intl.PluralRules.rule", + "id": "Stdlib.Intl.PluralRules.rule", "kind": "type", "name": "rule", "docstrings": [], "signature": "type rule = [#few | #many | #one | #other | #two | #zero]" }, { - "id": "Core.Intl.PluralRules.select", + "id": "Stdlib.Intl.PluralRules.select", "kind": "value", "name": "select", "docstrings": [], "signature": "let select: (t, float) => rule" }, { - "id": "Core.Intl.PluralRules.selectInt", + "id": "Stdlib.Intl.PluralRules.selectInt", "kind": "value", "name": "selectInt", "docstrings": [], "signature": "let selectInt: (t, int) => rule" }, { - "id": "Core.Intl.PluralRules.selectBigInt", + "id": "Stdlib.Intl.PluralRules.selectBigInt", "kind": "value", "name": "selectBigInt", "docstrings": [], "signature": "let selectBigInt: (t, bigint) => rule" }, { - "id": "Core.Intl.PluralRules.selectRange", + "id": "Stdlib.Intl.PluralRules.selectRange", "kind": "value", "name": "selectRange", "docstrings": [], "signature": "let selectRange: (t, ~start: float, ~end: float) => rule" }, { - "id": "Core.Intl.PluralRules.selectRangeInt", + "id": "Stdlib.Intl.PluralRules.selectRangeInt", "kind": "value", "name": "selectRangeInt", "docstrings": [], "signature": "let selectRangeInt: (t, ~start: int, ~end: int) => rule" }, { - "id": "Core.Intl.PluralRules.selectRangeBigInt", + "id": "Stdlib.Intl.PluralRules.selectRangeBigInt", "kind": "value", "name": "selectRangeBigInt", "docstrings": [], "signature": "let selectRangeBigInt: (t, ~start: bigint, ~end: bigint) => rule" + }, + { + "id": "Stdlib.Intl.PluralRules.ignore", + "kind": "value", + "name": "ignore", + "docstrings": [ + "`ignore(pluralRules)` ignores the provided pluralRules and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." + ], + "signature": "let ignore: t => unit" } ] }, - "core/intl/numberformat": { - "id": "Core.Intl.NumberFormat", + "stdlib/intl/numberformat": { + "id": "Stdlib.Intl.NumberFormat", "name": "NumberFormat", "docstrings": [], "items": [ { - "id": "Core.Intl.NumberFormat.t", + "id": "Stdlib.Intl.NumberFormat.t", "kind": "type", "name": "t", "docstrings": [], "signature": "type t" }, { - "id": "Core.Intl.NumberFormat.currency", + "id": "Stdlib.Intl.NumberFormat.currency", "kind": "type", "name": "currency", "docstrings": [ @@ -597,28 +1440,28 @@ "signature": "type currency = string" }, { - "id": "Core.Intl.NumberFormat.currencyDisplay", + "id": "Stdlib.Intl.NumberFormat.currencyDisplay", "kind": "type", "name": "currencyDisplay", "docstrings": [], "signature": "type currencyDisplay = [\n | #code\n | #name\n | #narrowSymbol\n | #symbol\n]" }, { - "id": "Core.Intl.NumberFormat.currencySign", + "id": "Stdlib.Intl.NumberFormat.currencySign", "kind": "type", "name": "currencySign", "docstrings": [], "signature": "type currencySign = [#accounting | #standard]" }, { - "id": "Core.Intl.NumberFormat.notation", + "id": "Stdlib.Intl.NumberFormat.notation", "kind": "type", "name": "notation", "docstrings": [], "signature": "type notation = [\n | #compact\n | #engineering\n | #scientific\n | #standard\n]" }, { - "id": "Core.Intl.NumberFormat.compactDisplay", + "id": "Stdlib.Intl.NumberFormat.compactDisplay", "kind": "type", "name": "compactDisplay", "docstrings": [ @@ -627,21 +1470,21 @@ "signature": "type compactDisplay = [#long | #short]" }, { - "id": "Core.Intl.NumberFormat.signDisplay", + "id": "Stdlib.Intl.NumberFormat.signDisplay", "kind": "type", "name": "signDisplay", "docstrings": [], "signature": "type signDisplay = [\n | #always\n | #auto\n | #exceptZero\n | #negative\n | #never\n]" }, { - "id": "Core.Intl.NumberFormat.style", + "id": "Stdlib.Intl.NumberFormat.style", "kind": "type", "name": "style", "docstrings": [], "signature": "type style = [#currency | #decimal | #percent | #unit]" }, { - "id": "Core.Intl.NumberFormat.unitSystem", + "id": "Stdlib.Intl.NumberFormat.unitSystem", "kind": "type", "name": "unitSystem", "docstrings": [ @@ -650,7 +1493,7 @@ "signature": "type unitSystem = string" }, { - "id": "Core.Intl.NumberFormat.unitDisplay", + "id": "Stdlib.Intl.NumberFormat.unitDisplay", "kind": "type", "name": "unitDisplay", "docstrings": [ @@ -659,504 +1502,531 @@ "signature": "type unitDisplay = [#long | #narrow | #short]" }, { - "id": "Core.Intl.NumberFormat.rounding", + "id": "Stdlib.Intl.NumberFormat.rounding", "kind": "type", "name": "rounding", "docstrings": [], "signature": "type rounding = [\n | #ceil\n | #expand\n | #floor\n | #halfCeil\n | #halfEven\n | #halfExpand\n | #halfFloor\n | #halfTrunc\n | #trunc\n]" }, { - "id": "Core.Intl.NumberFormat.roundingPriority", + "id": "Stdlib.Intl.NumberFormat.roundingPriority", "kind": "type", "name": "roundingPriority", "docstrings": [], "signature": "type roundingPriority = [\n | #auto\n | #lessPrecision\n | #morePrecision\n]" }, { - "id": "Core.Intl.NumberFormat.roundingIncrement", + "id": "Stdlib.Intl.NumberFormat.roundingIncrement", "kind": "type", "name": "roundingIncrement", "docstrings": [], "signature": "type roundingIncrement = [\n | #1\n | #10\n | #100\n | #1000\n | #2\n | #20\n | #200\n | #2000\n | #25\n | #250\n | #2500\n | #5\n | #50\n | #500\n | #5000\n]" }, { - "id": "Core.Intl.NumberFormat.trailingZeroDisplay", + "id": "Stdlib.Intl.NumberFormat.trailingZeroDisplay", "kind": "type", "name": "trailingZeroDisplay", "docstrings": [], "signature": "type trailingZeroDisplay = [\n | #auto\n | #lessPrecision\n | #stripIfInteger\n]" }, { - "id": "Core.Intl.NumberFormat.options", + "id": "Stdlib.Intl.NumberFormat.options", "kind": "type", "name": "options", "docstrings": [], - "signature": "type options = {\n compactDisplay?: compactDisplay,\n numberingSystem?: Core__Intl__Common.numberingSystem,\n currency?: currency,\n currencyDisplay?: currencyDisplay,\n currencySign?: currencySign,\n localeMatcher?: Core__Intl__Common.localeMatcher,\n notation?: notation,\n signDisplay?: signDisplay,\n style?: style,\n unit?: unitSystem,\n unitDisplay?: unitDisplay,\n useGrouping?: Grouping.t,\n roundingMode?: rounding,\n roundingPriority?: roundingPriority,\n roundingIncrement?: roundingIncrement,\n trailingZeroDisplay?: trailingZeroDisplay,\n minimumIntegerDigits?: Core__Intl__Common.oneTo21,\n minimumFractionDigits?: Core__Intl__Common.zeroTo20,\n maximumFractionDigits?: Core__Intl__Common.zeroTo20,\n minimumSignificantDigits?: Core__Intl__Common.oneTo21,\n maximumSignificantDigits?: Core__Intl__Common.oneTo21,\n}" + "signature": "type options = {\n compactDisplay?: compactDisplay,\n numberingSystem?: Intl_Common.numberingSystem,\n currency?: currency,\n currencyDisplay?: currencyDisplay,\n currencySign?: currencySign,\n localeMatcher?: Intl_Common.localeMatcher,\n notation?: notation,\n signDisplay?: signDisplay,\n style?: style,\n unit?: unitSystem,\n unitDisplay?: unitDisplay,\n useGrouping?: Grouping.t,\n roundingMode?: rounding,\n roundingPriority?: roundingPriority,\n roundingIncrement?: roundingIncrement,\n trailingZeroDisplay?: trailingZeroDisplay,\n minimumIntegerDigits?: Intl_Common.oneTo21,\n minimumFractionDigits?: Intl_Common.zeroTo20,\n maximumFractionDigits?: Intl_Common.zeroTo20,\n minimumSignificantDigits?: Intl_Common.oneTo21,\n maximumSignificantDigits?: Intl_Common.oneTo21,\n}" }, { - "id": "Core.Intl.NumberFormat.resolvedOptions", + "id": "Stdlib.Intl.NumberFormat.resolvedOptions", "kind": "type", "name": "resolvedOptions", "docstrings": [], - "signature": "type resolvedOptions = {\n currency?: currency,\n currencyDisplay?: currencyDisplay,\n currencySign?: currencySign,\n compactDisplay?: compactDisplay,\n unit: unitSystem,\n unitDisplay: unitDisplay,\n roundingMode?: rounding,\n roundingPriority?: roundingPriority,\n roundingIncrement?: roundingIncrement,\n minimumIntegerDigits?: Core__Intl__Common.oneTo21,\n minimumFractionDigits?: Core__Intl__Common.zeroTo20,\n maximumFractionDigits?: Core__Intl__Common.zeroTo20,\n minimumSignificantDigits?: Core__Intl__Common.oneTo21,\n maximumSignificantDigits?: Core__Intl__Common.oneTo21,\n locale: string,\n notation: notation,\n numberingSystem: Core__Intl__Common.numberingSystem,\n signDisplay: signDisplay,\n style: style,\n useGrouping: Grouping.t,\n}" + "signature": "type resolvedOptions = {\n currency?: currency,\n currencyDisplay?: currencyDisplay,\n currencySign?: currencySign,\n compactDisplay?: compactDisplay,\n unit: unitSystem,\n unitDisplay: unitDisplay,\n roundingMode?: rounding,\n roundingPriority?: roundingPriority,\n roundingIncrement?: roundingIncrement,\n minimumIntegerDigits?: Intl_Common.oneTo21,\n minimumFractionDigits?: Intl_Common.zeroTo20,\n maximumFractionDigits?: Intl_Common.zeroTo20,\n minimumSignificantDigits?: Intl_Common.oneTo21,\n maximumSignificantDigits?: Intl_Common.oneTo21,\n locale: string,\n notation: notation,\n numberingSystem: Intl_Common.numberingSystem,\n signDisplay: signDisplay,\n style: style,\n useGrouping: Grouping.t,\n}" }, { - "id": "Core.Intl.NumberFormat.supportedLocalesOptions", + "id": "Stdlib.Intl.NumberFormat.supportedLocalesOptions", "kind": "type", "name": "supportedLocalesOptions", "docstrings": [], - "signature": "type supportedLocalesOptions = {\n localeMatcher: Core__Intl__Common.localeMatcher,\n}" + "signature": "type supportedLocalesOptions = {\n localeMatcher: Intl_Common.localeMatcher,\n}" }, { - "id": "Core.Intl.NumberFormat.numberFormatPartType", + "id": "Stdlib.Intl.NumberFormat.numberFormatPartType", "kind": "type", "name": "numberFormatPartType", "docstrings": [], "signature": "type numberFormatPartType = [\n | #compact\n | #currency\n | #decimal\n | #exponentInteger\n | #exponentMinusSign\n | #exponentSeparator\n | #fraction\n | #group\n | #infinity\n | #integer\n | #literal\n | #minusSign\n | #nan\n | #percentSign\n | #plusSign\n | #unit\n | #unknown\n]" }, { - "id": "Core.Intl.NumberFormat.numberFormatPart", + "id": "Stdlib.Intl.NumberFormat.numberFormatPart", "kind": "type", "name": "numberFormatPart", "docstrings": [], "signature": "type numberFormatPart = {\n \\\"type\": numberFormatPartType,\n value: string,\n}" }, { - "id": "Core.Intl.NumberFormat.rangeSource", + "id": "Stdlib.Intl.NumberFormat.rangeSource", "kind": "type", "name": "rangeSource", "docstrings": [], "signature": "type rangeSource = [#endRange | #shared | #startRange]" }, { - "id": "Core.Intl.NumberFormat.numberFormatRangePart", + "id": "Stdlib.Intl.NumberFormat.numberFormatRangePart", "kind": "type", "name": "numberFormatRangePart", "docstrings": [], "signature": "type numberFormatRangePart = {\n \\\"type\": numberFormatPartType,\n value: string,\n source: rangeSource,\n}" }, { - "id": "Core.Intl.NumberFormat.make", + "id": "Stdlib.Intl.NumberFormat.make", "kind": "value", "name": "make", "docstrings": [], "signature": "let make: (~locales: array=?, ~options: options=?) => t" }, { - "id": "Core.Intl.NumberFormat.supportedLocalesOf", + "id": "Stdlib.Intl.NumberFormat.supportedLocalesOf", "kind": "value", "name": "supportedLocalesOf", "docstrings": [], "signature": "let supportedLocalesOf: (array, ~options: supportedLocalesOptions=?) => t" }, { - "id": "Core.Intl.NumberFormat.resolvedOptions", + "id": "Stdlib.Intl.NumberFormat.resolvedOptions", "kind": "value", "name": "resolvedOptions", "docstrings": [], "signature": "let resolvedOptions: t => resolvedOptions" }, { - "id": "Core.Intl.NumberFormat.format", + "id": "Stdlib.Intl.NumberFormat.format", "kind": "value", "name": "format", "docstrings": [], "signature": "let format: (t, float) => string" }, { - "id": "Core.Intl.NumberFormat.formatRange", + "id": "Stdlib.Intl.NumberFormat.formatRange", "kind": "value", "name": "formatRange", "docstrings": [], "signature": "let formatRange: (t, ~start: float, ~end: float) => array" }, { - "id": "Core.Intl.NumberFormat.formatToParts", + "id": "Stdlib.Intl.NumberFormat.formatToParts", "kind": "value", "name": "formatToParts", "docstrings": [], "signature": "let formatToParts: (t, float) => array" }, { - "id": "Core.Intl.NumberFormat.formatRangeToParts", + "id": "Stdlib.Intl.NumberFormat.formatRangeToParts", "kind": "value", "name": "formatRangeToParts", "docstrings": [], "signature": "let formatRangeToParts: (\n t,\n ~start: float,\n ~end: float,\n) => array" }, { - "id": "Core.Intl.NumberFormat.formatInt", + "id": "Stdlib.Intl.NumberFormat.formatInt", "kind": "value", "name": "formatInt", "docstrings": [], "signature": "let formatInt: (t, int) => string" }, { - "id": "Core.Intl.NumberFormat.formatIntRange", + "id": "Stdlib.Intl.NumberFormat.formatIntRange", "kind": "value", "name": "formatIntRange", "docstrings": [], "signature": "let formatIntRange: (t, ~start: int, ~end: int) => array" }, { - "id": "Core.Intl.NumberFormat.formatIntToParts", + "id": "Stdlib.Intl.NumberFormat.formatIntToParts", "kind": "value", "name": "formatIntToParts", "docstrings": [], "signature": "let formatIntToParts: (t, int) => array" }, { - "id": "Core.Intl.NumberFormat.formatIntRangeToParts", + "id": "Stdlib.Intl.NumberFormat.formatIntRangeToParts", "kind": "value", "name": "formatIntRangeToParts", "docstrings": [], "signature": "let formatIntRangeToParts: (t, ~start: int, ~end: int) => array" }, { - "id": "Core.Intl.NumberFormat.formatBigInt", + "id": "Stdlib.Intl.NumberFormat.formatBigInt", "kind": "value", "name": "formatBigInt", "docstrings": [], "signature": "let formatBigInt: (t, bigint) => string" }, { - "id": "Core.Intl.NumberFormat.formatBigIntRange", + "id": "Stdlib.Intl.NumberFormat.formatBigIntRange", "kind": "value", "name": "formatBigIntRange", "docstrings": [], "signature": "let formatBigIntRange: (t, ~start: bigint, ~end: bigint) => array" }, { - "id": "Core.Intl.NumberFormat.formatBigIntToParts", + "id": "Stdlib.Intl.NumberFormat.formatBigIntToParts", "kind": "value", "name": "formatBigIntToParts", "docstrings": [], "signature": "let formatBigIntToParts: (t, bigint) => array" }, { - "id": "Core.Intl.NumberFormat.formatBigIntRangeToParts", + "id": "Stdlib.Intl.NumberFormat.formatBigIntRangeToParts", "kind": "value", "name": "formatBigIntRangeToParts", "docstrings": [], "signature": "let formatBigIntRangeToParts: (t, ~start: bigint, ~end: bigint) => array" }, { - "id": "Core.Intl.NumberFormat.formatString", + "id": "Stdlib.Intl.NumberFormat.formatString", "kind": "value", "name": "formatString", "docstrings": [], "signature": "let formatString: (t, string) => string" }, { - "id": "Core.Intl.NumberFormat.formatStringToParts", + "id": "Stdlib.Intl.NumberFormat.formatStringToParts", "kind": "value", "name": "formatStringToParts", "docstrings": [], "signature": "let formatStringToParts: (t, string) => array" + }, + { + "id": "Stdlib.Intl.NumberFormat.ignore", + "kind": "value", + "name": "ignore", + "docstrings": [ + "`ignore(numberFormat)` ignores the provided numberFormat and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." + ], + "signature": "let ignore: t => unit" } ] }, - "core/intl/locale": { - "id": "Core.Intl.Locale", + "stdlib/intl/locale": { + "id": "Stdlib.Intl.Locale", "name": "Locale", "docstrings": [], "items": [ { - "id": "Core.Intl.Locale.t", + "id": "Stdlib.Intl.Locale.t", "kind": "type", "name": "t", "docstrings": [], "signature": "type t" }, { - "id": "Core.Intl.Locale.options", + "id": "Stdlib.Intl.Locale.options", "kind": "type", "name": "options", "docstrings": [], - "signature": "type options = {\n baseName?: string,\n calendar?: Core__Intl__Common.calendar,\n collation?: Core__Intl__Common.collation,\n hourCycle?: [#h11 | #h12 | #h23 | #h24],\n caseFirst?: [#\"false\" | #lower | #upper],\n numberingSystem?: Core__Intl__Common.numberingSystem,\n numeric?: bool,\n language?: string,\n script?: string,\n region?: string,\n}" + "signature": "type options = {\n baseName?: string,\n calendar?: Intl_Common.calendar,\n collation?: Intl_Common.collation,\n hourCycle?: [#h11 | #h12 | #h23 | #h24],\n caseFirst?: [#\"false\" | #lower | #upper],\n numberingSystem?: Intl_Common.numberingSystem,\n numeric?: bool,\n language?: string,\n script?: string,\n region?: string,\n}" }, { - "id": "Core.Intl.Locale.make", + "id": "Stdlib.Intl.Locale.make", "kind": "value", "name": "make", "docstrings": [], "signature": "let make: (string, ~options: options=?) => t" }, { - "id": "Core.Intl.Locale.baseName", + "id": "Stdlib.Intl.Locale.baseName", "kind": "value", "name": "baseName", "docstrings": [], "signature": "let baseName: t => string" }, { - "id": "Core.Intl.Locale.calendar", + "id": "Stdlib.Intl.Locale.calendar", "kind": "value", "name": "calendar", "docstrings": [], "signature": "let calendar: t => option" }, { - "id": "Core.Intl.Locale.caseFirst", + "id": "Stdlib.Intl.Locale.caseFirst", "kind": "value", "name": "caseFirst", "docstrings": [], "signature": "let caseFirst: t => option" }, { - "id": "Core.Intl.Locale.collation", + "id": "Stdlib.Intl.Locale.collation", "kind": "value", "name": "collation", "docstrings": [], "signature": "let collation: t => option" }, { - "id": "Core.Intl.Locale.hourCycle", + "id": "Stdlib.Intl.Locale.hourCycle", "kind": "value", "name": "hourCycle", "docstrings": [], "signature": "let hourCycle: t => option" }, { - "id": "Core.Intl.Locale.language", + "id": "Stdlib.Intl.Locale.language", "kind": "value", "name": "language", "docstrings": [], "signature": "let language: t => string" }, { - "id": "Core.Intl.Locale.numberingSystem", + "id": "Stdlib.Intl.Locale.numberingSystem", "kind": "value", "name": "numberingSystem", "docstrings": [], "signature": "let numberingSystem: t => option" }, { - "id": "Core.Intl.Locale.numeric", + "id": "Stdlib.Intl.Locale.numeric", "kind": "value", "name": "numeric", "docstrings": [], "signature": "let numeric: t => bool" }, { - "id": "Core.Intl.Locale.region", + "id": "Stdlib.Intl.Locale.region", "kind": "value", "name": "region", "docstrings": [], "signature": "let region: t => option" }, { - "id": "Core.Intl.Locale.script", + "id": "Stdlib.Intl.Locale.script", "kind": "value", "name": "script", "docstrings": [], "signature": "let script: t => option" }, { - "id": "Core.Intl.Locale.maximize", + "id": "Stdlib.Intl.Locale.maximize", "kind": "value", "name": "maximize", "docstrings": [], "signature": "let maximize: t => t" }, { - "id": "Core.Intl.Locale.minimize", + "id": "Stdlib.Intl.Locale.minimize", "kind": "value", "name": "minimize", "docstrings": [], "signature": "let minimize: t => t" + }, + { + "id": "Stdlib.Intl.Locale.ignore", + "kind": "value", + "name": "ignore", + "docstrings": [ + "`ignore(locale)` ignores the provided locale and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." + ], + "signature": "let ignore: t => unit" } ] }, - "core/intl/listformat": { - "id": "Core.Intl.ListFormat", + "stdlib/intl/listformat": { + "id": "Stdlib.Intl.ListFormat", "name": "ListFormat", "docstrings": [], "items": [ { - "id": "Core.Intl.ListFormat.t", + "id": "Stdlib.Intl.ListFormat.t", "kind": "type", "name": "t", "docstrings": [], "signature": "type t" }, { - "id": "Core.Intl.ListFormat.listType", + "id": "Stdlib.Intl.ListFormat.listType", "kind": "type", "name": "listType", "docstrings": [], "signature": "type listType = [#conjunction | #disjunction | #unit]" }, { - "id": "Core.Intl.ListFormat.style", + "id": "Stdlib.Intl.ListFormat.style", "kind": "type", "name": "style", "docstrings": [], "signature": "type style = [#long | #narrow | #short]" }, { - "id": "Core.Intl.ListFormat.options", + "id": "Stdlib.Intl.ListFormat.options", "kind": "type", "name": "options", "docstrings": [], - "signature": "type options = {\n localeMatcher?: Core__Intl__Common.localeMatcher,\n \\\"type\"?: listType,\n style?: style,\n}" + "signature": "type options = {\n localeMatcher?: Intl_Common.localeMatcher,\n \\\"type\"?: listType,\n style?: style,\n}" }, { - "id": "Core.Intl.ListFormat.listPartComponentType", + "id": "Stdlib.Intl.ListFormat.listPartComponentType", "kind": "type", "name": "listPartComponentType", "docstrings": [], "signature": "type listPartComponentType = [#element | #literal]" }, { - "id": "Core.Intl.ListFormat.listPart", + "id": "Stdlib.Intl.ListFormat.listPart", "kind": "type", "name": "listPart", "docstrings": [], "signature": "type listPart = {\n \\\"type\": listPartComponentType,\n value: string,\n}" }, { - "id": "Core.Intl.ListFormat.resolvedOptions", + "id": "Stdlib.Intl.ListFormat.resolvedOptions", "kind": "type", "name": "resolvedOptions", "docstrings": [], "signature": "type resolvedOptions = {\n locale: string,\n style: style,\n \\\"type\": listType,\n}" }, { - "id": "Core.Intl.ListFormat.supportedLocalesOptions", + "id": "Stdlib.Intl.ListFormat.supportedLocalesOptions", "kind": "type", "name": "supportedLocalesOptions", "docstrings": [], - "signature": "type supportedLocalesOptions = {\n localeMatcher: Core__Intl__Common.localeMatcher,\n}" + "signature": "type supportedLocalesOptions = {\n localeMatcher: Intl_Common.localeMatcher,\n}" }, { - "id": "Core.Intl.ListFormat.make", + "id": "Stdlib.Intl.ListFormat.make", "kind": "value", "name": "make", "docstrings": [], "signature": "let make: (~locales: array=?, ~options: options=?) => t" }, { - "id": "Core.Intl.ListFormat.supportedLocalesOf", + "id": "Stdlib.Intl.ListFormat.supportedLocalesOf", "kind": "value", "name": "supportedLocalesOf", "docstrings": [], "signature": "let supportedLocalesOf: (array, ~options: supportedLocalesOptions=?) => t" }, { - "id": "Core.Intl.ListFormat.resolvedOptions", + "id": "Stdlib.Intl.ListFormat.resolvedOptions", "kind": "value", "name": "resolvedOptions", "docstrings": [], "signature": "let resolvedOptions: t => resolvedOptions" }, { - "id": "Core.Intl.ListFormat.format", + "id": "Stdlib.Intl.ListFormat.format", "kind": "value", "name": "format", "docstrings": [], "signature": "let format: (t, array) => string" }, { - "id": "Core.Intl.ListFormat.formatToParts", + "id": "Stdlib.Intl.ListFormat.formatToParts", "kind": "value", "name": "formatToParts", "docstrings": [], "signature": "let formatToParts: (t, array) => array" + }, + { + "id": "Stdlib.Intl.ListFormat.ignore", + "kind": "value", + "name": "ignore", + "docstrings": [ + "`ignore(listFormat)` ignores the provided listFormat and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." + ], + "signature": "let ignore: t => unit" } ] }, - "core/intl/datetimeformat": { - "id": "Core.Intl.DateTimeFormat", + "stdlib/intl/datetimeformat": { + "id": "Stdlib.Intl.DateTimeFormat", "name": "DateTimeFormat", "docstrings": [], "items": [ { - "id": "Core.Intl.DateTimeFormat.t", + "id": "Stdlib.Intl.DateTimeFormat.t", "kind": "type", "name": "t", "docstrings": [], "signature": "type t" }, { - "id": "Core.Intl.DateTimeFormat.dateStyle", + "id": "Stdlib.Intl.DateTimeFormat.dateStyle", "kind": "type", "name": "dateStyle", "docstrings": [], "signature": "type dateStyle = [#full | #long | #medium | #short]" }, { - "id": "Core.Intl.DateTimeFormat.timeStyle", + "id": "Stdlib.Intl.DateTimeFormat.timeStyle", "kind": "type", "name": "timeStyle", "docstrings": [], "signature": "type timeStyle = [#full | #long | #medium | #short]" }, { - "id": "Core.Intl.DateTimeFormat.dayPeriod", + "id": "Stdlib.Intl.DateTimeFormat.dayPeriod", "kind": "type", "name": "dayPeriod", "docstrings": [], "signature": "type dayPeriod = [#long | #narrow | #short]" }, { - "id": "Core.Intl.DateTimeFormat.weekday", + "id": "Stdlib.Intl.DateTimeFormat.weekday", "kind": "type", "name": "weekday", "docstrings": [], "signature": "type weekday = [#long | #narrow | #short]" }, { - "id": "Core.Intl.DateTimeFormat.era", + "id": "Stdlib.Intl.DateTimeFormat.era", "kind": "type", "name": "era", "docstrings": [], "signature": "type era = [#long | #narrow | #short]" }, { - "id": "Core.Intl.DateTimeFormat.year", + "id": "Stdlib.Intl.DateTimeFormat.year", "kind": "type", "name": "year", "docstrings": [], "signature": "type year = [#\"2-digit\" | #numeric]" }, { - "id": "Core.Intl.DateTimeFormat.month", + "id": "Stdlib.Intl.DateTimeFormat.month", "kind": "type", "name": "month", "docstrings": [], "signature": "type month = [\n | #\"2-digit\"\n | #long\n | #narrow\n | #numeric\n | #short\n]" }, { - "id": "Core.Intl.DateTimeFormat.day", + "id": "Stdlib.Intl.DateTimeFormat.day", "kind": "type", "name": "day", "docstrings": [], "signature": "type day = [#\"2-digit\" | #numeric]" }, { - "id": "Core.Intl.DateTimeFormat.hour", + "id": "Stdlib.Intl.DateTimeFormat.hour", "kind": "type", "name": "hour", "docstrings": [], "signature": "type hour = [#\"2-digit\" | #numeric]" }, { - "id": "Core.Intl.DateTimeFormat.minute", + "id": "Stdlib.Intl.DateTimeFormat.minute", "kind": "type", "name": "minute", "docstrings": [], "signature": "type minute = [#\"2-digit\" | #numeric]" }, { - "id": "Core.Intl.DateTimeFormat.second", + "id": "Stdlib.Intl.DateTimeFormat.second", "kind": "type", "name": "second", "docstrings": [], "signature": "type second = [#\"2-digit\" | #numeric]" }, { - "id": "Core.Intl.DateTimeFormat.timeZoneName", + "id": "Stdlib.Intl.DateTimeFormat.timeZoneName", "kind": "type", "name": "timeZoneName", "docstrings": [ @@ -1165,252 +2035,270 @@ "signature": "type timeZoneName = [\n | #long\n | #longGeneric\n | #longOffset\n | #short\n | #shortGeneric\n | #shortOffset\n]" }, { - "id": "Core.Intl.DateTimeFormat.hourCycle", + "id": "Stdlib.Intl.DateTimeFormat.hourCycle", "kind": "type", "name": "hourCycle", "docstrings": [], "signature": "type hourCycle = [#h11 | #h12 | #h23 | #h24]" }, { - "id": "Core.Intl.DateTimeFormat.formatMatcher", + "id": "Stdlib.Intl.DateTimeFormat.formatMatcher", "kind": "type", "name": "formatMatcher", "docstrings": [], "signature": "type formatMatcher = [#basic | #\"best fit\"]" }, { - "id": "Core.Intl.DateTimeFormat.fractionalSecondDigits", + "id": "Stdlib.Intl.DateTimeFormat.fractionalSecondDigits", "kind": "type", "name": "fractionalSecondDigits", "docstrings": [], "signature": "type fractionalSecondDigits = [#0 | #1 | #2 | #3]" }, { - "id": "Core.Intl.DateTimeFormat.options", + "id": "Stdlib.Intl.DateTimeFormat.options", "kind": "type", "name": "options", "docstrings": [], - "signature": "type options = {\n dateStyle?: dateStyle,\n timeStyle?: timeStyle,\n calendar?: Core__Intl__Common.calendar,\n dayPeriod?: dayPeriod,\n numberingSystem?: Core__Intl__Common.numberingSystem,\n localeMatcher?: Core__Intl__Common.localeMatcher,\n timeZone?: string,\n hour12?: bool,\n hourCycle?: hourCycle,\n formatMatcher?: formatMatcher,\n weekday?: weekday,\n era?: era,\n year?: year,\n month?: month,\n day?: day,\n hour?: hour,\n minute?: minute,\n second?: second,\n fractionalSecondDigits?: fractionalSecondDigits,\n timeZoneName?: timeZoneName,\n}" + "signature": "type options = {\n dateStyle?: dateStyle,\n timeStyle?: timeStyle,\n calendar?: Intl_Common.calendar,\n dayPeriod?: dayPeriod,\n numberingSystem?: Intl_Common.numberingSystem,\n localeMatcher?: Intl_Common.localeMatcher,\n timeZone?: string,\n hour12?: bool,\n hourCycle?: hourCycle,\n formatMatcher?: formatMatcher,\n weekday?: weekday,\n era?: era,\n year?: year,\n month?: month,\n day?: day,\n hour?: hour,\n minute?: minute,\n second?: second,\n fractionalSecondDigits?: fractionalSecondDigits,\n timeZoneName?: timeZoneName,\n}" }, { - "id": "Core.Intl.DateTimeFormat.resolvedOptions", + "id": "Stdlib.Intl.DateTimeFormat.resolvedOptions", "kind": "type", "name": "resolvedOptions", "docstrings": [], - "signature": "type resolvedOptions = {\n dateStyle?: dateStyle,\n timeStyle?: timeStyle,\n weekday?: weekday,\n era?: era,\n year?: year,\n month?: month,\n day?: day,\n hour?: hour,\n minute?: minute,\n second?: second,\n fractionalSecondDigits?: fractionalSecondDigits,\n timeZoneName?: timeZoneName,\n calendar: Core__Intl__Common.calendar,\n hour12: bool,\n hourCycle: hourCycle,\n locale: string,\n numberingSystem: Core__Intl__Common.numberingSystem,\n timeZone: string,\n}" + "signature": "type resolvedOptions = {\n dateStyle?: dateStyle,\n timeStyle?: timeStyle,\n weekday?: weekday,\n era?: era,\n year?: year,\n month?: month,\n day?: day,\n hour?: hour,\n minute?: minute,\n second?: second,\n fractionalSecondDigits?: fractionalSecondDigits,\n timeZoneName?: timeZoneName,\n calendar: Intl_Common.calendar,\n hour12: bool,\n hourCycle: hourCycle,\n locale: string,\n numberingSystem: Intl_Common.numberingSystem,\n timeZone: string,\n}" }, { - "id": "Core.Intl.DateTimeFormat.supportedLocalesOptions", + "id": "Stdlib.Intl.DateTimeFormat.supportedLocalesOptions", "kind": "type", "name": "supportedLocalesOptions", "docstrings": [], - "signature": "type supportedLocalesOptions = {\n localeMatcher: Core__Intl__Common.localeMatcher,\n}" + "signature": "type supportedLocalesOptions = {\n localeMatcher: Intl_Common.localeMatcher,\n}" }, { - "id": "Core.Intl.DateTimeFormat.dateTimeComponent", + "id": "Stdlib.Intl.DateTimeFormat.dateTimeComponent", "kind": "type", "name": "dateTimeComponent", "docstrings": [], "signature": "type dateTimeComponent = [\n | #day\n | #dayPeriod\n | #era\n | #fractionalSecond\n | #hour\n | #literal\n | #minute\n | #month\n | #relatedYear\n | #second\n | #timeZone\n | #weekday\n | #year\n | #yearName\n]" }, { - "id": "Core.Intl.DateTimeFormat.dateTimePart", + "id": "Stdlib.Intl.DateTimeFormat.dateTimePart", "kind": "type", "name": "dateTimePart", "docstrings": [], "signature": "type dateTimePart = {\n \\\"type\": dateTimeComponent,\n value: string,\n}" }, { - "id": "Core.Intl.DateTimeFormat.dateTimeRangeSource", + "id": "Stdlib.Intl.DateTimeFormat.dateTimeRangeSource", "kind": "type", "name": "dateTimeRangeSource", "docstrings": [], "signature": "type dateTimeRangeSource = [\n | #endRange\n | #shared\n | #startRange\n]" }, { - "id": "Core.Intl.DateTimeFormat.dateTimeRangePart", + "id": "Stdlib.Intl.DateTimeFormat.dateTimeRangePart", "kind": "type", "name": "dateTimeRangePart", "docstrings": [], "signature": "type dateTimeRangePart = {\n \\\"type\": dateTimeComponent,\n value: string,\n source: dateTimeRangeSource,\n}" }, { - "id": "Core.Intl.DateTimeFormat.make", + "id": "Stdlib.Intl.DateTimeFormat.make", "kind": "value", "name": "make", "docstrings": [], "signature": "let make: (~locales: array=?, ~options: options=?) => t" }, { - "id": "Core.Intl.DateTimeFormat.supportedLocalesOf", + "id": "Stdlib.Intl.DateTimeFormat.supportedLocalesOf", "kind": "value", "name": "supportedLocalesOf", "docstrings": [], "signature": "let supportedLocalesOf: (array, ~options: supportedLocalesOptions=?) => t" }, { - "id": "Core.Intl.DateTimeFormat.resolvedOptions", + "id": "Stdlib.Intl.DateTimeFormat.resolvedOptions", "kind": "value", "name": "resolvedOptions", "docstrings": [], "signature": "let resolvedOptions: t => resolvedOptions" }, { - "id": "Core.Intl.DateTimeFormat.format", + "id": "Stdlib.Intl.DateTimeFormat.format", "kind": "value", "name": "format", "docstrings": [], - "signature": "let format: (t, Core__Date.t) => string" + "signature": "let format: (t, Date.t) => string" }, { - "id": "Core.Intl.DateTimeFormat.formatToParts", + "id": "Stdlib.Intl.DateTimeFormat.formatToParts", "kind": "value", "name": "formatToParts", "docstrings": [], - "signature": "let formatToParts: (t, Core__Date.t) => array" + "signature": "let formatToParts: (t, Date.t) => array" }, { - "id": "Core.Intl.DateTimeFormat.formatRange", + "id": "Stdlib.Intl.DateTimeFormat.formatRange", "kind": "value", "name": "formatRange", "docstrings": [], - "signature": "let formatRange: (\n t,\n ~startDate: Core__Date.t,\n ~endDate: Core__Date.t,\n) => string" + "signature": "let formatRange: (\n t,\n ~startDate: Date.t,\n ~endDate: Date.t,\n) => string" }, { - "id": "Core.Intl.DateTimeFormat.formatRangeToParts", + "id": "Stdlib.Intl.DateTimeFormat.formatRangeToParts", "kind": "value", "name": "formatRangeToParts", "docstrings": [], - "signature": "let formatRangeToParts: (\n t,\n ~startDate: Core__Date.t,\n ~endDate: Core__Date.t,\n) => array" + "signature": "let formatRangeToParts: (\n t,\n ~startDate: Date.t,\n ~endDate: Date.t,\n) => array" + }, + { + "id": "Stdlib.Intl.DateTimeFormat.ignore", + "kind": "value", + "name": "ignore", + "docstrings": [ + "`ignore(dateTimeFormat)` ignores the provided dateTimeFormat and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." + ], + "signature": "let ignore: t => unit" } ] }, - "core/intl/collator": { - "id": "Core.Intl.Collator", + "stdlib/intl/collator": { + "id": "Stdlib.Intl.Collator", "name": "Collator", "docstrings": [], "items": [ { - "id": "Core.Intl.Collator.t", + "id": "Stdlib.Intl.Collator.t", "kind": "type", "name": "t", "docstrings": [], "signature": "type t" }, { - "id": "Core.Intl.Collator.usage", + "id": "Stdlib.Intl.Collator.usage", "kind": "type", "name": "usage", "docstrings": [], "signature": "type usage = [#search | #sort]" }, { - "id": "Core.Intl.Collator.sensitivity", + "id": "Stdlib.Intl.Collator.sensitivity", "kind": "type", "name": "sensitivity", "docstrings": [], "signature": "type sensitivity = [#accent | #base | #case | #variant]" }, { - "id": "Core.Intl.Collator.caseFirst", + "id": "Stdlib.Intl.Collator.caseFirst", "kind": "type", "name": "caseFirst", "docstrings": [], "signature": "type caseFirst = [#\"false\" | #lower | #upper]" }, { - "id": "Core.Intl.Collator.options", + "id": "Stdlib.Intl.Collator.options", "kind": "type", "name": "options", "docstrings": [], - "signature": "type options = {\n localeMatcher?: Core__Intl__Common.localeMatcher,\n usage?: usage,\n sensitivity?: sensitivity,\n ignorePunctuation?: bool,\n numeric?: bool,\n caseFirst?: caseFirst,\n}" + "signature": "type options = {\n localeMatcher?: Intl_Common.localeMatcher,\n usage?: usage,\n sensitivity?: sensitivity,\n ignorePunctuation?: bool,\n numeric?: bool,\n caseFirst?: caseFirst,\n}" }, { - "id": "Core.Intl.Collator.resolvedOptions", + "id": "Stdlib.Intl.Collator.resolvedOptions", "kind": "type", "name": "resolvedOptions", "docstrings": [], "signature": "type resolvedOptions = {\n locale: string,\n usage: usage,\n sensitivity: sensitivity,\n ignorePunctuation: bool,\n collation: [\n | #compat\n | #default\n | #dict\n | #emoji\n | #eor\n | #phonebk\n | #phonetic\n | #pinyin\n | #stroke\n | #trad\n | #unihan\n | #zhuyin\n ],\n numeric?: bool,\n caseFirst?: caseFirst,\n}" }, { - "id": "Core.Intl.Collator.supportedLocalesOptions", + "id": "Stdlib.Intl.Collator.supportedLocalesOptions", "kind": "type", "name": "supportedLocalesOptions", "docstrings": [], - "signature": "type supportedLocalesOptions = {\n localeMatcher: Core__Intl__Common.localeMatcher,\n}" + "signature": "type supportedLocalesOptions = {\n localeMatcher: Intl_Common.localeMatcher,\n}" }, { - "id": "Core.Intl.Collator.make", + "id": "Stdlib.Intl.Collator.make", "kind": "value", "name": "make", "docstrings": [], "signature": "let make: (~locales: array=?, ~options: options=?) => t" }, { - "id": "Core.Intl.Collator.supportedLocalesOf", + "id": "Stdlib.Intl.Collator.supportedLocalesOf", "kind": "value", "name": "supportedLocalesOf", "docstrings": [], "signature": "let supportedLocalesOf: (array, ~options: supportedLocalesOptions=?) => t" }, { - "id": "Core.Intl.Collator.resolvedOptions", + "id": "Stdlib.Intl.Collator.resolvedOptions", "kind": "value", "name": "resolvedOptions", "docstrings": [], "signature": "let resolvedOptions: t => resolvedOptions" }, { - "id": "Core.Intl.Collator.compare", + "id": "Stdlib.Intl.Collator.compare", "kind": "value", "name": "compare", "docstrings": [], "signature": "let compare: (t, string, string) => int" + }, + { + "id": "Stdlib.Intl.Collator.ignore", + "kind": "value", + "name": "ignore", + "docstrings": [ + "`ignore(collator)` ignores the provided collator and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." + ], + "signature": "let ignore: t => unit" } ] }, - "core/intl/common": { - "id": "Core.Intl.Common", + "stdlib/intl/common": { + "id": "Stdlib.Intl.Common", "name": "Common", "docstrings": [], "items": [ { - "id": "Core.Intl.Common.localeMatcher", + "id": "Stdlib.Intl.Common.localeMatcher", "kind": "type", "name": "localeMatcher", "docstrings": [], "signature": "type localeMatcher = [#\"best fit\" | #lookup]" }, { - "id": "Core.Intl.Common.calendar", + "id": "Stdlib.Intl.Common.calendar", "kind": "type", "name": "calendar", "docstrings": [], "signature": "type calendar = [\n | #buddhist\n | #chinese\n | #coptic\n | #dangi\n | #ethioaa\n | #ethiopic\n | #gregory\n | #hebrew\n | #indian\n | #islamic\n | #\"islamic-civil\"\n | #\"islamic-rgsa\"\n | #\"islamic-tbla\"\n | #\"islamic-umalqura\"\n | #iso8601\n | #japanese\n | #persian\n | #roc\n]" }, { - "id": "Core.Intl.Common.collation", + "id": "Stdlib.Intl.Common.collation", "kind": "type", "name": "collation", "docstrings": [], "signature": "type collation = [\n | #compat\n | #dict\n | #emoji\n | #eor\n | #phonebk\n | #phonetic\n | #pinyin\n | #stroke\n | #trad\n | #unihan\n | #zhuyin\n]" }, { - "id": "Core.Intl.Common.numberingSystem", + "id": "Stdlib.Intl.Common.numberingSystem", "kind": "type", "name": "numberingSystem", "docstrings": [], "signature": "type numberingSystem = [\n | #adlm\n | #ahom\n | #arab\n | #arabext\n | #bali\n | #beng\n | #bhks\n | #brah\n | #cakm\n | #cham\n | #deva\n | #diak\n | #fullwide\n | #gong\n | #gonm\n | #gujr\n | #guru\n | #hanidec\n | #hmng\n | #hmnp\n | #java\n | #kali\n | #kawi\n | #khmr\n | #knda\n | #lana\n | #lanatham\n | #laoo\n | #latn\n | #lepc\n | #limb\n | #mathbold\n | #mathdbl\n | #mathmono\n | #mathsanb\n | #mathsans\n | #mlym\n | #modi\n | #mong\n | #mroo\n | #mtei\n | #mymr\n | #mymrshan\n | #mymrtlng\n | #nagm\n | #newa\n | #nkoo\n | #olck\n | #orya\n | #osma\n | #rohg\n | #saur\n | #segment\n | #shrd\n | #sind\n | #sinh\n | #sora\n | #sund\n | #takr\n | #talu\n | #tamldec\n | #telu\n | #thai\n | #tibt\n | #tirh\n | #tnsa\n | #vaii\n | #wara\n | #wcho\n]" }, { - "id": "Core.Intl.Common.oneTo21", + "id": "Stdlib.Intl.Common.oneTo21", "kind": "type", "name": "oneTo21", "docstrings": [], "signature": "type oneTo21 = [\n | #1\n | #10\n | #11\n | #12\n | #13\n | #14\n | #15\n | #16\n | #17\n | #18\n | #19\n | #2\n | #20\n | #21\n | #3\n | #4\n | #5\n | #6\n | #7\n | #8\n | #9\n]" }, { - "id": "Core.Intl.Common.zeroTo20", + "id": "Stdlib.Intl.Common.zeroTo20", "kind": "type", "name": "zeroTo20", "docstrings": [], @@ -1418,5812 +2306,6090 @@ } ] }, - "core/biguint64array/constants": { - "id": "Core.BigUint64Array.Constants", - "name": "Constants", + "stdlib/int/ref": { + "id": "Stdlib.Int.Ref", + "name": "Ref", "docstrings": [], "items": [ { - "id": "Core.BigUint64Array.Constants.bytesPerElement", + "id": "Stdlib.Int.Ref.t", + "kind": "type", + "name": "t", + "docstrings": [], + "signature": "type t = ref" + }, + { + "id": "Stdlib.Int.Ref.increment", "kind": "value", - "name": "bytesPerElement", + "name": "increment", "docstrings": [ - "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)" + "`increment(intRef)` increments the value of the provided reference by 1.\n\n ## Examples\n\n ```rescript\n let myRef = ref(4)\n Int.Ref.increment(myRef)\n assertEqual(myRef.contents, 5)\n ```" ], - "signature": "let bytesPerElement: int" + "signature": "let increment: ref => unit" + }, + { + "id": "Stdlib.Int.Ref.decrement", + "kind": "value", + "name": "decrement", + "docstrings": [ + "`decrement(intRef)` decrements the value of the provided reference by 1.\n\n ## Examples\n\n ```rescript\n let myRef = ref(4)\n Int.Ref.decrement(myRef)\n assertEqual(myRef.contents, 3)\n ```" + ], + "signature": "let decrement: ref => unit" } ] }, - "core/bigint64array/constants": { - "id": "Core.BigInt64Array.Constants", + "stdlib/int/constants": { + "id": "Stdlib.Int.Constants", "name": "Constants", "docstrings": [], "items": [ { - "id": "Core.BigInt64Array.Constants.bytesPerElement", + "id": "Stdlib.Int.Constants.minValue", "kind": "value", - "name": "bytesPerElement", + "name": "minValue", "docstrings": [ - "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)" + "The smallest positive number represented in JavaScript.\n See [`Number.MIN_VALUE`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MIN_VALUE)\n on MDN.\n\n ## Examples\n\n ```rescript\n Console.log(Int.Constants.minValue)\n ```" ], - "signature": "let bytesPerElement: int" + "signature": "let minValue: int" + }, + { + "id": "Stdlib.Int.Constants.maxValue", + "kind": "value", + "name": "maxValue", + "docstrings": [ + "The largest positive number represented in JavaScript.\n See [`Number.MAX_VALUE`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_VALUE)\n on MDN.\n\n ## Examples\n\n ```rescript\n Console.log(Int.Constants.maxValue)\n ```" + ], + "signature": "let maxValue: int" } ] }, - "core/uint8clampedarray/constants": { - "id": "Core.Uint8ClampedArray.Constants", + "stdlib/float/constants": { + "id": "Stdlib.Float.Constants", "name": "Constants", + "docstrings": [ + "Float constants." + ], + "items": [ + { + "id": "Stdlib.Float.Constants.nan", + "kind": "value", + "name": "nan", + "docstrings": [ + "The special value \"Not a Number\"\n See [`NaN`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NaN) on MDN.\n\n ## Examples\n\n ```rescript\n Float.Constants.nan\n ```" + ], + "signature": "let nan: float" + }, + { + "id": "Stdlib.Float.Constants.epsilon", + "kind": "value", + "name": "epsilon", + "docstrings": [ + "Represents the difference between 1 and the smallest floating point number greater than 1.\n See [`Number.EPSILON`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/EPSILON) on MDN.\n\n ## Examples\n\n ```rescript\n Float.Constants.epsilon\n ```" + ], + "signature": "let epsilon: float" + }, + { + "id": "Stdlib.Float.Constants.positiveInfinity", + "kind": "value", + "name": "positiveInfinity", + "docstrings": [ + "The positive Infinity value\n See [`Number.POSITIVE_INFINITY`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/POSITIVE_INFINITY) on MDN.\n\n ## Examples\n\n ```rescript\n Float.Constants.positiveInfinity\n ```" + ], + "signature": "let positiveInfinity: float" + }, + { + "id": "Stdlib.Float.Constants.negativeInfinity", + "kind": "value", + "name": "negativeInfinity", + "docstrings": [ + "The negative Infinity value\n See [`Number.NEGATIVE_INFINITY`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/NEGATIVE_INFINITY) on MDN.\n\n ## Examples\n\n ```rescript\n Float.Constants.negativeInfinity\n ```" + ], + "signature": "let negativeInfinity: float" + }, + { + "id": "Stdlib.Float.Constants.minValue", + "kind": "value", + "name": "minValue", + "docstrings": [ + "The smallest positive numeric value representable in JavaScript.\n See [`Number.MIN_VALUE`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MIN_VALUE) on MDN.\n\n ## Examples\n\n ```rescript\n Float.Constants.minValue\n ```" + ], + "signature": "let minValue: float" + }, + { + "id": "Stdlib.Float.Constants.maxValue", + "kind": "value", + "name": "maxValue", + "docstrings": [ + "The maximum positive numeric value representable in JavaScript.\n See [`Number.MAX_VALUE`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_VALUE) on MDN.\n\n ## Examples\n\n ```rescript\n Float.Constants.minValue\n ```" + ], + "signature": "let maxValue: float" + } + ] + }, + "stdlib/error/urierror": { + "id": "Stdlib.Error.URIError", + "name": "URIError", "docstrings": [], "items": [ { - "id": "Core.Uint8ClampedArray.Constants.bytesPerElement", + "id": "Stdlib.Error.URIError.make", "kind": "value", - "name": "bytesPerElement", + "name": "make", "docstrings": [ - "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)" + "Creates a new `URIError` with the provided `message`.\n\n See [`URIError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/URIError) on MDN." ], - "signature": "let bytesPerElement: int" + "signature": "let make: string => t", + "deprecated": "Use `JsError.URIError.make` instead" } ] }, - "core/uint32array/constants": { - "id": "Core.Uint32Array.Constants", - "name": "Constants", + "stdlib/error/typeerror": { + "id": "Stdlib.Error.TypeError", + "name": "TypeError", "docstrings": [], "items": [ { - "id": "Core.Uint32Array.Constants.bytesPerElement", + "id": "Stdlib.Error.TypeError.make", "kind": "value", - "name": "bytesPerElement", + "name": "make", "docstrings": [ - "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)" + "Creates a new `TypeError` with the provided `message`.\n\n See [`TypeError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError) on MDN." ], - "signature": "let bytesPerElement: int" + "signature": "let make: string => t", + "deprecated": "Use `JsError.TypeError.make` instead" } ] }, - "core/uint16array/constants": { - "id": "Core.Uint16Array.Constants", - "name": "Constants", + "stdlib/error/syntaxerror": { + "id": "Stdlib.Error.SyntaxError", + "name": "SyntaxError", "docstrings": [], "items": [ { - "id": "Core.Uint16Array.Constants.bytesPerElement", + "id": "Stdlib.Error.SyntaxError.make", "kind": "value", - "name": "bytesPerElement", + "name": "make", "docstrings": [ - "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)" + "Creates a new `SyntaxError` with the provided `message`.\n\n See [`SyntaxError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SyntaxError) on MDN." ], - "signature": "let bytesPerElement: int" + "signature": "let make: string => t", + "deprecated": "Use `JsError.SyntaxError.make` instead" } ] }, - "core/uint8array/constants": { - "id": "Core.Uint8Array.Constants", - "name": "Constants", + "stdlib/error/referenceerror": { + "id": "Stdlib.Error.ReferenceError", + "name": "ReferenceError", "docstrings": [], "items": [ { - "id": "Core.Uint8Array.Constants.bytesPerElement", + "id": "Stdlib.Error.ReferenceError.make", "kind": "value", - "name": "bytesPerElement", + "name": "make", "docstrings": [ - "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)" + "Creates a new `ReferenceError` with the provided `message`.\n\n See [`ReferenceError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ReferenceError) on MDN." ], - "signature": "let bytesPerElement: int" + "signature": "let make: string => t", + "deprecated": "Use `JsError.ReferenceError.make` instead" } ] }, - "core/int32array/constants": { - "id": "Core.Int32Array.Constants", - "name": "Constants", + "stdlib/error/rangeerror": { + "id": "Stdlib.Error.RangeError", + "name": "RangeError", "docstrings": [], "items": [ { - "id": "Core.Int32Array.Constants.bytesPerElement", + "id": "Stdlib.Error.RangeError.make", "kind": "value", - "name": "bytesPerElement", + "name": "make", "docstrings": [ - "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)" + "Creates a new `RangeError` with the provided `message`.\n\n See [`RangeError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RangeError) on MDN." ], - "signature": "let bytesPerElement: int" + "signature": "let make: string => t", + "deprecated": "Use `JsError.RangeError.make` instead" } ] }, - "core/int16array/constants": { - "id": "Core.Int16Array.Constants", - "name": "Constants", + "stdlib/error/evalerror": { + "id": "Stdlib.Error.EvalError", + "name": "EvalError", "docstrings": [], "items": [ { - "id": "Core.Int16Array.Constants.bytesPerElement", + "id": "Stdlib.Error.EvalError.make", "kind": "value", - "name": "bytesPerElement", + "name": "make", "docstrings": [ - "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)" + "Creates a new `EvalError` with the provided `message`.\n\n See [`EvalError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/EvalError) on MDN." ], - "signature": "let bytesPerElement: int" + "signature": "let make: string => t", + "deprecated": "Use `JsError.EvalError.make` instead" } ] }, - "core/int8array/constants": { - "id": "Core.Int8Array.Constants", - "name": "Constants", + "stdlib/date/utc": { + "id": "Stdlib.Date.UTC", + "name": "UTC", "docstrings": [], "items": [ { - "id": "Core.Int8Array.Constants.bytesPerElement", + "id": "Stdlib.Date.UTC.makeWithYM", "kind": "value", - "name": "bytesPerElement", + "name": "makeWithYM", "docstrings": [ - "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)" + "Returns the time, in milliseconds, since UNIX epoch (January 1, 1970 00:00:00 UTC).\n Be aware of using a value for year < 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#interpretation_of_two-digit_years).\n Months are 0-indexed (0 = January, 11 = December).\n Values, which are out of range, will be carried over to the next bigger unit (s. example).\n\n ## Examples\n ```rescript\n Date.UTC.makeWithYM(~year=2023, ~month=0)\n // 1672531200000\n\n Date.UTC.makeWithYM(~year=2023, ~month=11)\n // 1701388800000\n\n Date.UTC.makeWithYM(~year=2023, ~month=12)\n // 1704067200000\n\n Date.UTC.makeWithYM(~year=2023, ~month=-1)\n // 1669852800000\n ```" ], - "signature": "let bytesPerElement: int" + "signature": "let makeWithYM: (~year: int, ~month: int) => msSinceEpoch" + }, + { + "id": "Stdlib.Date.UTC.makeWithYMD", + "kind": "value", + "name": "makeWithYMD", + "docstrings": [ + "Returns the time, in milliseconds, since UNIX epoch (January 1, 1970 00:00:00 UTC).\n Be aware of using a value for year < 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#interpretation_of_two-digit_years).\n Months are 0-indexed (0 = January, 11 = December).\n Values, which are out of range, will be carried over to the next bigger unit (s. example).\n\n ## Examples\n ```rescript\n Date.UTC.makeWithYMD(~year=2023, ~month=1, ~day=20)\n // 1676851200000\n\n Date.UTC.makeWithYMD(~year=2023, ~month=1, ~day=-1)\n // 1675036800000\n\n Date.UTC.makeWithYMD(~year=2023, ~month=1, ~day=29)\n // 1677628800000\n ```" + ], + "signature": "let makeWithYMD: (~year: int, ~month: int, ~day: int) => msSinceEpoch" + }, + { + "id": "Stdlib.Date.UTC.makeWithYMDH", + "kind": "value", + "name": "makeWithYMDH", + "docstrings": [ + "Returns the time, in milliseconds, since UNIX epoch (January 1, 1970 00:00:00 UTC).\n Be aware of using a value for year < 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#interpretation_of_two-digit_years).\n Months are 0-indexed (0 = January, 11 = December).\n Values, which are out of range, will be carried over to the next bigger unit (s. example).\n\n ## Examples\n ```rescript\n Date.UTC.makeWithYMDH(~year=2023, ~month=1, ~day=20, ~hours=16)\n // 1676908800000\n\n Date.UTC.makeWithYMDH(~year=2023, ~month=1, ~day=20, ~hours=24)\n // 1676937600000\n\n Date.UTC.makeWithYMDH(~year=2023, ~month=1, ~day=20, ~hours=-1)\n // 1676847600000\n ```" + ], + "signature": "let makeWithYMDH: (\n ~year: int,\n ~month: int,\n ~day: int,\n ~hours: int,\n) => msSinceEpoch" + }, + { + "id": "Stdlib.Date.UTC.makeWithYMDHM", + "kind": "value", + "name": "makeWithYMDHM", + "docstrings": [ + "Returns the time, in milliseconds, since UNIX epoch (January 1, 1970 00:00:00 UTC).\n Be aware of using a value for year < 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#interpretation_of_two-digit_years).\n Months are 0-indexed (0 = January, 11 = December).\n Values, which are out of range, will be carried over to the next bigger unit (s. example).\n\n ## Examples\n ```rescript\n Date.UTC.makeWithYMDHM(~year=2023, ~month=1, ~day=20, ~hours=16, ~minutes=40)\n // 1676911200000\n\n Date.UTC.makeWithYMDHM(~year=2023, ~month=1, ~day=20, ~hours=16, ~minutes=60)\n // 1676912400000\n\n Date.UTC.makeWithYMDHM(~year=2023, ~month=1, ~day=20, ~hours=16, ~minutes=-1)\n // 1676908740000\n ```" + ], + "signature": "let makeWithYMDHM: (\n ~year: int,\n ~month: int,\n ~day: int,\n ~hours: int,\n ~minutes: int,\n) => msSinceEpoch" + }, + { + "id": "Stdlib.Date.UTC.makeWithYMDHMS", + "kind": "value", + "name": "makeWithYMDHMS", + "docstrings": [ + "Returns the time, in milliseconds, since UNIX epoch (January 1, 1970 00:00:00 UTC).\n Be aware of using a value for year < 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#interpretation_of_two-digit_years).\n Months are 0-indexed (0 = January, 11 = December).\n Values, which are out of range, will be carried over to the next bigger unit (s. example).\n\n ## Examples\n ```rescript\n Date.UTC.makeWithYMDHMS(~year=2023, ~month=1, ~day=20, ~hours=16, ~minutes=40, ~seconds=0)\n // 1676911200000\n\n Date.UTC.makeWithYMDHMS(~year=2023, ~month=1, ~day=20, ~hours=16, ~minutes=40, ~seconds=60)\n // 1676911260000\n\n Date.UTC.makeWithYMDHMS(~year=2023, ~month=1, ~day=20, ~hours=16, ~minutes=40, ~seconds=-1)\n // 1676911199000\n ```" + ], + "signature": "let makeWithYMDHMS: (\n ~year: int,\n ~month: int,\n ~day: int,\n ~hours: int,\n ~minutes: int,\n ~seconds: int,\n) => msSinceEpoch" + }, + { + "id": "Stdlib.Date.UTC.makeWithYMDHMSM", + "kind": "value", + "name": "makeWithYMDHMSM", + "docstrings": [ + "Returns the time, in milliseconds, since UNIX epoch (January 1, 1970 00:00:00 UTC).\n Be aware of using a value for year < 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#interpretation_of_two-digit_years).\n Months are 0-indexed (0 = January, 11 = December).\n Values, which are out of range, will be carried over to the next bigger unit (s. example).\n\n ## Examples\n ```rescript\n Date.UTC.makeWithYMDHMSM(~year=2023, ~month=1, ~day=20, ~hours=16, ~minutes=40, ~seconds=0, ~milliseconds=0)->Console.log\n // 1676911200000\n\n Date.UTC.makeWithYMDHMSM(~year=2023, ~month=1, ~day=20, ~hours=16, ~minutes=40, ~seconds=0, ~milliseconds=1000)->Console.log\n // 1676911201000\n\n Date.UTC.makeWithYMDHMSM(~year=2023, ~month=1, ~day=20, ~hours=16, ~minutes=40, ~seconds=0, ~milliseconds=-1)->Console.log\n // 1676911199999\n ```" + ], + "signature": "let makeWithYMDHMSM: (\n ~year: int,\n ~month: int,\n ~day: int,\n ~hours: int,\n ~minutes: int,\n ~seconds: int,\n ~milliseconds: int,\n) => msSinceEpoch" } ] }, - "core/float64array/constants": { - "id": "Core.Float64Array.Constants", - "name": "Constants", + "stdlib/biguint64array": { + "id": "Stdlib.BigUint64Array", + "name": "BigUint64Array", "docstrings": [], "items": [ { - "id": "Core.Float64Array.Constants.bytesPerElement", + "id": "Stdlib.BigUint64Array.t", + "kind": "type", + "name": "t", + "docstrings": [ + "The `BigUint64Array` typed array represents an array of 64-bit unsigned integers in platform byte order. See [BigUint64Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigUint64Array)" + ], + "signature": "type t = TypedArray.t" + }, + { + "id": "Stdlib.BigUint64Array.fromArray", "kind": "value", - "name": "bytesPerElement", + "name": "fromArray", "docstrings": [ - "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)" + "`fromArray` creates a `BigUint64Array` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigUint64Array/BigUint64Array)" ], - "signature": "let bytesPerElement: int" + "signature": "let fromArray: array => t" + }, + { + "id": "Stdlib.BigUint64Array.fromBuffer", + "kind": "value", + "name": "fromBuffer", + "docstrings": [ + "`fromBuffer` creates a `BigUint64Array` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigUint64Array/BigUint64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." + ], + "signature": "let fromBuffer: ArrayBuffer.t => t" + }, + { + "id": "Stdlib.BigUint64Array.fromBufferToEnd", + "kind": "value", + "name": "fromBufferToEnd", + "docstrings": [ + "`fromBufferToEnd` creates a `BigUint64Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigUint64Array/BigUint64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." + ], + "signature": "let fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t" + }, + { + "id": "Stdlib.BigUint64Array.fromBufferWithRange", + "kind": "value", + "name": "fromBufferWithRange", + "docstrings": [ + "`fromBufferWithRange` creates a `BigUint64Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigUint64Array/BigUint64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." + ], + "signature": "let fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t" + }, + { + "id": "Stdlib.BigUint64Array.fromLength", + "kind": "value", + "name": "fromLength", + "docstrings": [ + "`fromLength` creates a zero-initialized `BigUint64Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigUint64Array/BigUint64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." + ], + "signature": "let fromLength: int => t" + }, + { + "id": "Stdlib.BigUint64Array.fromArrayLikeOrIterable", + "kind": "value", + "name": "fromArrayLikeOrIterable", + "docstrings": [ + "`fromArrayLikeOrIterable` creates a `BigUint64Array` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" + ], + "signature": "let fromArrayLikeOrIterable: 'a => t" + }, + { + "id": "Stdlib.BigUint64Array.fromArrayLikeOrIterableWithMap", + "kind": "value", + "name": "fromArrayLikeOrIterableWithMap", + "docstrings": [ + "`fromArrayLikeOrIterableWithMap` creates a `BigUint64Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" + ], + "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => bigint) => t" + }, + { + "id": "Stdlib.BigUint64Array.ignore", + "kind": "value", + "name": "ignore", + "docstrings": [ + "`ignore(bigUintArray)` ignores the provided bigUintArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." + ], + "signature": "let ignore: t => unit" } ] }, - "core/float32array/constants": { - "id": "Core.Float32Array.Constants", - "name": "Constants", + "stdlib/bigint64array": { + "id": "Stdlib.BigInt64Array", + "name": "BigInt64Array", "docstrings": [], "items": [ { - "id": "Core.Float32Array.Constants.bytesPerElement", + "id": "Stdlib.BigInt64Array.t", + "kind": "type", + "name": "t", + "docstrings": [ + "The `BigInt64Array` typed array represents an array of 64-bit signed integers in platform byte order. See [BigInt64Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt64Array)" + ], + "signature": "type t = TypedArray.t" + }, + { + "id": "Stdlib.BigInt64Array.fromArray", + "kind": "value", + "name": "fromArray", + "docstrings": [ + "`fromArray` creates a `BigInt64Array` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt64Array/BigInt64Array)" + ], + "signature": "let fromArray: array => t" + }, + { + "id": "Stdlib.BigInt64Array.fromBuffer", "kind": "value", - "name": "bytesPerElement", + "name": "fromBuffer", "docstrings": [ - "`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)" + "`fromBuffer` creates a `BigInt64Array` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt64Array/BigInt64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." ], - "signature": "let bytesPerElement: int" - } - ] - }, - "core/json/decode": { - "id": "Core.JSON.Decode", - "name": "Decode", - "docstrings": [], - "items": [ + "signature": "let fromBuffer: ArrayBuffer.t => t" + }, { - "id": "Core.JSON.Decode.bool", + "id": "Stdlib.BigInt64Array.fromBufferToEnd", "kind": "value", - "name": "bool", + "name": "fromBufferToEnd", "docstrings": [ - "Decodes a single JSON value. If the value is a bool, it will return `Some(bool)` - otherwise it will return `None`.\n\n ## Examples\n ```rescript\n JSON.parseExn(`true`)->JSON.Decode.bool\n // Some(true)\n\n JSON.parseExn(`\"hello world\"`)->JSON.Decode.bool\n // None\n ```" + "`fromBufferToEnd` creates a `BigInt64Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt64Array/BigInt64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." ], - "signature": "let bool: t => option" + "signature": "let fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t" }, { - "id": "Core.JSON.Decode.null", + "id": "Stdlib.BigInt64Array.fromBufferWithRange", "kind": "value", - "name": "null", + "name": "fromBufferWithRange", "docstrings": [ - "Decodes a single JSON value. If the value is null, it will return `Some(Null.t)` - otherwise it will return `None`.\n\n ## Examples\n ```rescript\n JSON.parseExn(`null`)->JSON.Decode.null\n // Some(null)\n\n JSON.parseExn(`\"hello world\"`)->JSON.Decode.null\n // None\n ```" + "`fromBufferWithRange` creates a `BigInt64Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt64Array/BigInt64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." ], - "signature": "let null: t => option>" + "signature": "let fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t" }, { - "id": "Core.JSON.Decode.string", + "id": "Stdlib.BigInt64Array.fromLength", "kind": "value", - "name": "string", + "name": "fromLength", "docstrings": [ - "Decodes a single JSON value. If the value is a string, it will return `Some(string)` - otherwise it will return `None`.\n\n ## Examples\n ```rescript\n JSON.parseExn(`\"hello world\"`)->JSON.Decode.string\n // Some(\"hello world\")\n\n JSON.parseExn(`42`)->JSON.Decode.string\n // None \n ```" + "`fromLength` creates a zero-initialized `BigInt64Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt64Array/BigInt64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." ], - "signature": "let string: t => option" + "signature": "let fromLength: int => t" }, { - "id": "Core.JSON.Decode.float", + "id": "Stdlib.BigInt64Array.fromArrayLikeOrIterable", "kind": "value", - "name": "float", + "name": "fromArrayLikeOrIterable", "docstrings": [ - "Decodes a single JSON value. If the value is a float, it will return `Some(float)` - otherwise it will return `None`.\n\n ## Examples\n ```rescript\n JSON.parseExn(`42.0`)->JSON.Decode.float\n // Some(42.0)\n\n JSON.parseExn(`\"hello world\"`)->JSON.Decode.float\n // None\n ```" + "`fromArrayLikeOrIterable` creates a `BigInt64Array` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" ], - "signature": "let float: t => option" + "signature": "let fromArrayLikeOrIterable: 'a => t" }, { - "id": "Core.JSON.Decode.object", + "id": "Stdlib.BigInt64Array.fromArrayLikeOrIterableWithMap", "kind": "value", - "name": "object", + "name": "fromArrayLikeOrIterableWithMap", "docstrings": [ - "Decodes a single JSON value. If the value is an object, it will return `Some(Dict.t)` - otherwise it will return `None`.\n\n ## Examples\n ```rescript\n JSON.parseExn(`{\"foo\":\"bar\"}`)->JSON.Decode.object\n // Some({ foo: 'bar' })\n\n JSON.parseExn(`\"hello world\"`)->JSON.Decode.object\n // None\n ```" + "`fromArrayLikeOrIterableWithMap` creates a `BigInt64Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" ], - "signature": "let object: t => option>" + "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => bigint) => t" }, { - "id": "Core.JSON.Decode.array", + "id": "Stdlib.BigInt64Array.ignore", "kind": "value", - "name": "array", + "name": "ignore", "docstrings": [ - "Decodes a single JSON value. If the value is an array, it will return `Some(array)` - otherwise it will return `None`.\n\n ## Examples\n ```rescript\n JSON.parseExn(`[\"foo\", \"bar\"]`)->JSON.Decode.array\n // Some([ 'foo', 'bar' ])\n\n JSON.parseExn(`\"hello world\"`)->JSON.Decode.array\n // None\n ```" + "`ignore(bigIntArray)` ignores the provided bigIntArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." ], - "signature": "let array: t => option>" + "signature": "let ignore: t => unit" } ] }, - "core/json/encode": { - "id": "Core.JSON.Encode", - "name": "Encode", + "stdlib/uint8clampedarray": { + "id": "Stdlib.Uint8ClampedArray", + "name": "Uint8ClampedArray", "docstrings": [], "items": [ { - "id": "Core.JSON.Encode.bool", - "kind": "value", - "name": "bool", + "id": "Stdlib.Uint8ClampedArray.t", + "kind": "type", + "name": "t", "docstrings": [ - "Returns a boolean as a JSON object.\n\n ## Examples\n ```rescript\n JSON.Encode.bool(true)\n ```" + "The `Uint8ClampedArray` typed array represents an array of 8-bit unsigned integers clamped to 0-255. See [Uint8ClampedArray on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray)" ], - "signature": "let bool: bool => t" + "signature": "type t = TypedArray.t" }, { - "id": "Core.JSON.Encode.null", + "id": "Stdlib.Uint8ClampedArray.fromArray", "kind": "value", - "name": "null", + "name": "fromArray", "docstrings": [ - "Returns null as a JSON object.\n\n ## Examples\n ```rescript\n JSON.Encode.null\n ```" + "`fromArray` creates a `Uint8ClampedArray` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray/Uint8ClampedArray)" ], - "signature": "let null: t" + "signature": "let fromArray: array => t" }, { - "id": "Core.JSON.Encode.string", + "id": "Stdlib.Uint8ClampedArray.fromBuffer", "kind": "value", - "name": "string", + "name": "fromBuffer", "docstrings": [ - "Returns a string as a JSON object.\n\n ## Examples\n ```rescript\n JSON.Encode.string(\"hello world\")\n ```" + "`fromBuffer` creates a `Uint8ClampedArray` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray/Uint8ClampedArray)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." ], - "signature": "let string: string => t" + "signature": "let fromBuffer: ArrayBuffer.t => t" }, { - "id": "Core.JSON.Encode.int", + "id": "Stdlib.Uint8ClampedArray.fromBufferToEnd", "kind": "value", - "name": "int", + "name": "fromBufferToEnd", "docstrings": [ - "Returns an int as a JSON object.\n\n ## Examples\n ```rescript\n JSON.Encode.int(42)\n ```" + "`fromBufferToEnd` creates a `Uint8ClampedArray` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray/Uint8ClampedArray)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." ], - "signature": "let int: int => t" + "signature": "let fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t" }, { - "id": "Core.JSON.Encode.float", + "id": "Stdlib.Uint8ClampedArray.fromBufferWithRange", "kind": "value", - "name": "float", + "name": "fromBufferWithRange", "docstrings": [ - "Returns a float as a JSON object.\n\n ## Examples\n ```rescript\n JSON.Encode.float(42.0)\n ```" + "`fromBufferWithRange` creates a `Uint8ClampedArray` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray/Uint8ClampedArray)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." ], - "signature": "let float: float => t" + "signature": "let fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t" }, { - "id": "Core.JSON.Encode.object", + "id": "Stdlib.Uint8ClampedArray.fromLength", "kind": "value", - "name": "object", + "name": "fromLength", "docstrings": [ - "Returns a dict as a JSON object.\n\n ## Examples\n ```rescript\n let dict = Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n ])\n\n JSON.Encode.object(dict)\n ```" + "`fromLength` creates a zero-initialized `Uint8ClampedArray` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray/Uint8ClampedArray)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." ], - "signature": "let object: Core__Dict.t => t" + "signature": "let fromLength: int => t" }, { - "id": "Core.JSON.Encode.array", + "id": "Stdlib.Uint8ClampedArray.fromArrayLikeOrIterable", "kind": "value", - "name": "array", + "name": "fromArrayLikeOrIterable", "docstrings": [ - "Returns an array as a JSON object.\n\n ## Examples\n ```rescript\n let array = [JSON.Encode.string(\"hello world\"), JSON.Encode.int(42)]\n\n JSON.Encode.array(array)\n ```" + "`fromArrayLikeOrIterable` creates a `Uint8ClampedArray` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" ], - "signature": "let array: array => t" - } - ] - }, - "core/json/classify": { - "id": "Core.JSON.Classify", - "name": "Classify", - "docstrings": [], - "items": [ + "signature": "let fromArrayLikeOrIterable: 'a => t" + }, { - "id": "Core.JSON.Classify.t", - "kind": "type", - "name": "t", + "id": "Stdlib.Uint8ClampedArray.fromArrayLikeOrIterableWithMap", + "kind": "value", + "name": "fromArrayLikeOrIterableWithMap", "docstrings": [ - "A type representing a JavaScript type." + "`fromArrayLikeOrIterableWithMap` creates a `Uint8ClampedArray` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" ], - "signature": "type t =\n | Bool(bool)\n | Null\n | String(string)\n | Number(float)\n | Object(Core__Dict.t)\n | Array(array)" + "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => int) => t" }, { - "id": "Core.JSON.Classify.classify", + "id": "Stdlib.Uint8ClampedArray.ignore", "kind": "value", - "name": "classify", + "name": "ignore", "docstrings": [ - "Returns the JSON type of any value.\n\n ## Examples\n ```rescript\n JSON.Classify.classify(\"hello world\")\n // String(\"hello world\")\n\n JSON.Classify.classify(42)\n // Number(42)\n ```" + "`ignore(uintArray)` ignores the provided uintArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." ], - "signature": "let classify: 'a => t" + "signature": "let ignore: t => unit" } ] }, - "core/type/classify": { - "id": "Core.Type.Classify", - "name": "Classify", + "stdlib/uint32array": { + "id": "Stdlib.Uint32Array", + "name": "Uint32Array", "docstrings": [], "items": [ { - "id": "Core.Type.Classify.function", - "kind": "type", - "name": "function", - "docstrings": [ - "An abstract type representing a JavaScript function.\n\n See [`function`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function) on MDN." - ], - "signature": "type function" - }, - { - "id": "Core.Type.Classify.object", - "kind": "type", - "name": "object", - "docstrings": [ - "An abstract type representing a JavaScript object.\n\n See [`object`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object) on MDN." - ], - "signature": "type object" - }, - { - "id": "Core.Type.Classify.t", + "id": "Stdlib.Uint32Array.t", "kind": "type", "name": "t", "docstrings": [ - "The type representing a classified JavaScript value." + "The `Uint32Array` typed array represents an array of 32-bit unsigned integers in platform byte order. See [Uint32Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array)" ], - "signature": "type t =\n | Bool(bool)\n | Null\n | Undefined\n | String(string)\n | Number(float)\n | Object(object)\n | Function(function)\n | Symbol(Core__Symbol.t)\n | BigInt(bigint)" + "signature": "type t = TypedArray.t" }, { - "id": "Core.Type.Classify.classify", + "id": "Stdlib.Uint32Array.fromArray", "kind": "value", - "name": "classify", - "docstrings": [ - "`classify(anyValue)`\nClassifies a JavaScript value.\n\n## Examples\n```rescript\nswitch %raw(`null`)->Type.Classify.classify {\n| Null => Console.log(\"Yup, that's null.\")\n| _ => Console.log(\"This doesn't actually appear to be null...\")\n}\n```" - ], - "signature": "let classify: 'a => t" - } - ] - }, - "core/regexp/result": { - "id": "Core.RegExp.Result", - "name": "Result", - "docstrings": [], - "items": [ - { - "id": "Core.RegExp.Result.t", - "kind": "type", - "name": "t", + "name": "fromArray", "docstrings": [ - "Type representing the result of a `RegExp` execution." + "`fromArray` creates a `Uint32Array` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array/Uint32Array)" ], - "signature": "type t = array>" + "signature": "let fromArray: array => t" }, { - "id": "Core.RegExp.Result.fullMatch", + "id": "Stdlib.Uint32Array.fromBuffer", "kind": "value", - "name": "fullMatch", + "name": "fromBuffer", "docstrings": [ - "`fullMatch(regExpResult)` returns the full string that matched in this result.\n\n ## Examples\n ```rescript\n // Match the first two words separated by a space\n let regexp = RegExp.fromString(\"(\\\\w+) (\\\\w+)\")\n\n switch regexp->RegExp.exec(\"ReScript is pretty cool, right?\") {\n | None => Console.log(\"Nope, no match...\")\n | Some(result) => Console.log(result->RegExp.Result.fullMatch) // Prints the full string that matched, \"ReScript is\"\n }\n ```" + "`fromBuffer` creates a `Uint32Array` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array/Uint32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." ], - "signature": "let fullMatch: t => string" + "signature": "let fromBuffer: ArrayBuffer.t => t" }, { - "id": "Core.RegExp.Result.matches", + "id": "Stdlib.Uint32Array.fromBufferToEnd", "kind": "value", - "name": "matches", + "name": "fromBufferToEnd", "docstrings": [ - "`matches(regExpResult)` returns all matches for `regExpResult`.\n\n ## Examples\n ```rescript\n // Match the first two words separated by a space\n let regexp = RegExp.fromString(\"(\\\\w+) (\\\\w+)\")\n\n // This below will log \"ReScript\" and \"is\" to the console.\n switch regexp->RegExp.exec(\"ReScript is pretty cool, right?\") {\n | None => Console.log(\"Nope, no match...\")\n | Some(result) => switch result->RegExp.Result.matches {\n | [firstWord, secondWord] => Console.log2(firstWord, secondWord)\n | _ => Console.log(\"Didn't find exactly two words...\")\n }\n }\n ```" + "`fromBufferToEnd` creates a `Uint32Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array/Uint32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." ], - "signature": "let matches: t => array" + "signature": "let fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t" }, { - "id": "Core.RegExp.Result.index", + "id": "Stdlib.Uint32Array.fromBufferWithRange", "kind": "value", - "name": "index", - "docstrings": [], - "signature": "let index: t => int" + "name": "fromBufferWithRange", + "docstrings": [ + "`fromBufferWithRange` creates a `Uint32Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array/Uint32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." + ], + "signature": "let fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t" }, { - "id": "Core.RegExp.Result.input", + "id": "Stdlib.Uint32Array.fromLength", "kind": "value", - "name": "input", + "name": "fromLength", "docstrings": [ - "`input(regExpResult)` returns the full input string that was passed to what produced the `RegExp.Result.t`.\n\n ## Examples\n ```rescript\n // Match the first two words separated by a space\n let regexp = RegExp.fromString(\"(\\\\w+) (\\\\w+)\")\n\n // This below will log the full input string \"ReScript is pretty cool, right?\" to the console.\n switch regexp->RegExp.exec(\"ReScript is pretty cool, right?\") {\n | None => Console.log(\"Nope, no match...\")\n | Some(result) => Console.log(result->RegExp.Result.input)\n }\n ```" + "`fromLength` creates a zero-initialized `Uint32Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array/Uint32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." ], - "signature": "let input: t => string" - } - ] - }, - "core/math/int": { - "id": "Core.Math.Int", - "name": "Int", - "docstrings": [ - "Provide Math utilities for `int`" - ], - "items": [ + "signature": "let fromLength: int => t" + }, { - "id": "Core.Math.Int.abs", + "id": "Stdlib.Uint32Array.fromArrayLikeOrIterable", "kind": "value", - "name": "abs", + "name": "fromArrayLikeOrIterable", "docstrings": [ - "`abs(v)` returns absolute value of `v`.\n See [`Math.abs`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/abs) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Int.abs(-2) // 2\n Math.Int.abs(3) // 3\n ```" + "`fromArrayLikeOrIterable` creates a `Uint32Array` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" ], - "signature": "let abs: int => int" + "signature": "let fromArrayLikeOrIterable: 'a => t" }, { - "id": "Core.Math.Int.clz32", + "id": "Stdlib.Uint32Array.fromArrayLikeOrIterableWithMap", "kind": "value", - "name": "clz32", + "name": "fromArrayLikeOrIterableWithMap", "docstrings": [ - "`clz32(v)` returns the number of leading zero bits of the argument's 32 bit\n int representation.\n See [`Math.clz32`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/clz32) on MDN.\n\n ## Examples\n\n ```rescript\n // 00000000000000000000000000000001\n Math.Int.clz32(1) // 31\n // 00000000000000000000000000000100\n Math.Int.clz32(4) // 29\n ```" + "`fromArrayLikeOrIterableWithMap` creates a `Uint32Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" ], - "signature": "let clz32: int => int" + "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => int) => t" }, { - "id": "Core.Math.Int.imul", + "id": "Stdlib.Uint32Array.ignore", "kind": "value", - "name": "imul", + "name": "ignore", "docstrings": [ - "`imul(a, b)` returns 32-bit integer multiplication. Use this only when you\n need to optimize performance of multiplication of numbers stored as 32-bit\n integers.\n See [`Math.imul`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/imul) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Int.imul(3, 4) // 12\n Math.Int.imul(-5, 12) // 60\n ```" + "`ignore(uintArray)` ignores the provided uintArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." ], - "signature": "let imul: (int, int) => int" - }, + "signature": "let ignore: t => unit" + } + ] + }, + "stdlib/uint16array": { + "id": "Stdlib.Uint16Array", + "name": "Uint16Array", + "docstrings": [], + "items": [ { - "id": "Core.Math.Int.min", - "kind": "value", - "name": "min", + "id": "Stdlib.Uint16Array.t", + "kind": "type", + "name": "t", "docstrings": [ - "`min(a, b)` returns the minimum of its two integer arguments.\n See [`Math.min`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/min) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Int.min(1, 2) // 1\n Math.Int.min(-1, -2) // -2\n ```" + "The `Uint16Array` typed array represents an array of 16-bit unsigned integers in platform byte order. See [Uint16Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array)" ], - "signature": "let min: (int, int) => int" + "signature": "type t = TypedArray.t" }, { - "id": "Core.Math.Int.minMany", + "id": "Stdlib.Uint16Array.fromArray", "kind": "value", - "name": "minMany", + "name": "fromArray", "docstrings": [ - "`minMany(arr)` returns the minimum of the integers in the given array `arr`.\n Returns `Infinity` if `arr` is empty.\n See [`Math.min`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/min) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Int.minMany([1, 2]) // 1\n Math.Int.minMany([-1, -2]) // -2\n Math.Int.minMany([])->Int.toFloat->Float.isFinite // false\n ```" + "`fromArray` creates a `Uint16Array` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array/Uint16Array)" ], - "signature": "let minMany: array => int" + "signature": "let fromArray: array => t" }, { - "id": "Core.Math.Int.max", + "id": "Stdlib.Uint16Array.fromBuffer", "kind": "value", - "name": "max", + "name": "fromBuffer", "docstrings": [ - "`max(a, b)` returns the maximum of its two integer arguments.\n See [`Math.max`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/max) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Int.max(1, 2) // 2\n Math.Int.max(-1, -2) // -1\n ```" + "`fromBuffer` creates a `Uint16Array` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array/Uint16Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." ], - "signature": "let max: (int, int) => int" + "signature": "let fromBuffer: ArrayBuffer.t => t" }, { - "id": "Core.Math.Int.maxMany", + "id": "Stdlib.Uint16Array.fromBufferToEnd", "kind": "value", - "name": "maxMany", + "name": "fromBufferToEnd", "docstrings": [ - "`maxMany(arr)` returns the maximum of the integers in the given array `arr`.\n Returns `Infinity` if `arr` is empty.\n See [`Math.max`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/max) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Int.maxMany([1, 2]) // 2\n Math.Int.maxMany([-1, -2]) // -1\n Math.Int.maxMany([])->Int.toFloat->Float.isFinite // false\n ```" + "`fromBufferToEnd` creates a `Uint16Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array/Uint16Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." ], - "signature": "let maxMany: array => int" + "signature": "let fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t" }, { - "id": "Core.Math.Int.pow", + "id": "Stdlib.Uint16Array.fromBufferWithRange", "kind": "value", - "name": "pow", + "name": "fromBufferWithRange", "docstrings": [ - "`pow(a, ~exp)` raises the given base `a` to the given exponent `exp`.\n See [`Math.pow`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/pow) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Int.pow(2, ~exp=4) // 16\n Math.Int.pow(3, ~exp=4) // 81\n ```" + "`fromBufferWithRange` creates a `Uint16Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array/Uint16Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." ], - "signature": "let pow: (int, ~exp: int) => int" + "signature": "let fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t" }, { - "id": "Core.Math.Int.sign", + "id": "Stdlib.Uint16Array.fromLength", "kind": "value", - "name": "sign", + "name": "fromLength", "docstrings": [ - "`sign(v)` returns the sign of its integer argument: `-1` if negative, `0` if\n zero, `1` if positive.\n See [`Math.sign`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sign) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Int.sign(3) // 1\n Math.Int.sign(-3) // 1\n Math.Int.sign(0) // 0\n ```" + "`fromLength` creates a zero-initialized `Uint16Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array/Uint16Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." ], - "signature": "let sign: int => int" + "signature": "let fromLength: int => t" }, { - "id": "Core.Math.Int.floor", + "id": "Stdlib.Uint16Array.fromArrayLikeOrIterable", "kind": "value", - "name": "floor", + "name": "fromArrayLikeOrIterable", "docstrings": [ - "floor(v) returns the largest `int` less than or equal to the argument; \n See [`Math.floor`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/floor)\n on MDN.\n\n ## Examples\n\n ```rescript\n Math.Int.floor(3.7) == 3\n Math.Int.floor(3.0) == 3\n Math.Int.floor(-3.1) == -4\n ```" + "`fromArrayLikeOrIterable` creates a `Uint16Array` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" ], - "signature": "let floor: float => int" + "signature": "let fromArrayLikeOrIterable: 'a => t" }, { - "id": "Core.Math.Int.ceil", + "id": "Stdlib.Uint16Array.fromArrayLikeOrIterableWithMap", "kind": "value", - "name": "ceil", + "name": "fromArrayLikeOrIterableWithMap", "docstrings": [ - "ceil(v) returns the smallest `int` greater than or equal to the argument;\n See [`Math.floor`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/floor)\n on MDN.\n\n ## Examples\n\n ```rescript\n Math.Int.ceil(3.7) == 4\n Math.Int.ceil(3.0) == 3\n Math.Int.ceil(-3.1) == -3\n ```" + "`fromArrayLikeOrIterableWithMap` creates a `Uint16Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" ], - "signature": "let ceil: float => int" + "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => int) => t" }, { - "id": "Core.Math.Int.random", + "id": "Stdlib.Uint16Array.ignore", "kind": "value", - "name": "random", + "name": "ignore", "docstrings": [ - "`random(minVal, maxVal)` returns a random integer number in the half-closed interval [minVal, maxVal).\n See [`Math.random`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random)\n on MDN.\n\n ## Examples\n\n ```rescript\n Math.Int.random(2, 5) == 4\n Math.Int.random(505, 2000) == 1276\n Math.Int.random(-7, -2) == -4\n ```" + "`ignore(uintArray)` ignores the provided uintArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." ], - "signature": "let random: (int, int) => int" + "signature": "let ignore: t => unit" } ] }, - "core/math/constants": { - "id": "Core.Math.Constants", - "name": "Constants", - "docstrings": [ - "Mathematical Constants" - ], + "stdlib/uint8array": { + "id": "Stdlib.Uint8Array", + "name": "Uint8Array", + "docstrings": [], "items": [ { - "id": "Core.Math.Constants.e", - "kind": "value", - "name": "e", - "docstrings": [ - "`Math.Constants.e` returns Euler's number, ≈ 2.718281828459045.\n See [`Math.E`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/E) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Constants.e\n ```" - ], - "signature": "let e: float" - }, - { - "id": "Core.Math.Constants.ln2", - "kind": "value", - "name": "ln2", + "id": "Stdlib.Uint8Array.t", + "kind": "type", + "name": "t", "docstrings": [ - "`Math.Constants.ln2` returns Natural logarithm of 2, ≈ 0.6931471805599453.\n See [`Math.LN2`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/LN2) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Constants.ln2\n ```" + "The `Uint8Array` typed array represents an array of 8-bit unsigned integers. See [Uint8Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array)" ], - "signature": "let ln2: float" + "signature": "type t = TypedArray.t" }, { - "id": "Core.Math.Constants.ln10", + "id": "Stdlib.Uint8Array.fromArray", "kind": "value", - "name": "ln10", + "name": "fromArray", "docstrings": [ - "`Math.Constants.ln10` returns Natural logarithm of 10, ≈ 2.302585092994046.\n See [`Math.LN10`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/LN10) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Constants.ln10\n ```" + "`fromArray` creates a `Uint8Array` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array/Uint8Array)" ], - "signature": "let ln10: float" + "signature": "let fromArray: array => t" }, { - "id": "Core.Math.Constants.log2e", + "id": "Stdlib.Uint8Array.fromBuffer", "kind": "value", - "name": "log2e", + "name": "fromBuffer", "docstrings": [ - "`Math.Constants.log2e` returns Base 2 logarithm of E, ≈ 1.4426950408889634.\n See [`Math.LOG2E`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/LOG2E) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Constants.log2e\n ```" + "`fromBuffer` creates a `Uint8Array` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array/Uint8Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." ], - "signature": "let log2e: float" + "signature": "let fromBuffer: ArrayBuffer.t => t" }, { - "id": "Core.Math.Constants.log10e", + "id": "Stdlib.Uint8Array.fromBufferToEnd", "kind": "value", - "name": "log10e", + "name": "fromBufferToEnd", "docstrings": [ - "`Math.Constants.log10e` returns Base 10 logarithm of E, ≈ 0.4342944819032518.\n See [`Math.LOG10E`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/LOG10E) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Constants.log10e\n ```" + "`fromBufferToEnd` creates a `Uint8Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array/Uint8Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." ], - "signature": "let log10e: float" + "signature": "let fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t" }, { - "id": "Core.Math.Constants.pi", + "id": "Stdlib.Uint8Array.fromBufferWithRange", "kind": "value", - "name": "pi", + "name": "fromBufferWithRange", "docstrings": [ - "`Math.Constants.pi` returns Pi - ratio of the circumference to the diameter\n of a circle, ≈ 3.141592653589793.\n See [`Math.PI`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/PI) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Constants.pi\n ```" + "`fromBufferWithRange` creates a `Uint8Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array/Uint8Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." ], - "signature": "let pi: float" + "signature": "let fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t" }, { - "id": "Core.Math.Constants.sqrt1_2", + "id": "Stdlib.Uint8Array.fromLength", "kind": "value", - "name": "sqrt1_2", + "name": "fromLength", "docstrings": [ - "`Math.Constants.sqrt1_2` returns Square root of 1/2, ≈ 0.7071067811865476.\n See [`Math.SQRT1_2`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/SQRT1_2) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Constants.sqrt1_2\n ```" + "`fromLength` creates a zero-initialized `Uint8Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array/Uint8Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." ], - "signature": "let sqrt1_2: float" + "signature": "let fromLength: int => t" }, { - "id": "Core.Math.Constants.sqrt2", + "id": "Stdlib.Uint8Array.fromArrayLikeOrIterable", "kind": "value", - "name": "sqrt2", + "name": "fromArrayLikeOrIterable", "docstrings": [ - "`Math.Constants.e` returns Absolute value for integer argument.\n See [`Math.abs`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/abs) on MDN.\n\n ## Examples\n\n ```rescript\n Math.Constants.sqrt2\n ```" + "`fromArrayLikeOrIterable` creates a `Uint8Array` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" ], - "signature": "let sqrt2: float" - } - ] - }, - "core/int/constants": { - "id": "Core.Int.Constants", - "name": "Constants", - "docstrings": [], - "items": [ + "signature": "let fromArrayLikeOrIterable: 'a => t" + }, { - "id": "Core.Int.Constants.minValue", + "id": "Stdlib.Uint8Array.fromArrayLikeOrIterableWithMap", "kind": "value", - "name": "minValue", + "name": "fromArrayLikeOrIterableWithMap", "docstrings": [ - "The smallest positive number represented in JavaScript.\n See [`Number.MIN_VALUE`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MIN_VALUE)\n on MDN.\n\n ## Examples\n\n ```rescript\n Console.log(Int.Constants.minValue)\n ```" + "`fromArrayLikeOrIterableWithMap` creates a `Uint8Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" ], - "signature": "let minValue: int" + "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => int) => t" }, { - "id": "Core.Int.Constants.maxValue", + "id": "Stdlib.Uint8Array.ignore", "kind": "value", - "name": "maxValue", + "name": "ignore", "docstrings": [ - "The largest positive number represented in JavaScript.\n See [`Number.MAX_VALUE`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_VALUE)\n on MDN.\n\n ## Examples\n\n ```rescript\n Console.log(Int.Constants.maxValue)\n ```" + "`ignore(uintArray)` ignores the provided uintArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." ], - "signature": "let maxValue: int" + "signature": "let ignore: t => unit" } ] }, - "core/float/constants": { - "id": "Core.Float.Constants", - "name": "Constants", - "docstrings": [ - "Float constants." - ], + "stdlib/int32array": { + "id": "Stdlib.Int32Array", + "name": "Int32Array", + "docstrings": [], "items": [ { - "id": "Core.Float.Constants.nan", - "kind": "value", - "name": "nan", + "id": "Stdlib.Int32Array.t", + "kind": "type", + "name": "t", "docstrings": [ - "The special value \"Not a Number\"\n See [`NaN`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NaN) on MDN.\n\n ## Examples\n\n ```rescript\n Float.Constants.nan\n ```" + "The `Int32Array` typed array represents an array of twos-complemenet 32-bit signed integers in platform byte order. See [Int32Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array)" ], - "signature": "let nan: float" + "signature": "type t = TypedArray.t" }, { - "id": "Core.Float.Constants.epsilon", + "id": "Stdlib.Int32Array.fromArray", "kind": "value", - "name": "epsilon", + "name": "fromArray", "docstrings": [ - "Represents the difference between 1 and the smallest floating point number greater than 1.\n See [`Number.EPSILON`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/EPSILON) on MDN.\n\n ## Examples\n\n ```rescript\n Float.Constants.epsilon\n ```" + "`fromArray` creates a `Int32Array` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array/Int32Array)" ], - "signature": "let epsilon: float" + "signature": "let fromArray: array => t" }, { - "id": "Core.Float.Constants.positiveInfinity", + "id": "Stdlib.Int32Array.fromBuffer", "kind": "value", - "name": "positiveInfinity", + "name": "fromBuffer", "docstrings": [ - "The positive Infinity value\n See [`Number.POSITIVE_INFINITY`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/POSITIVE_INFINITY) on MDN.\n\n ## Examples\n\n ```rescript\n Float.Constants.positiveInfinity\n ```" + "`fromBuffer` creates a `Int32Array` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array/Int32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." ], - "signature": "let positiveInfinity: float" + "signature": "let fromBuffer: ArrayBuffer.t => t" }, { - "id": "Core.Float.Constants.negativeInfinity", + "id": "Stdlib.Int32Array.fromBufferToEnd", "kind": "value", - "name": "negativeInfinity", + "name": "fromBufferToEnd", "docstrings": [ - "The negative Infinity value\n See [`Number.NEGATIVE_INFINITY`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/NEGATIVE_INFINITY) on MDN.\n\n ## Examples\n\n ```rescript\n Float.Constants.negativeInfinity\n ```" + "`fromBufferToEnd` creates a `Int32Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array/Int32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." ], - "signature": "let negativeInfinity: float" + "signature": "let fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t" }, { - "id": "Core.Float.Constants.minValue", + "id": "Stdlib.Int32Array.fromBufferWithRange", "kind": "value", - "name": "minValue", + "name": "fromBufferWithRange", "docstrings": [ - "The smallest positive numeric value representable in JavaScript.\n See [`Number.MIN_VALUE`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MIN_VALUE) on MDN.\n\n ## Examples\n\n ```rescript\n Float.Constants.minValue\n ```" + "`fromBufferWithRange` creates a `Int32Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array/Int32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." ], - "signature": "let minValue: float" + "signature": "let fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t" }, { - "id": "Core.Float.Constants.maxValue", + "id": "Stdlib.Int32Array.fromLength", "kind": "value", - "name": "maxValue", + "name": "fromLength", "docstrings": [ - "The maximum positive numeric value representable in JavaScript.\n See [`Number.MAX_VALUE`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_VALUE) on MDN.\n\n ## Examples\n\n ```rescript\n Float.Constants.minValue\n ```" + "`fromLength` creates a zero-initialized `Int32Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array/Int32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." ], - "signature": "let maxValue: float" - } - ] - }, - "core/error/urierror": { - "id": "Core.Error.URIError", - "name": "URIError", - "docstrings": [], - "items": [ + "signature": "let fromLength: int => t" + }, { - "id": "Core.Error.URIError.make", + "id": "Stdlib.Int32Array.fromArrayLikeOrIterable", "kind": "value", - "name": "make", + "name": "fromArrayLikeOrIterable", "docstrings": [ - "Creates a new `URIError` with the provided `message`.\n\n See [`URIError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/URIError) on MDN." + "`fromArrayLikeOrIterable` creates a `Int32Array` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" ], - "signature": "let make: string => t" - } - ] - }, - "core/error/typeerror": { - "id": "Core.Error.TypeError", - "name": "TypeError", - "docstrings": [], - "items": [ + "signature": "let fromArrayLikeOrIterable: 'a => t" + }, { - "id": "Core.Error.TypeError.make", + "id": "Stdlib.Int32Array.fromArrayLikeOrIterableWithMap", "kind": "value", - "name": "make", + "name": "fromArrayLikeOrIterableWithMap", "docstrings": [ - "Creates a new `TypeError` with the provided `message`.\n\n See [`TypeError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError) on MDN." + "`fromArrayLikeOrIterableWithMap` creates a `Int32Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" ], - "signature": "let make: string => t" - } - ] - }, - "core/error/syntaxerror": { - "id": "Core.Error.SyntaxError", - "name": "SyntaxError", - "docstrings": [], - "items": [ + "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => int) => t" + }, { - "id": "Core.Error.SyntaxError.make", + "id": "Stdlib.Int32Array.ignore", "kind": "value", - "name": "make", + "name": "ignore", "docstrings": [ - "Creates a new `SyntaxError` with the provided `message`.\n\n See [`SyntaxError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SyntaxError) on MDN." + "`ignore(intArray)` ignores the provided intArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." ], - "signature": "let make: string => t" + "signature": "let ignore: t => unit" } ] }, - "core/error/referenceerror": { - "id": "Core.Error.ReferenceError", - "name": "ReferenceError", + "stdlib/int16array": { + "id": "Stdlib.Int16Array", + "name": "Int16Array", "docstrings": [], "items": [ { - "id": "Core.Error.ReferenceError.make", - "kind": "value", - "name": "make", + "id": "Stdlib.Int16Array.t", + "kind": "type", + "name": "t", "docstrings": [ - "Creates a new `ReferenceError` with the provided `message`.\n\n See [`ReferenceError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ReferenceError) on MDN." + "The `Int16Array` typed array represents an array of twos-complement 16-bit signed integers in platform byte order. See [Int16Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array)" ], - "signature": "let make: string => t" - } - ] - }, - "core/error/rangeerror": { - "id": "Core.Error.RangeError", - "name": "RangeError", - "docstrings": [], - "items": [ + "signature": "type t = TypedArray.t" + }, { - "id": "Core.Error.RangeError.make", + "id": "Stdlib.Int16Array.fromArray", "kind": "value", - "name": "make", + "name": "fromArray", "docstrings": [ - "Creates a new `RangeError` with the provided `message`.\n\n See [`RangeError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RangeError) on MDN." + "`fromArray` creates a `Int16Array` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array/Int16Array)" ], - "signature": "let make: string => t" - } - ] - }, - "core/error/evalerror": { - "id": "Core.Error.EvalError", - "name": "EvalError", - "docstrings": [], - "items": [ + "signature": "let fromArray: array => t" + }, { - "id": "Core.Error.EvalError.make", + "id": "Stdlib.Int16Array.fromBuffer", "kind": "value", - "name": "make", + "name": "fromBuffer", "docstrings": [ - "Creates a new `EvalError` with the provided `message`.\n\n See [`EvalError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/EvalError) on MDN." + "`fromBuffer` creates a `Int16Array` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array/Int16Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." ], - "signature": "let make: string => t" - } - ] - }, - "core/date/utc": { - "id": "Core.Date.UTC", - "name": "UTC", - "docstrings": [], - "items": [ + "signature": "let fromBuffer: ArrayBuffer.t => t" + }, { - "id": "Core.Date.UTC.makeWithYM", + "id": "Stdlib.Int16Array.fromBufferToEnd", "kind": "value", - "name": "makeWithYM", + "name": "fromBufferToEnd", "docstrings": [ - "Returns the time, in milliseconds, since UNIX epoch (January 1, 1970 00:00:00 UTC).\n Be aware of using a value for year < 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#interpretation_of_two-digit_years).\n Months are 0-indexed (0 = January, 11 = December).\n Values, which are out of range, will be carried over to the next bigger unit (s. example).\n\n ## Examples\n ```rescript\n Date.UTC.makeWithYM(~year=2023, ~month=0)\n // 1672531200000\n\n Date.UTC.makeWithYM(~year=2023, ~month=11)\n // 1701388800000\n\n Date.UTC.makeWithYM(~year=2023, ~month=12)\n // 1704067200000\n\n Date.UTC.makeWithYM(~year=2023, ~month=-1)\n // 1669852800000\n ```" + "`fromBufferToEnd` creates a `Int16Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array/Int16Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." ], - "signature": "let makeWithYM: (~year: int, ~month: int) => msSinceEpoch" + "signature": "let fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t" }, { - "id": "Core.Date.UTC.makeWithYMD", + "id": "Stdlib.Int16Array.fromBufferWithRange", "kind": "value", - "name": "makeWithYMD", + "name": "fromBufferWithRange", "docstrings": [ - "Returns the time, in milliseconds, since UNIX epoch (January 1, 1970 00:00:00 UTC).\n Be aware of using a value for year < 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#interpretation_of_two-digit_years).\n Months are 0-indexed (0 = January, 11 = December).\n Values, which are out of range, will be carried over to the next bigger unit (s. example).\n\n ## Examples\n ```rescript\n Date.UTC.makeWithYMD(~year=2023, ~month=1, ~date=20)\n // 1676851200000\n\n Date.UTC.makeWithYMD(~year=2023, ~month=1, ~date=-1)\n // 1675036800000\n\n Date.UTC.makeWithYMD(~year=2023, ~month=1, ~date=29)\n // 1677628800000\n ```" + "`fromBufferWithRange` creates a `Int16Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array/Int16Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." ], - "signature": "let makeWithYMD: (~year: int, ~month: int, ~date: int) => msSinceEpoch" + "signature": "let fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t" }, { - "id": "Core.Date.UTC.makeWithYMDH", + "id": "Stdlib.Int16Array.fromLength", "kind": "value", - "name": "makeWithYMDH", + "name": "fromLength", "docstrings": [ - "Returns the time, in milliseconds, since UNIX epoch (January 1, 1970 00:00:00 UTC).\n Be aware of using a value for year < 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#interpretation_of_two-digit_years).\n Months are 0-indexed (0 = January, 11 = December).\n Values, which are out of range, will be carried over to the next bigger unit (s. example).\n\n ## Examples\n ```rescript\n Date.UTC.makeWithYMDH(~year=2023, ~month=1, ~date=20, ~hours=16)\n // 1676908800000\n\n Date.UTC.makeWithYMDH(~year=2023, ~month=1, ~date=20, ~hours=24)\n // 1676937600000\n\n Date.UTC.makeWithYMDH(~year=2023, ~month=1, ~date=20, ~hours=-1)\n // 1676847600000\n ```" + "`fromLength` creates a zero-initialized `Int16Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array/Int16Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." ], - "signature": "let makeWithYMDH: (\n ~year: int,\n ~month: int,\n ~date: int,\n ~hours: int,\n) => msSinceEpoch" + "signature": "let fromLength: int => t" }, { - "id": "Core.Date.UTC.makeWithYMDHM", + "id": "Stdlib.Int16Array.fromArrayLikeOrIterable", "kind": "value", - "name": "makeWithYMDHM", + "name": "fromArrayLikeOrIterable", "docstrings": [ - "Returns the time, in milliseconds, since UNIX epoch (January 1, 1970 00:00:00 UTC).\n Be aware of using a value for year < 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#interpretation_of_two-digit_years).\n Months are 0-indexed (0 = January, 11 = December).\n Values, which are out of range, will be carried over to the next bigger unit (s. example).\n\n ## Examples\n ```rescript\n Date.UTC.makeWithYMDHM(~year=2023, ~month=1, ~date=20, ~hours=16, ~minutes=40)\n // 1676911200000\n\n Date.UTC.makeWithYMDHM(~year=2023, ~month=1, ~date=20, ~hours=16, ~minutes=60)\n // 1676912400000\n\n Date.UTC.makeWithYMDHM(~year=2023, ~month=1, ~date=20, ~hours=16, ~minutes=-1)\n // 1676908740000\n ```" + "`fromArrayLikeOrIterable` creates a `Int16Array` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" ], - "signature": "let makeWithYMDHM: (\n ~year: int,\n ~month: int,\n ~date: int,\n ~hours: int,\n ~minutes: int,\n) => msSinceEpoch" + "signature": "let fromArrayLikeOrIterable: 'a => t" }, { - "id": "Core.Date.UTC.makeWithYMDHMS", + "id": "Stdlib.Int16Array.fromArrayLikeOrIterableWithMap", "kind": "value", - "name": "makeWithYMDHMS", + "name": "fromArrayLikeOrIterableWithMap", "docstrings": [ - "Returns the time, in milliseconds, since UNIX epoch (January 1, 1970 00:00:00 UTC).\n Be aware of using a value for year < 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#interpretation_of_two-digit_years).\n Months are 0-indexed (0 = January, 11 = December).\n Values, which are out of range, will be carried over to the next bigger unit (s. example).\n\n ## Examples\n ```rescript\n Date.UTC.makeWithYMDHMS(~year=2023, ~month=1, ~date=20, ~hours=16, ~minutes=40, ~seconds=0)\n // 1676911200000\n\n Date.UTC.makeWithYMDHMS(~year=2023, ~month=1, ~date=20, ~hours=16, ~minutes=40, ~seconds=60)\n // 1676911260000\n\n Date.UTC.makeWithYMDHMS(~year=2023, ~month=1, ~date=20, ~hours=16, ~minutes=40, ~seconds=-1)\n // 1676911199000\n ```" + "`fromArrayLikeOrIterableWithMap` creates a `Int16Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" ], - "signature": "let makeWithYMDHMS: (\n ~year: int,\n ~month: int,\n ~date: int,\n ~hours: int,\n ~minutes: int,\n ~seconds: int,\n) => msSinceEpoch" + "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => int) => t" }, { - "id": "Core.Date.UTC.makeWithYMDHMSM", + "id": "Stdlib.Int16Array.ignore", "kind": "value", - "name": "makeWithYMDHMSM", + "name": "ignore", "docstrings": [ - "Returns the time, in milliseconds, since UNIX epoch (January 1, 1970 00:00:00 UTC).\n Be aware of using a value for year < 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#interpretation_of_two-digit_years).\n Months are 0-indexed (0 = January, 11 = December).\n Values, which are out of range, will be carried over to the next bigger unit (s. example).\n\n ## Examples\n ```rescript\n Date.UTC.makeWithYMDHMSM(~year=2023, ~month=1, ~date=20, ~hours=16, ~minutes=40, ~seconds=0, ~milliseconds=0)->Console.log\n // 1676911200000\n\n Date.UTC.makeWithYMDHMSM(~year=2023, ~month=1, ~date=20, ~hours=16, ~minutes=40, ~seconds=0, ~milliseconds=1000)->Console.log\n // 1676911201000\n\n Date.UTC.makeWithYMDHMSM(~year=2023, ~month=1, ~date=20, ~hours=16, ~minutes=40, ~seconds=0, ~milliseconds=-1)->Console.log\n // 1676911199999\n ```" + "`ignore(intArray)` ignores the provided intArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." ], - "signature": "let makeWithYMDHMSM: (\n ~year: int,\n ~month: int,\n ~date: int,\n ~hours: int,\n ~minutes: int,\n ~seconds: int,\n ~milliseconds: int,\n) => msSinceEpoch" + "signature": "let ignore: t => unit" } ] }, - "core/result": { - "id": "Core.Result", - "name": "Result", + "stdlib/int8array": { + "id": "Stdlib.Int8Array", + "name": "Int8Array", "docstrings": [], "items": [ { - "id": "Core.Result.getExn", - "kind": "value", - "name": "getExn", - "docstrings": [ - "Result types are really useful to describe the result of a certain operation\n without relying on exceptions or `option` types.\n\n This module gives you useful utilities to create and combine `Result` data." - ], - "signature": "let getExn: result<'a, 'b> => 'a" - }, - { - "id": "Core.Result.mapOr", - "kind": "value", - "name": "mapOr", - "docstrings": [ - "`mapOr(res, default, f)`: When res is `Ok(n)`, returns `f(n)`, otherwise `default`.\n\n## Examples\n\n```rescript\nlet ok = Ok(42)\nResult.mapOr(ok, 0, (x) => x / 2) == 21\n\nlet error = Error(\"Invalid data\")\nResult.mapOr(error, 0, (x) => x / 2) == 0\n```" - ], - "signature": "let mapOr: (result<'a, 'c>, 'b, 'a => 'b) => 'b" - }, - { - "id": "Core.Result.mapWithDefault", - "kind": "value", - "name": "mapWithDefault", - "docstrings": [], - "signature": "let mapWithDefault: (result<'a, 'c>, 'b, 'a => 'b) => 'b", - "deprecated": "Use mapOr instead" - }, - { - "id": "Core.Result.map", - "kind": "value", - "name": "map", + "id": "Stdlib.Int8Array.t", + "kind": "type", + "name": "t", "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(Int.toFloat(x))\n\nResult.map(Ok(64), f) == Ok(8.0)\n\nResult.map(Error(\"Invalid data\"), f) == Error(\"Invalid data\")\n```" + "The `Int8Array` typed array represents an array of twos-complement 8-bit signed integers. See [Int8Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array)" ], - "signature": "let map: (result<'a, 'c>, 'a => 'b) => result<'b, 'c>" + "signature": "type t = TypedArray.t" }, { - "id": "Core.Result.flatMap", + "id": "Stdlib.Int8Array.fromArray", "kind": "value", - "name": "flatMap", + "name": "fromArray", "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`Result`.\n\n## Examples\n\n```rescript\nlet recip = (x) =>\n if (x !== 0.0) {\n Ok(1.0 /. x)\n } else {\n Error(\"Divide by zero\")\n }\n\nResult.flatMap(Ok(2.0), recip) == Ok(0.5)\n\nResult.flatMap(Ok(0.0), recip) == Error(\"Divide by zero\")\n\nResult.flatMap(Error(\"Already bad\"), recip) == Error(\"Already bad\")\n```" + "`fromArray` creates a `Int8Array` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array/Int8Array)" ], - "signature": "let flatMap: (result<'a, 'c>, 'a => result<'b, 'c>) => result<'b, 'c>" + "signature": "let fromArray: array => t" }, { - "id": "Core.Result.getOr", + "id": "Stdlib.Int8Array.fromBuffer", "kind": "value", - "name": "getOr", + "name": "fromBuffer", "docstrings": [ - "`getOr(res, defaultValue)`: If `res` is `Ok(n)`, returns `n`, otherwise `default`\n\n## Examples\n\n```rescript\nResult.getOr(Ok(42), 0) == 42\n\nResult.getOr(Error(\"Invalid Data\"), 0) == 0\n```" + "`fromBuffer` creates a `Int8Array` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array/Int8Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." ], - "signature": "let getOr: (result<'a, 'b>, 'a) => 'a" - }, - { - "id": "Core.Result.getWithDefault", - "kind": "value", - "name": "getWithDefault", - "docstrings": [], - "signature": "let getWithDefault: (result<'a, 'b>, 'a) => 'a", - "deprecated": "Use getOr instead" + "signature": "let fromBuffer: ArrayBuffer.t => t" }, { - "id": "Core.Result.isOk", + "id": "Stdlib.Int8Array.fromBufferToEnd", "kind": "value", - "name": "isOk", + "name": "fromBufferToEnd", "docstrings": [ - "`isOk(res)`: Returns `true` if `res` is of the form `Ok(n)`, `false` if it is the `Error(e)` variant." + "`fromBufferToEnd` creates a `Int8Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array/Int8Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." ], - "signature": "let isOk: result<'a, 'b> => bool" + "signature": "let fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t" }, { - "id": "Core.Result.isError", + "id": "Stdlib.Int8Array.fromBufferWithRange", "kind": "value", - "name": "isError", + "name": "fromBufferWithRange", "docstrings": [ - "`isError(res)`: Returns `true` if `res` is of the form `Error(e)`, `false` if it is the `Ok(n)` variant." + "`fromBufferWithRange` creates a `Int8Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array/Int8Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." ], - "signature": "let isError: result<'a, 'b> => bool" + "signature": "let fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t" }, { - "id": "Core.Result.equal", + "id": "Stdlib.Int8Array.fromLength", "kind": "value", - "name": "equal", + "name": "fromLength", "docstrings": [ - "`equal(res1, res2, f)`: Determine if two `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 = Ok(42)\n\nlet good2 = Ok(32)\n\nlet bad1 = Error(\"invalid\")\n\nlet bad2 = Error(\"really invalid\")\n\nlet mod10equal = (a, b) => mod(a, 10) === mod(b, 10)\n\nResult.equal(good1, good2, mod10equal) == true\n\nResult.equal(good1, bad1, mod10equal) == false\n\nResult.equal(bad2, good2, mod10equal) == false\n\nResult.equal(bad1, bad2, mod10equal) == true\n```" + "`fromLength` creates a zero-initialized `Int8Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array/Int8Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." ], - "signature": "let equal: (result<'a, 'c>, result<'b, 'd>, ('a, 'b) => bool) => bool" + "signature": "let fromLength: int => t" }, { - "id": "Core.Result.compare", + "id": "Stdlib.Int8Array.fromArrayLikeOrIterable", "kind": "value", - "name": "compare", + "name": "fromArrayLikeOrIterable", "docstrings": [ - "`compare(res1, res2, f)`: Compare two `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 = Ok(59)\n\nlet good2 = Ok(37)\n\nlet bad1 = Error(\"invalid\")\n\nlet bad2 = Error(\"really invalid\")\n\nlet mod10cmp = (a, b) => Int.compare(mod(a, 10), mod(b, 10))\n\nResult.compare(Ok(39), Ok(57), mod10cmp) == 1.\n\nResult.compare(Ok(57), Ok(39), mod10cmp) == (-1.)\n\nResult.compare(Ok(39), Error(\"y\"), mod10cmp) == 1.\n\nResult.compare(Error(\"x\"), Ok(57), mod10cmp) == (-1.)\n\nResult.compare(Error(\"x\"), Error(\"y\"), mod10cmp) == 0.\n```" + "`fromArrayLikeOrIterable` creates a `Int8Array` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" ], - "signature": "let compare: (\n result<'a, 'c>,\n result<'b, 'd>,\n ('a, 'b) => Core__Ordering.t,\n) => Core__Ordering.t" + "signature": "let fromArrayLikeOrIterable: 'a => t" }, { - "id": "Core.Result.forEach", + "id": "Stdlib.Int8Array.fromArrayLikeOrIterableWithMap", "kind": "value", - "name": "forEach", + "name": "fromArrayLikeOrIterableWithMap", "docstrings": [ - "`forEach(res, f)` runs the provided function `f` on the `Ok` value. If `res` is `Error`, nothing happens.\n\n## Examples\n\n```rescript\nResult.forEach(Ok(3), Console.log) // Logs \"3\", returns ()\nResult.forEach(Error(\"x\"), Console.log) // Does nothing, returns ()\n```" + "`fromArrayLikeOrIterableWithMap` creates a `Int8Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" ], - "signature": "let forEach: (result<'a, 'b>, 'a => unit) => unit" + "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => int) => t" }, { - "id": "Core.Result.mapError", + "id": "Stdlib.Int8Array.ignore", "kind": "value", - "name": "mapError", + "name": "ignore", "docstrings": [ - "`mapError(r, f)` generates a new `result` by applying the function `f` to the `Error` value. If the source is `Ok`, return it as-is.\n\n## Examples\n\n```rescript\nlet format = n => `Error code: ${n->Int.toString}`\nResult.mapError(Error(14), format) // Error(\"Error code: 14\")\nResult.mapError(Ok(\"abc\"), format) // Ok(\"abc\")\n```" + "`ignore(intArray)` ignores the provided intArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." ], - "signature": "let mapError: (result<'a, 'b>, 'b => 'c) => result<'a, 'c>" + "signature": "let ignore: t => unit" } ] }, - "core/list": { - "id": "Core.List", - "name": "List", + "stdlib/float64array": { + "id": "Stdlib.Float64Array", + "name": "Float64Array", "docstrings": [], "items": [ { - "id": "Core.List.t", + "id": "Stdlib.Float64Array.t", "kind": "type", "name": "t", "docstrings": [ - "Collection functions for manipulating the `list` data structures, a singly-linked list.\n\n**Prefer Array** if you need any of the following:\n\n- Random access of element\n- Better interop with JavaScript\n- Better memory usage & performance." + "The `Float64Array` typed array represents an array of 64-bit floating point numbers in platform byte order. See [Float64Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array)" ], - "signature": "type t<'a> = list<'a>" + "signature": "type t = TypedArray.t" }, { - "id": "Core.List.length", + "id": "Stdlib.Float64Array.fromArray", "kind": "value", - "name": "length", + "name": "fromArray", "docstrings": [ - "`length(list)` returns the length of `list`.\n\n## Examples\n\n```rescript\nList.length(list{1, 2, 3}) // 3\n```" + "`fromArray` creates a `Float64Array` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array/Float64Array)" ], - "signature": "let length: t<'a> => int" + "signature": "let fromArray: array => t" }, { - "id": "Core.List.size", + "id": "Stdlib.Float64Array.fromBuffer", "kind": "value", - "name": "size", + "name": "fromBuffer", "docstrings": [ - "`size(list)`. See [`length`](#length)\n\n## Examples\n\n```rescript\nList.size(list{1, 2, 3}) // 3\n```" + "`fromBuffer` creates a `Float64Array` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array/Float64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." ], - "signature": "let size: t<'a> => int" + "signature": "let fromBuffer: ArrayBuffer.t => t" }, { - "id": "Core.List.head", + "id": "Stdlib.Float64Array.fromBufferToEnd", "kind": "value", - "name": "head", + "name": "fromBufferToEnd", "docstrings": [ - "`head(list)` returns `Some(value)` where `value` is the first element in the\nlist, or `None` if `list` is an empty list.\n\n## Examples\n\n```rescript\nList.head(list{}) // None\nList.head(list{1, 2, 3}) // Some(1)\n```" + "`fromBufferToEnd` creates a `Float64Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array/Float64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." ], - "signature": "let head: t<'a> => option<'a>" + "signature": "let fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t" }, { - "id": "Core.List.headExn", + "id": "Stdlib.Float64Array.fromBufferWithRange", "kind": "value", - "name": "headExn", + "name": "fromBufferWithRange", "docstrings": [ - "`headExn(list)` same as [`head`](#head).\n\n## Examples\n\n```rescript\nList.headExn(list{1, 2, 3}) // 1\n\nList.headExn(list{}) // Raises an Error\n```\n\n## Exceptions\n\n- Raises an Error if list is empty." + "`fromBufferWithRange` creates a `Float64Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array/Float64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." ], - "signature": "let headExn: t<'a> => 'a" + "signature": "let fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t" }, { - "id": "Core.List.tail", + "id": "Stdlib.Float64Array.fromLength", "kind": "value", - "name": "tail", + "name": "fromLength", "docstrings": [ - "`tail(list)` returns `None` if `list` is empty, otherwise it returns `Some(tail)`\nwhere `tail` is everything except the first element of `list`.\n\n## Examples\n\n```rescript\nList.tail(list{1, 2, 3}) // Some(list{2, 3})\n\nList.tail(list{}) // None\n```" + "`fromLength` creates a zero-initialized `Float64Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array/Float64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." ], - "signature": "let tail: t<'a> => option>" + "signature": "let fromLength: int => t" }, { - "id": "Core.List.tailExn", + "id": "Stdlib.Float64Array.fromArrayLikeOrIterable", "kind": "value", - "name": "tailExn", + "name": "fromArrayLikeOrIterable", "docstrings": [ - "`tailExn(list)` same as [`tail`](#tail).\n\n## Examples\n\n```rescript\nList.tailExn(list{1, 2, 3}) // list{2, 3}\n\nList.tailExn(list{}) // Raises an Error\n```\n\n## Exceptions\n\n- Raises an Error if list is empty." + "`fromArrayLikeOrIterable` creates a `Float64Array` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" ], - "signature": "let tailExn: t<'a> => t<'a>" + "signature": "let fromArrayLikeOrIterable: 'a => t" }, { - "id": "Core.List.add", + "id": "Stdlib.Float64Array.fromArrayLikeOrIterableWithMap", "kind": "value", - "name": "add", + "name": "fromArrayLikeOrIterableWithMap", "docstrings": [ - "`add(list, value)` adds a `value` to the beginning of list `list`.\n\n## Examples\n\n```rescript\nList.add(list{2, 3}, 1) // list{1, 2, 3}\n\nList.add(list{\"World\", \"!\"}, \"Hello\") // list{\"Hello\", \"World\", \"!\"}\n```" + "`fromArrayLikeOrIterableWithMap` creates a `Float64Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" ], - "signature": "let add: (t<'a>, 'a) => t<'a>" + "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => float) => t" }, { - "id": "Core.List.get", + "id": "Stdlib.Float64Array.ignore", "kind": "value", - "name": "get", + "name": "ignore", "docstrings": [ - "`get(list, index)` return the `index` element in `list`, or `None` if `index`\nis larger than the length of list `list`.\n\n## Examples\n\n```rescript\nlet abc = list{\"A\", \"B\", \"C\"}\n\nabc->List.get(1) // Some(\"B\")\n\nabc->List.get(4) // None\n```" + "`ignore(floatArray)` ignores the provided floatArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." ], - "signature": "let get: (t<'a>, int) => option<'a>" - }, + "signature": "let ignore: t => unit" + } + ] + }, + "stdlib/float32array": { + "id": "Stdlib.Float32Array", + "name": "Float32Array", + "docstrings": [], + "items": [ { - "id": "Core.List.getExn", - "kind": "value", - "name": "getExn", + "id": "Stdlib.Float32Array.t", + "kind": "type", + "name": "t", "docstrings": [ - "`getExn(list, index)` same as [`get`](#get).\n\n## Examples\n\n```rescript\nlet abc = list{\"A\", \"B\", \"C\"}\n\nabc->List.getExn(1) // \"B\"\n\nabc->List.getExn(4) // Raises an Error\n```\n\n## Exceptions\n\n- Raises an Error if `index` is larger than the length of list." + "The `Float32Array` typed array represents an array of 32-bit floating point numbers in platform byte order. See [Float32Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array)" ], - "signature": "let getExn: (t<'a>, int) => 'a" + "signature": "type t = TypedArray.t" }, { - "id": "Core.List.make", + "id": "Stdlib.Float32Array.fromArray", "kind": "value", - "name": "make", + "name": "fromArray", "docstrings": [ - "`make(length, value)` returns a list of length `length` with each element filled\nwith `value`. Returns an empty list if `value` is negative.\n\n## Examples\n\n```rescript\nList.make(~length=3, 1) // list{1, 1, 1}\n```" + "`fromArray` creates a `Float32Array` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array/Float32Array)" ], - "signature": "let make: (~length: int, 'a) => t<'a>" + "signature": "let fromArray: array => t" }, { - "id": "Core.List.fromInitializer", + "id": "Stdlib.Float32Array.fromBuffer", "kind": "value", - "name": "fromInitializer", + "name": "fromBuffer", "docstrings": [ - "`makeBy(length, f)` return a list of length `length` with element initialized\nwith `f`. Returns an empty list if `length` is negative.\n\n## Examples\n\n```rescript\nList.fromInitializer(~length=5, i => i) // list{0, 1, 2, 3, 4}\n\nList.fromInitializer(~length=5, i => i * i) // list{0, 1, 4, 9, 16}\n```" + "`fromBuffer` creates a `Float32Array` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array/Float32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." ], - "signature": "let fromInitializer: (~length: int, int => 'a) => t<'a>" + "signature": "let fromBuffer: ArrayBuffer.t => t" }, { - "id": "Core.List.toShuffled", + "id": "Stdlib.Float32Array.fromBufferToEnd", "kind": "value", - "name": "toShuffled", + "name": "fromBufferToEnd", "docstrings": [ - "`toShuffled(list)` returns a new list in random order.\n\n## Examples\n\n```rescript\nList.toShuffled(list{1, 2, 3}) // list{2, 1, 3}\n```" + "`fromBufferToEnd` creates a `Float32Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array/Float32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." ], - "signature": "let toShuffled: t<'a> => t<'a>" + "signature": "let fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t" }, { - "id": "Core.List.drop", + "id": "Stdlib.Float32Array.fromBufferWithRange", "kind": "value", - "name": "drop", + "name": "fromBufferWithRange", "docstrings": [ - "`drop(list, value)` return a new list, dropping the first `value` element.\nReturns `None` if `list` has fewer than `value` elements.\n\n## Examples\n\n```rescript\nlist{1, 2, 3}->List.drop(2) // Some(list{3})\n\nlist{1, 2, 3}->List.drop(3) // Some(list{})\n\nlist{1, 2, 3}->List.drop(4) // None\n```" + "`fromBufferWithRange` creates a `Float32Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array/Float32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." ], - "signature": "let drop: (t<'a>, int) => option>" + "signature": "let fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t" }, { - "id": "Core.List.take", + "id": "Stdlib.Float32Array.fromLength", "kind": "value", - "name": "take", + "name": "fromLength", "docstrings": [ - "`take(list, value)` returns a list with the first `value` elements from `list`,\nor `None` if `list` has fewer than `value` elements.\n\n## Examples\n\n```rescript\nlist{1, 2, 3}->List.take(1) // Some(list{1})\n\nlist{1, 2, 3}->List.take(2) // Some(list{1, 2})\n\nlist{1, 2, 3}->List.take(4) // None\n```" + "`fromLength` creates a zero-initialized `Float32Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array/Float32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." ], - "signature": "let take: (t<'a>, int) => option>" + "signature": "let fromLength: int => t" }, { - "id": "Core.List.splitAt", + "id": "Stdlib.Float32Array.fromArrayLikeOrIterable", "kind": "value", - "name": "splitAt", + "name": "fromArrayLikeOrIterable", "docstrings": [ - "`splitAt(list, n)` split the list `list` at `n`. Returns `None` when the length\nof `list` is less than `n`.\n\n## Examples\n\n```rescript\nlist{\"Hello\", \"World\"}->List.splitAt(1) // Some((list{\"Hello\"}, list{\"World\"}))\n\nlist{0, 1, 2, 3, 4}->List.splitAt(2) // Some((list{0, 1}, list{2, 3, 4}))\n```" + "`fromArrayLikeOrIterable` creates a `Float32Array` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" ], - "signature": "let splitAt: (t<'a>, int) => option<(list<'a>, list<'a>)>" + "signature": "let fromArrayLikeOrIterable: 'a => t" }, { - "id": "Core.List.concat", + "id": "Stdlib.Float32Array.fromArrayLikeOrIterableWithMap", "kind": "value", - "name": "concat", + "name": "fromArrayLikeOrIterableWithMap", "docstrings": [ - "`concat(list1, list2)` returns the list obtained by adding `list1` after `list2`.\n\n## Examples\n\n```rescript\nList.concat(list{1, 2, 3}, list{4, 5}) // list{1, 2, 3, 4, 5}\n```" + "`fromArrayLikeOrIterableWithMap` creates a `Float32Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" ], - "signature": "let concat: (t<'a>, t<'a>) => t<'a>" + "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => float) => t" }, { - "id": "Core.List.concatMany", + "id": "Stdlib.Float32Array.ignore", "kind": "value", - "name": "concatMany", + "name": "ignore", "docstrings": [ - "`concatMany(arr)` returns the list obtained by concatenating all the lists in\narray `arr`, in order.\n\n## Examples\n\n```rescript\nList.concatMany([list{1, 2, 3}, list{}, list{3}]) // list{1, 2, 3, 3}\n```" + "`ignore(floatArray)` ignores the provided floatArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." ], - "signature": "let concatMany: array> => t<'a>" + "signature": "let ignore: t => unit" + } + ] + }, + "stdlib/typedarray": { + "id": "Stdlib.TypedArray", + "name": "TypedArray", + "docstrings": [], + "items": [ + { + "id": "Stdlib.TypedArray.t", + "kind": "type", + "name": "t", + "docstrings": [], + "signature": "type t<'a>" }, { - "id": "Core.List.reverseConcat", + "id": "Stdlib.TypedArray.get", "kind": "value", - "name": "reverseConcat", - "docstrings": [ - "`reverseConcat(list1, list2)` is equivalent to writing: `concat(reverse(list1, list2)`\n\n## Examples\n\n```rescript\nList.reverseConcat(list{1, 2}, list{3, 4}) // list{2, 1, 3, 4}\n```" - ], - "signature": "let reverseConcat: (t<'a>, t<'a>) => t<'a>" + "name": "get", + "docstrings": [], + "signature": "let get: (t<'a>, int) => option<'a>" }, { - "id": "Core.List.flat", + "id": "Stdlib.TypedArray.set", "kind": "value", - "name": "flat", - "docstrings": [ - "`flat(list)` return the list obtained by concatenating all the lists in\n`list`, in order.\n\n## Examples\n\n```rescript\nList.flat(list{list{1, 2, 3}, list{}, list{3}}) // list{1, 2, 3, 3}\n```" - ], - "signature": "let flat: t> => t<'a>" + "name": "set", + "docstrings": [], + "signature": "let set: (t<'a>, int, 'a) => unit" }, { - "id": "Core.List.map", + "id": "Stdlib.TypedArray.buffer", "kind": "value", - "name": "map", - "docstrings": [ - "`map(list, f)` returns a new list with `f` applied to each element of `list`.\n\n## Examples\n\n```rescript\nlist{1, 2}->List.map(x => x + 1) // list{3, 4}\n```" - ], - "signature": "let map: (t<'a>, 'a => 'b) => t<'b>" + "name": "buffer", + "docstrings": [], + "signature": "let buffer: t<'a> => ArrayBuffer.t" }, { - "id": "Core.List.zip", + "id": "Stdlib.TypedArray.byteLength", "kind": "value", - "name": "zip", - "docstrings": [ - "`zip(list1, list2)` returns a list of pairs from the two lists with the length\nof the shorter list.\n\n## Examples\n\n```rescript\nList.zip(list{1, 2}, list{3, 4, 5}) // list{(1, 3), (2, 4)}\n```" - ], - "signature": "let zip: (t<'a>, t<'b>) => t<('a, 'b)>" + "name": "byteLength", + "docstrings": [], + "signature": "let byteLength: t<'a> => int" }, { - "id": "Core.List.zipBy", + "id": "Stdlib.TypedArray.byteOffset", "kind": "value", - "name": "zipBy", - "docstrings": [ - "`zipBy(list1, list2, f)`. See [`zip`](#zip)\n\n## Examples\n\n```rescript\nList.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>" + "name": "byteOffset", + "docstrings": [], + "signature": "let byteOffset: t<'a> => int" }, { - "id": "Core.List.mapWithIndex", + "id": "Stdlib.TypedArray.setArray", "kind": "value", - "name": "mapWithIndex", - "docstrings": [ - "`mapWithIndex(list, f)` applies `f` to each element of `list`. Function `f`\ntakes two arguments: the index starting from 0 and the element from `list`, in\nthat order.\n\n## Examples\n\n```rescript\nlist{1, 2, 3}->List.mapWithIndex((x, index) => index + x) // list{1, 3, 5}\n```" - ], - "signature": "let mapWithIndex: (t<'a>, ('a, int) => 'b) => t<'b>" + "name": "setArray", + "docstrings": [], + "signature": "let setArray: (t<'a>, array<'a>) => unit" }, { - "id": "Core.List.fromArray", + "id": "Stdlib.TypedArray.setArrayFrom", "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray(arr)` converts the given array `arr` to a list.\n\n## Examples\n\n```rescript\nList.fromArray([1, 2, 3]) // list{1, 2, 3}\n```" - ], - "signature": "let fromArray: array<'a> => t<'a>" + "name": "setArrayFrom", + "docstrings": [], + "signature": "let setArrayFrom: (t<'a>, array<'a>, int) => unit" }, { - "id": "Core.List.toArray", + "id": "Stdlib.TypedArray.length", "kind": "value", - "name": "toArray", - "docstrings": [ - "`toArray(list)` converts the given list `list` to an array.\n\n## Examples\n\n```rescript\nList.toArray(list{1, 2, 3}) // [1, 2, 3]\n```" - ], - "signature": "let toArray: t<'a> => array<'a>" + "name": "length", + "docstrings": [], + "signature": "let length: t<'a> => int" }, { - "id": "Core.List.reverse", + "id": "Stdlib.TypedArray.copyAllWithin", "kind": "value", - "name": "reverse", - "docstrings": [ - "`reverse(list)` returns a new list whose elements are those of `list` in\nreversed order.\n\n## Examples\n\n```rescript\nList.reverse(list{1, 2, 3}) // list{3, 2, 1}\n```" - ], - "signature": "let reverse: t<'a> => t<'a>" + "name": "copyAllWithin", + "docstrings": [], + "signature": "let copyAllWithin: (t<'a>, ~target: int) => array<'a>" }, { - "id": "Core.List.mapReverse", + "id": "Stdlib.TypedArray.copyWithinToEnd", "kind": "value", - "name": "mapReverse", - "docstrings": [ - "`mapReverse(list, f)` is equivalent to `map` function.\n\n## Examples\n\n```rescript\nlet f = x => x * x\nlet l = list{3, 4, 5}\n\nlet withMap = List.map(l, f)->List.reverse\nlet withMapReverse = l->List.mapReverse(f)\n\nConsole.log(withMap == withMapReverse) // true\n```" - ], - "signature": "let mapReverse: (t<'a>, 'a => 'b) => t<'b>" + "name": "copyWithinToEnd", + "docstrings": [], + "signature": "let copyWithinToEnd: (t<'a>, ~target: int, ~start: int) => array<'a>" }, { - "id": "Core.List.forEach", + "id": "Stdlib.TypedArray.copyWithin", "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(list, f)` call `f` on each element of `list` from the beginning to end.\n`f` returns `unit`, so no new array is created. Use `forEach` when you are primarily\nconcerned with repetitively creating side effects.\n\n## Examples\n\n```rescript\nList.forEach(list{\"a\", \"b\", \"c\"}, x => Console.log(\"Item: \" ++ x))\n/*\n prints:\n Item: a\n Item: b\n Item: c\n*/\n```" - ], - "signature": "let forEach: (t<'a>, 'a => unit) => unit" + "name": "copyWithin", + "docstrings": [], + "signature": "let copyWithin: (t<'a>, ~target: int, ~start: int, ~end: int) => array<'a>" }, { - "id": "Core.List.forEachWithIndex", + "id": "Stdlib.TypedArray.fillAll", "kind": "value", - "name": "forEachWithIndex", - "docstrings": [ - "`forEachWithIndex(list, f, index)` call `f` on each element of `list` from beginning\nto end. Function `f` takes two arguments: the `index` starting from 0 and the\nelement from `list`. `f` returns `unit`.\n\n## Examples\n\n```rescript\nList.forEachWithIndex(list{\"a\", \"b\", \"c\"}, (x, index) => {\n Console.log(\"Item \" ++ Int.toString(index) ++ \" is \" ++ x)\n})\n/*\n prints:\n Item 0 is a\n Item 1 is b\n Item 2 is cc\n*/\n```" - ], - "signature": "let forEachWithIndex: (t<'a>, ('a, int) => unit) => unit" + "name": "fillAll", + "docstrings": [], + "signature": "let fillAll: (t<'a>, 'a) => t<'a>" }, { - "id": "Core.List.reduce", + "id": "Stdlib.TypedArray.fillToEnd", "kind": "value", - "name": "reduce", - "docstrings": [ - "`reduce(list, initialValue, f)` applies `f` to each element of `list` from\nbeginning to end. Function `f` has two parameters: the item from the list and\nan \"accumulator\", which starts with a value of `initialValue`. `reduce` returns\nthe final value of the accumulator.\n\n## Examples\n\n```rescript\nlist{1, 2, 3, 4}->List.reduce(0, (a, b) => a + b) // 10\n\n// same as\n\nlist{1, 2, 3, 4}->List.reduce(0, (acc, item) => acc + item) // 10\n```" - ], - "signature": "let reduce: (t<'a>, 'b, ('b, 'a) => 'b) => 'b" + "name": "fillToEnd", + "docstrings": [], + "signature": "let fillToEnd: (t<'a>, 'a, ~start: int) => t<'a>" }, { - "id": "Core.List.reduceWithIndex", + "id": "Stdlib.TypedArray.fill", "kind": "value", - "name": "reduceWithIndex", - "docstrings": [ - "`reduceWithIndex(list, initialValue, f)` applies `f` to each element of `list`\nfrom beginning to end. Function `f` has three parameters: the item from the list\nand an \"accumulator\", which starts with a value of `initialValue` and the index\nof each element. `reduceWithIndex` returns the final value of the accumulator.\n\n## Examples\n\n```rescript\nlist{1, 2, 3, 4}->List.reduceWithIndex(0, (acc, item, index) => acc + item + index) // 16\n```" - ], - "signature": "let reduceWithIndex: (t<'a>, 'b, ('b, 'a, int) => 'b) => 'b" + "name": "fill", + "docstrings": [], + "signature": "let fill: (t<'a>, 'a, ~start: int, ~end: int) => t<'a>" }, { - "id": "Core.List.reduceReverse", + "id": "Stdlib.TypedArray.reverse", "kind": "value", - "name": "reduceReverse", - "docstrings": [ - "`reduceReverse(list, initialValue, f)` works like `reduce`, except that\nfunction `f` is applied to each item of `list` from the last back to the first.\n\n## Examples\n\n```rescript\nlist{1, 2, 3, 4}->List.reduceReverse(0, (a, b) => a + b) // 10\n\nlist{1, 2, 3, 4}->List.reduceReverse(10, (a, b) => a - b) // 0\n\nlist{1, 2, 3, 4}->List.reduceReverse(list{}, List.add) // list{1, 2, 3, 4}\n```" - ], - "signature": "let reduceReverse: (t<'a>, 'b, ('b, 'a) => 'b) => 'b" + "name": "reverse", + "docstrings": [], + "signature": "let reverse: t<'a> => unit" }, { - "id": "Core.List.mapReverse2", + "id": "Stdlib.TypedArray.toReversed", "kind": "value", - "name": "mapReverse2", - "docstrings": [ - "`mapReverse2(list1, list2, f)` is equivalent to `List.zipBy(list1, list2, f)->List.reverse`.\n\n## Examples\n\n```rescript\nList.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>" + "name": "toReversed", + "docstrings": [], + "signature": "let toReversed: t<'a> => t<'a>" }, { - "id": "Core.List.forEach2", + "id": "Stdlib.TypedArray.sort", "kind": "value", - "name": "forEach2", - "docstrings": [ - "`forEach2(list1, list2, f)` is similar to `forEach`, but accepts two lists and\nstops at the length of the shorter list.\n\n## Examples\n\n```rescript\nList.forEach2(list{\"Z\", \"Y\"}, list{\"A\", \"B\", \"C\"}, (x, y) => Console.log2(x, y))\n\n/*\n prints:\n \"Z\" \"A\"\n \"Y\" \"B\"\n*/\n```" - ], - "signature": "let forEach2: (t<'a>, t<'b>, ('a, 'b) => 'c) => unit" + "name": "sort", + "docstrings": [], + "signature": "let sort: (t<'a>, ('a, 'a) => Ordering.t) => unit" }, { - "id": "Core.List.reduce2", + "id": "Stdlib.TypedArray.toSorted", "kind": "value", - "name": "reduce2", - "docstrings": [ - "`reduce2(list1, list2, initialValue, f)` applies `f` to each element of `list1`\nand `list2` from beginning to end. Stops with the shorter list. Function `f` has\nthree parameters: an accumulator which starts with a value of `initialValue`, an\nitem from `l1`, and an item from `l2`. `reduce2` returns the final value of the\naccumulator.\n\n## Examples\n\n```rescript\nList.reduce2(list{1, 2, 3}, list{4, 5}, 0, (acc, x, y) => acc + x * x + y) // 0 + (1 * 1 + 4) + (2 * 2 + 5)\n```" - ], - "signature": "let reduce2: (t<'b>, t<'c>, 'a, ('a, 'b, 'c) => 'a) => 'a" + "name": "toSorted", + "docstrings": [], + "signature": "let toSorted: (t<'a>, ('a, 'a) => Ordering.t) => t<'a>" }, { - "id": "Core.List.reduceReverse2", + "id": "Stdlib.TypedArray.with", "kind": "value", - "name": "reduceReverse2", - "docstrings": [ - "`reduceReverse2(list1, list2, initialValue, f)` applies `f` to each element of\n`list1` and `list2`from end to beginning. Stops with the shorter list. Function\n`f` has three parameters: an accumulator which starts with a value of\n`initialValue`, an item from `l1`, and an item from `l2`. `reduce2` returns the\nfinal value of the accumulator.\n\n## Examples\n\n```rescript\nList.reduceReverse2(list{1, 2, 3}, list{4, 5}, 0, (acc, x, y) => acc + x * x + y) // + (1 * 1 + 4) + (2 * 2 + 5)\n```" - ], - "signature": "let reduceReverse2: (t<'a>, t<'b>, 'c, ('c, 'a, 'b) => 'c) => 'c" + "name": "with", + "docstrings": [], + "signature": "let with: (t<'a>, int, 'a) => t<'a>" }, { - "id": "Core.List.every", + "id": "Stdlib.TypedArray.includes", "kind": "value", - "name": "every", - "docstrings": [ - "`every(list, f)` returns `true` if all elements in `list` satisfy `f`, where `f`\nis 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}->List.every(isBelow10) // true\n\nlist{1, 99, 8, 2}->List.every(isBelow10) // false\n```" - ], - "signature": "let every: (t<'a>, 'a => bool) => bool" + "name": "includes", + "docstrings": [], + "signature": "let includes: (t<'a>, 'a) => bool" }, { - "id": "Core.List.some", + "id": "Stdlib.TypedArray.indexOf", "kind": "value", - "name": "some", - "docstrings": [ - "`some(list, f)` returns `true` if at least _one_ of the elements in `list`\nsatisfies `f`, where `f` 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}->List.some(isAbove100) // true\n\nlist{1, 2, 3, 4}->List.some(isAbove100) // false\n```" - ], - "signature": "let some: (t<'a>, 'a => bool) => bool" + "name": "indexOf", + "docstrings": [], + "signature": "let indexOf: (t<'a>, 'a) => int" }, { - "id": "Core.List.every2", + "id": "Stdlib.TypedArray.indexOfFrom", "kind": "value", - "name": "every2", - "docstrings": [ - "`every2(list1, list2, f)` returns `true` if predicate `f` is `true` for all\npairs of elements up to the shorter length (i.e. `min(length(list1), length(list2))`)\n\n## Examples\n\n```rescript\nList.every2(list{1, 2, 3}, list{0, 1}, (a, b) => a > b) // true\n\nList.every2(list{}, list{1}, (a, b) => a > b) // true\n\nList.every2(list{2, 3}, list{1}, (a, b) => a > b) // true\n\nList.every2(list{0, 1}, list{5, 0}, (a, b) => a > b) // false\n```" - ], - "signature": "let every2: (t<'a>, t<'b>, ('a, 'b) => bool) => bool" + "name": "indexOfFrom", + "docstrings": [], + "signature": "let indexOfFrom: (t<'a>, 'a, int) => int" + }, + { + "id": "Stdlib.TypedArray.joinWith", + "kind": "value", + "name": "joinWith", + "docstrings": [], + "signature": "let joinWith: (t<'a>, string) => string" + }, + { + "id": "Stdlib.TypedArray.lastIndexOf", + "kind": "value", + "name": "lastIndexOf", + "docstrings": [], + "signature": "let lastIndexOf: (t<'a>, 'a) => int" + }, + { + "id": "Stdlib.TypedArray.lastIndexOfFrom", + "kind": "value", + "name": "lastIndexOfFrom", + "docstrings": [], + "signature": "let lastIndexOfFrom: (t<'a>, 'a, int) => int" + }, + { + "id": "Stdlib.TypedArray.slice", + "kind": "value", + "name": "slice", + "docstrings": [], + "signature": "let slice: (t<'a>, ~start: int, ~end: int) => t<'a>" + }, + { + "id": "Stdlib.TypedArray.sliceToEnd", + "kind": "value", + "name": "sliceToEnd", + "docstrings": [], + "signature": "let sliceToEnd: (t<'a>, ~start: int) => t<'a>" + }, + { + "id": "Stdlib.TypedArray.copy", + "kind": "value", + "name": "copy", + "docstrings": [], + "signature": "let copy: t<'a> => t<'a>" }, { - "id": "Core.List.some2", + "id": "Stdlib.TypedArray.subarray", "kind": "value", - "name": "some2", - "docstrings": [ - "`some2(list1, list2, f)` returns `true` if predicate `f` is `true` for any pair\nof elements up to the shorter length (i.e. `min(length(list1), length(list2))`)\n\n## Examples\n\n```rescript\nList.some2(list{1, 2, 3}, list{0, 1}, (a, b) => a > b) // true\n\nList.some2(list{}, list{1}, (a, b) => a > b) // false\n\nList.some2(list{2, 3}, list{1}, (a, b) => a > b) // true\n\nList.some2(list{0, 1}, list{5, 0}, (a, b) => a > b) // true\n```" - ], - "signature": "let some2: (t<'a>, t<'b>, ('a, 'b) => bool) => bool" + "name": "subarray", + "docstrings": [], + "signature": "let subarray: (t<'a>, ~start: int, ~end: int) => t<'a>" }, { - "id": "Core.List.compareLength", + "id": "Stdlib.TypedArray.subarrayToEnd", "kind": "value", - "name": "compareLength", - "docstrings": [ - "`compareLength(list1, list2)` compare two lists solely by length. Returns `-1.` if\n`length(list1)` is less than `length(list2)`, `0.` if `length(list1)` equals\n`length(list2)`, and `1.` if `length(list1)` is greater than `length(list2)`.\n\n## Examples\n\n```rescript\nList.compareLength(list{1, 2}, list{3, 4, 5, 6}) // -1.\n\nList.compareLength(list{1, 2, 3}, list{4, 5, 6}) // 0.\n\nList.compareLength(list{1, 2, 3, 4}, list{5, 6}) // 1.\n```" - ], - "signature": "let compareLength: (t<'a>, t<'a>) => Core__Ordering.t" + "name": "subarrayToEnd", + "docstrings": [], + "signature": "let subarrayToEnd: (t<'a>, ~start: int) => t<'a>" }, { - "id": "Core.List.compare", + "id": "Stdlib.TypedArray.toString", "kind": "value", - "name": "compare", - "docstrings": [ - "`compare(list1, list2, f)` compare elements one by one `f`. `f` returns a negative\nnumber if `list1` is \"less than\" `list2`, zero if `list1` is \"equal to\" `list2`,\na positive number if `list1` is \"greater than\" `list2`.\n\nThe comparison returns the first non-zero result of `f`, or zero if `f` returns\nzero for all `list1` and `list2`.\n\n- If all items have compared equal, but `list1` is exhausted first, return `-1.`. (`list1` is shorter).\n- If all items have compared equal, but `list2` is exhausted first, return `1.` (`list1` is longer).\n\n## Examples\n\n```rescript\nList.compare(list{3}, list{3, 7}, (a, b) => Int.compare(a, b)) // -1.\nList.compare(list{5, 3}, list{5}, (a, b) => Int.compare(a, b)) // 1.\nList.compare(list{1, 3, 5}, list{1, 4, 2}, (a, b) => Int.compare(a, b)) // -1.\nList.compare(list{1, 3, 5}, list{1, 2, 3}, (a, b) => Int.compare(a, b)) // 1.\nList.compare(list{1, 3, 5}, list{1, 3, 5}, (a, b) => Int.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 compare: (\n t<'a>,\n t<'a>,\n ('a, 'a) => Core__Ordering.t,\n) => Core__Ordering.t" + "name": "toString", + "docstrings": [], + "signature": "let toString: t<'a> => string" }, { - "id": "Core.List.equal", + "id": "Stdlib.TypedArray.toLocaleString", "kind": "value", - "name": "equal", - "docstrings": [ - "`equal(list1, list2, f)` check equality of `list2` and `list2` using `f` for\nequality on elements, where `f` is a function that returns `true` if items `x` and\n`y` meet some criterion for equality, `false` otherwise. equal `false` if length\nof `list1` and `list2` are not the same.\n\n## Examples\n\n```rescript\nList.equal(list{1, 2, 3}, list{1, 2}, (a, b) => a == b) // false\n\nList.equal(list{1, 2}, list{1, 2}, (a, b) => a == b) // true\n\nList.equal(list{1, 2, 3}, list{(-1), (-2), (-3)}, (a, b) => abs(a) == abs(b)) // true\n```" - ], - "signature": "let equal: (t<'a>, t<'a>, ('a, 'a) => bool) => bool" + "name": "toLocaleString", + "docstrings": [], + "signature": "let toLocaleString: t<'a> => string" }, { - "id": "Core.List.has", + "id": "Stdlib.TypedArray.every", "kind": "value", - "name": "has", - "docstrings": [ - "`has(list, element, f)` returns `true` if the list contains at least one\n`element` for which `f` returns `true'.\n\n## Examples\n\n```rescript\nlist{1, 2, 3}->List.has(2, (a, b) => a == b) // true\n\nlist{1, 2, 3}->List.has(4, (a, b) => a == b) // false\n\nlist{(-1), (-2), (-3)}->List.has(2, (a, b) => abs(a) == abs(b)) // true\n```" - ], - "signature": "let has: (t<'a>, 'b, ('a, 'b) => bool) => bool" + "name": "every", + "docstrings": [], + "signature": "let every: (t<'a>, 'a => bool) => bool" }, { - "id": "Core.List.find", + "id": "Stdlib.TypedArray.everyWithIndex", "kind": "value", - "name": "find", - "docstrings": [ - "`find(list, f)` returns `Some(value)` for the first value in `list` that\nsatisfies the predicate function `f`. Returns `None` if no element satisfies\nthe function.\n\n## Examples\n\n```rescript\nList.find(list{1, 4, 3, 2}, x => x > 3) // Some(4)\n\nList.find(list{1, 4, 3, 2}, x => x > 4) // None\n```" - ], - "signature": "let find: (t<'a>, 'a => bool) => option<'a>" + "name": "everyWithIndex", + "docstrings": [], + "signature": "let everyWithIndex: (t<'a>, ('a, int) => bool) => bool" }, { - "id": "Core.List.filter", + "id": "Stdlib.TypedArray.filter", "kind": "value", "name": "filter", - "docstrings": [ - "`filter(list, f)` returns a list of all elements in `list` which satisfy the\npredicate function `f`.\n\n## Examples\n\n```rescript\nlet isEven = x => mod(x, 2) == 0\n\nList.filter(list{1, 2, 3, 4}, isEven) // list{2, 4}\n\nList.filter(list{None, Some(2), Some(3), None}, Option.isSome) // list{Some(2), Some(3)}\n```" - ], + "docstrings": [], "signature": "let filter: (t<'a>, 'a => bool) => t<'a>" }, { - "id": "Core.List.filterWithIndex", + "id": "Stdlib.TypedArray.filterWithIndex", "kind": "value", "name": "filterWithIndex", - "docstrings": [ - "`filterWithIndex(list, f)` returns a list of all elements in `list` which\nsatisfy the predicate function `f`.\n\n## Examples\n\n```rescript\nlet isEven = x => mod(x, 2) == 0\n\nList.filterWithIndex(list{1, 2, 3, 4}, (_x, index) => isEven(index)) // list{1, 3}\n```" - ], + "docstrings": [], "signature": "let filterWithIndex: (t<'a>, ('a, int) => bool) => t<'a>" }, { - "id": "Core.List.filterMap", + "id": "Stdlib.TypedArray.find", "kind": "value", - "name": "filterMap", - "docstrings": [ - "`filterMap(list, f)` applies `f` to each element of `list`. If `f` returns\n`Some(value)`, then `value` is _kept_ in the resulting list. If `f` returns\n`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->List.filterMap(x =>\n if (isEven(x)) {\n Some(x)\n } else {\n None\n }\n ) // list{2, 4}\n\nlist{Some(1), Some(2), None}->List.filterMap(x => x) // list{1, 2}\n```" - ], - "signature": "let filterMap: (t<'a>, 'a => option<'b>) => t<'b>" + "name": "find", + "docstrings": [], + "signature": "let find: (t<'a>, 'a => bool) => option<'a>" }, { - "id": "Core.List.partition", + "id": "Stdlib.TypedArray.findWithIndex", "kind": "value", - "name": "partition", - "docstrings": [ - "`partition(list, f)` creates a pair of lists; the first list consists of all\nelements of `list` that satisfy the predicate function `f`, the second list\nconsists of all elements of `list` that _do not_ satisfy `f`.\n\n## Examples\n\n```rescript\n// (elementsThatSatisfies, elementsThatDoesNotSatisfy)\n\nList.partition(list{1, 2, 3, 4}, x => x > 2) // (list{3, 4}, list{1, 2})\n```" - ], - "signature": "let partition: (t<'a>, 'a => bool) => (t<'a>, t<'a>)" + "name": "findWithIndex", + "docstrings": [], + "signature": "let findWithIndex: (t<'a>, ('a, int) => bool) => option<'a>" }, { - "id": "Core.List.unzip", + "id": "Stdlib.TypedArray.findLast", "kind": "value", - "name": "unzip", - "docstrings": [ - "`unzip(list)` takes a list of pairs and creates a pair of lists. The first list\ncontains all the first items of the pairs, the second list contains all the\nsecond items.\n\n## Examples\n\n```rescript\nList.unzip(list{(1, 2), (3, 4)}) // (list{1, 3}, list{2, 4})\n\nList.unzip(list{(\"H\", \"W\"), (\"e\", \"o\"), (\"l\", \"r\"), (\"l\", \"l\"), (\"o\", \"d\"), (\" \", \"!\")})\n// (list{\"H\", \"e\", \"l\", \"l\", \"o\", \" \"}, list{\"W\", \"o\", \"r\", \"l\", \"d\", \"!\"})\n```" - ], - "signature": "let unzip: t<('a, 'b)> => (t<'a>, t<'b>)" + "name": "findLast", + "docstrings": [], + "signature": "let findLast: (t<'a>, 'a => bool) => option<'a>" }, { - "id": "Core.List.getAssoc", + "id": "Stdlib.TypedArray.findLastWithIndex", "kind": "value", - "name": "getAssoc", - "docstrings": [ - "`getAssoc(list, k, f)` return the second element of a pair in `list` where\nthe first element equals `k` as per the predicate function `f`, or `None` if\nnot found.\n\n## Examples\n\n```rescript\nlist{(1, \"a\"), (2, \"b\"), (3, \"c\")}->List.getAssoc(3, (a, b) => a == b) // Some(\"c\")\n\nlist{(9, \"morning\"), (15, \"afternoon\"), (22, \"night\")}\n->List.getAssoc(15, (k, item) => k /* 15 */ == item /* 9, 5, 22 */)\n// Some(\"afternoon\")\n```" - ], - "signature": "let getAssoc: (t<('a, 'c)>, 'b, ('a, 'b) => bool) => option<'c>" + "name": "findLastWithIndex", + "docstrings": [], + "signature": "let findLastWithIndex: (t<'a>, ('a, int) => bool) => option<'a>" }, { - "id": "Core.List.hasAssoc", + "id": "Stdlib.TypedArray.findIndex", "kind": "value", - "name": "hasAssoc", - "docstrings": [ - "`hasAssoc(list, k, f)` returns `true` if there is a pair in `list` where the\nfirst element equals `k` as per the predicate function `f`.\n\n## Examples\n\n```rescript\nlist{(1, \"a\"), (2, \"b\"), (3, \"c\")}->List.hasAssoc(1, (a, b) => a == b) // true\n\nlist{(9, \"morning\"), (15, \"afternoon\"), (22, \"night\")}\n->List.hasAssoc(25, (k, item) => k /* 25 */ == item /* 9, 5, 22 */) // false\n```" - ], - "signature": "let hasAssoc: (t<('a, 'c)>, 'b, ('a, 'b) => bool) => bool" + "name": "findIndex", + "docstrings": [], + "signature": "let findIndex: (t<'a>, 'a => bool) => int" }, { - "id": "Core.List.removeAssoc", + "id": "Stdlib.TypedArray.findIndexWithIndex", "kind": "value", - "name": "removeAssoc", - "docstrings": [ - "`removeAssoc(list, k, f)` return a list after removing the first pair whose\nfirst value is `k` per the equality predicate `f`, if not found, return a new\nlist identical to `list`.\n\n## Examples\n\n```rescript\nlist{(1, \"a\"), (2, \"b\"), (3, \"c\")}->List.removeAssoc(1, (a, b) => a == b) // list{(2, \"b\"), (3, \"c\")}\n\nlist{(9, \"morning\"), (15, \"afternoon\"), (22, \"night\")}\n->List.removeAssoc(9, (k, item) => k /* 9 */ == item /* 9, 5, 22 */)\n// list{(15, \"afternoon\"), (22, \"night\")}\n```" - ], - "signature": "let removeAssoc: (t<('a, 'c)>, 'b, ('a, 'b) => bool) => t<('a, 'c)>" + "name": "findIndexWithIndex", + "docstrings": [], + "signature": "let findIndexWithIndex: (t<'a>, ('a, int) => bool) => int" }, { - "id": "Core.List.setAssoc", + "id": "Stdlib.TypedArray.findLastIndex", "kind": "value", - "name": "setAssoc", - "docstrings": [ - "`setAssoc(list, k, v, f)`. If `k` exists in `list` by satisfying the `f`\npredicate, return a new list with the key and value replaced by the new `k` and\n`v`, otherwise, return a new list with the pair `k`, `v` added to the head of\n`list`.\n\n## Examples\n\n```rescript\nlist{(1, \"a\"), (2, \"b\"), (3, \"c\")}->List.setAssoc(2, \"x\", (a, b) => a == b) // list{(1, \"a\"), (2, \"x\"), (3, \"c\")}\n\nlist{(1, \"a\"), (3, \"c\")}->List.setAssoc(2, \"b\", (a, b) => a == b) // list{(2, \"b\"), (1, \"a\"), (3, \"c\")}\n\nlist{(9, \"morning\"), (3, \"morning?!\"), (22, \"night\")}\n->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**: In the last example, since: `15 mod 12` equals `3 mod 12`. Both\nthe key _and_ the value are replaced in the list." - ], - "signature": "let setAssoc: (t<('a, 'c)>, 'a, 'c, ('a, 'a) => bool) => t<('a, 'c)>" + "name": "findLastIndex", + "docstrings": [], + "signature": "let findLastIndex: (t<'a>, 'a => bool) => int" }, { - "id": "Core.List.sort", + "id": "Stdlib.TypedArray.findLastIndexWithIndex", "kind": "value", - "name": "sort", - "docstrings": [ - "`sort(list, f)` returns a sorted list.\n\n## Examples\n\n```rescript\nList.sort(list{5, 4, 9, 3, 7}, Int.compare) // list{3, 4, 5, 7, 9}\n```" - ], - "signature": "let sort: (t<'a>, ('a, 'a) => Core__Ordering.t) => t<'a>" - } - ] - }, - "core/option": { - "id": "Core.Option", - "name": "Option", - "docstrings": [ - "We represent the existence and nonexistence of a value by wrapping it with\nthe `option` type. In order to make it a bit more convenient to work with\noption-types, we provide utility-functions for it.\n\nThe `option` type is a part of the ReScript standard library which is defined\nlike this:\n\n```rescript\ntype option<'a> = None | Some('a)\n```\n\n```rescript\nlet someString: option = Some(\"hello\")\n```" - ], - "items": [ + "name": "findLastIndexWithIndex", + "docstrings": [], + "signature": "let findLastIndexWithIndex: (t<'a>, ('a, int) => bool) => int" + }, { - "id": "Core.Option.filter", + "id": "Stdlib.TypedArray.forEach", "kind": "value", - "name": "filter", - "docstrings": [ - "`filter(opt, f)` applies `f` to `opt`, if `f` returns `true`, then it returns `Some(value)`, otherwise returns `None`.\n\n## Examples\n\n```rescript\nOption.filter(Some(10), x => x > 5) // Some(10)\nOption.filter(Some(4), x => x > 5) // None\nOption.filter(None, x => x > 5) // None\n```" - ], - "signature": "let filter: (option<'a>, 'a => bool) => option<'a>" + "name": "forEach", + "docstrings": [], + "signature": "let forEach: (t<'a>, 'a => unit) => unit" }, { - "id": "Core.Option.forEach", + "id": "Stdlib.TypedArray.forEachWithIndex", "kind": "value", - "name": "forEach", - "docstrings": [ - "`forEach(opt, f)` call `f` on `opt`. if `opt` is `Some(value)`, then if calls\n`f`, otherwise returns `unit`.\n\n## Examples\n\n```rescript\nOption.forEach(Some(\"thing\"), x => Console.log(x)) // logs \"thing\"\nOption.forEach(None, x => Console.log(x)) // returns ()\n```" - ], - "signature": "let forEach: (option<'a>, 'a => unit) => unit" + "name": "forEachWithIndex", + "docstrings": [], + "signature": "let forEachWithIndex: (t<'a>, ('a, int) => unit) => unit" }, { - "id": "Core.Option.getExn", + "id": "Stdlib.TypedArray.map", "kind": "value", - "name": "getExn", - "docstrings": [ - "`getExn(opt, ~message=?)` returns `value` if `opt` is `Some(value)`, otherwise raises an exception with the message provided, or a generic message if no message was provided.\n\n```rescript\nOption.getExn(Some(3)) // 3\nOption.getExn(None) /* Raises an Error */\nOption.getExn(None, ~message=\"was None!\") /* Raises an Error with the message \"was None!\" */\n```\n\n## Exceptions\n\n- Raises an error if `opt` is `None`" - ], - "signature": "let getExn: (option<'a>, ~message: string=?) => 'a" + "name": "map", + "docstrings": [], + "signature": "let map: (t<'a>, 'a => 'b) => t<'b>" }, { - "id": "Core.Option.getUnsafe", + "id": "Stdlib.TypedArray.mapWithIndex", "kind": "value", - "name": "getUnsafe", - "docstrings": [ - "`getUnsafe(opt)` returns `value` if `opt` is `Some(value)`, otherwise `undefined`.\n\n## Examples\n\n```rescript\nOption.getUnsafe(Some(3)) == 3\nOption.getUnsafe(None: option) // Returns `undefined`, which is not a valid `int`\n```\n\n## Notes\n\n- This is an unsafe operation. It assumes `value` is not `None`, and may cause undefined behaviour if it is." - ], - "signature": "let getUnsafe: option<'a> => 'a" + "name": "mapWithIndex", + "docstrings": [], + "signature": "let mapWithIndex: (t<'a>, ('a, int) => 'b) => t<'b>" }, { - "id": "Core.Option.mapOr", + "id": "Stdlib.TypedArray.reduce", "kind": "value", - "name": "mapOr", - "docstrings": [ - "`mapOr(opt, default, f)` returns `f(value)` if `opt` is `Some(value)`, otherwise `default`.\n\n## Examples\n\n```rescript\nlet someValue = Some(3)\nsomeValue->Option.mapOr(0, x => x + 5) // 8\n\nlet noneValue = None\nnoneValue->Option.mapOr(0, x => x + 5) // 0\n```" - ], - "signature": "let mapOr: (option<'a>, 'b, 'a => 'b) => 'b" + "name": "reduce", + "docstrings": [], + "signature": "let reduce: (t<'a>, ('b, 'a) => 'b, 'b) => 'b" }, { - "id": "Core.Option.mapWithDefault", + "id": "Stdlib.TypedArray.reduceWithIndex", "kind": "value", - "name": "mapWithDefault", + "name": "reduceWithIndex", "docstrings": [], - "signature": "let mapWithDefault: (option<'a>, 'b, 'a => 'b) => 'b", - "deprecated": "Use mapOr instead" + "signature": "let reduceWithIndex: (t<'a>, ('b, 'a, int) => 'b, 'b) => 'b" }, { - "id": "Core.Option.map", + "id": "Stdlib.TypedArray.reduceRight", "kind": "value", - "name": "map", - "docstrings": [ - "`map(opt, f)` returns `Some(f(value))` if `opt` is `Some(value)`, otherwise `None`.\n\n## Examples\n\n```rescript\nOption.map(Some(3), x => x * x) // Some(9)\nOption.map(None, x => x * x) // None\n```" - ], - "signature": "let map: (option<'a>, 'a => 'b) => option<'b>" + "name": "reduceRight", + "docstrings": [], + "signature": "let reduceRight: (t<'a>, ('b, 'a) => 'b, 'b) => 'b" }, { - "id": "Core.Option.flatMap", + "id": "Stdlib.TypedArray.reduceRightWithIndex", "kind": "value", - "name": "flatMap", - "docstrings": [ - "`flatMap(opt, f)` returns `f(value)` if `opt` is `Some(value)`, otherwise `None`.\n\n## Examples\n\n```rescript\nlet addIfAboveOne = value =>\n if (value > 1) {\n Some(value + 1)\n } else {\n None\n }\n\nOption.flatMap(Some(2), addIfAboveOne) // Some(3)\nOption.flatMap(Some(-4), addIfAboveOne) // None\nOption.flatMap(None, addIfAboveOne) // None\n```" - ], - "signature": "let flatMap: (option<'a>, 'a => option<'b>) => option<'b>" + "name": "reduceRightWithIndex", + "docstrings": [], + "signature": "let reduceRightWithIndex: (t<'a>, ('b, 'a, int) => 'b, 'b) => 'b" }, { - "id": "Core.Option.getOr", + "id": "Stdlib.TypedArray.some", "kind": "value", - "name": "getOr", - "docstrings": [ - "`getOr(opt, default)` returns `value` if `opt` is `Some(value)`, otherwise `default`.\n\n## Examples\n\n```rescript\nOption.getOr(None, \"Banana\") // Banana\nOption.getOr(Some(\"Apple\"), \"Banana\") // Apple\n\nlet greet = (firstName: option) =>\n \"Greetings \" ++ firstName->Option.getOr(\"Anonymous\")\n\nSome(\"Jane\")->greet // \"Greetings Jane\"\nNone->greet // \"Greetings Anonymous\"\n```" - ], - "signature": "let getOr: (option<'a>, 'a) => 'a" + "name": "some", + "docstrings": [], + "signature": "let some: (t<'a>, 'a => bool) => bool" }, { - "id": "Core.Option.getWithDefault", + "id": "Stdlib.TypedArray.someWithIndex", "kind": "value", - "name": "getWithDefault", + "name": "someWithIndex", "docstrings": [], - "signature": "let getWithDefault: (option<'a>, 'a) => 'a", - "deprecated": "Use getOr instead" + "signature": "let someWithIndex: (t<'a>, ('a, int) => bool) => bool" }, { - "id": "Core.Option.orElse", + "id": "Stdlib.TypedArray.ignore", "kind": "value", - "name": "orElse", + "name": "ignore", "docstrings": [ - "`orElse(opt1, opt2)` returns `opt2` if `opt1` is `None`, otherwise `opt1`.\n\n## Examples\n\n```rescript\nOption.orElse(Some(1812), Some(1066)) == Some(1812)\nOption.orElse(None, Some(1066)) == Some(1066)\nOption.orElse(None, None) == None\n```" + "`ignore(typedArray)` ignores the provided typedArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." ], - "signature": "let orElse: (option<'a>, option<'a>) => option<'a>" + "signature": "let ignore: t<'a> => unit" + } + ] + }, + "stdlib/arraybuffer": { + "id": "Stdlib.ArrayBuffer", + "name": "ArrayBuffer", + "docstrings": [], + "items": [ + { + "id": "Stdlib.ArrayBuffer.t", + "kind": "type", + "name": "t", + "docstrings": [], + "signature": "type t" }, { - "id": "Core.Option.isSome", + "id": "Stdlib.ArrayBuffer.make", "kind": "value", - "name": "isSome", - "docstrings": [ - "`isSome(opt)` returns `true` if `opt` is `Some(value)`, otherwise returns `false`.\n\n## Examples\n\n```rescript\nOption.isSome(None) // false\nOption.isSome(Some(1)) // true\n```" - ], - "signature": "let isSome: option<'a> => bool" + "name": "make", + "docstrings": [], + "signature": "let make: int => t" }, { - "id": "Core.Option.isNone", + "id": "Stdlib.ArrayBuffer.byteLength", "kind": "value", - "name": "isNone", - "docstrings": [ - "`isNone(opt)` returns `true` if `opt` is `None`, false otherwise.\n\n## Examples\n\n```rescript\nOption.isNone(None) // true\nOption.isNone(Some(1)) // false\n```" - ], - "signature": "let isNone: option<'a> => bool" + "name": "byteLength", + "docstrings": [], + "signature": "let byteLength: t => int" }, { - "id": "Core.Option.equal", + "id": "Stdlib.ArrayBuffer.slice", "kind": "value", - "name": "equal", - "docstrings": [ - "`equal(opt1, opt2, f)` evaluates two optional values for equality with respect to a predicate function `f`. If both `opt1` and `opt2` are `None`, returns `true`.\nIf one of the arguments is `Some(value)` and the other is `None`, returns\n`false`.\nIf arguments are `Some(value1)` and `Some(value2)`, returns the result of\n`f(value1, value2)`, the predicate function `f` must return a bool.\n\n## Examples\n\n```rescript\nlet clockEqual = (a, b) => mod(a, 12) == mod(b, 12)\n\nopen Option\n\nequal(Some(3), Some(15), clockEqual) // true\nequal(Some(3), None, clockEqual) // false\nequal(None, Some(3), clockEqual) // false\nequal(None, None, clockEqual) // true\n```" - ], - "signature": "let equal: (option<'a>, option<'b>, ('a, 'b) => bool) => bool" + "name": "slice", + "docstrings": [], + "signature": "let slice: (t, ~start: int, ~end: int) => t" }, { - "id": "Core.Option.compare", + "id": "Stdlib.ArrayBuffer.sliceToEnd", "kind": "value", - "name": "compare", - "docstrings": [ - "`compare(opt1, opt2, f)` compares two optional values with respect to given `f`.\n\nIf both `opt1` and `opt2` are `None`, it returns `0.`. If the first argument is `Some(value1)` and the second is `None`, returns `1.` (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`f(value1, value2)`, `f` takes two arguments and returns `-1.` if the first\nargument is less than the second, `0.` if the arguments are equal, and `1.` if\nthe first argument is greater than the second.\n\n## Examples\n\n```rescript\nlet clockCompare = (a, b) => Int.compare(mod(a, 12), mod(b, 12))\n\nOption.compare(Some(3), Some(15), clockCompare) // 0.\nOption.compare(Some(3), Some(14), clockCompare) // 1.\nOption.compare(Some(2), Some(15), clockCompare) // (-1.)\nOption.compare(None, Some(15), clockCompare) // (-1.)\nOption.compare(Some(14), None, clockCompare) // 1.\nOption.compare(None, None, clockCompare) // 0.\n```" - ], - "signature": "let compare: (\n option<'a>,\n option<'b>,\n ('a, 'b) => Core__Ordering.t,\n) => Core__Ordering.t" + "name": "sliceToEnd", + "docstrings": [], + "signature": "let sliceToEnd: (t, ~start: int) => t" } ] }, - "core/exn": { - "id": "Core.Exn", - "name": "Exn", - "docstrings": [], - "items": [] - }, - "core/intl": { - "id": "Core.Intl", - "name": "Intl", + "stdlib/weakset": { + "id": "Stdlib.WeakSet", + "name": "WeakSet", "docstrings": [], "items": [ { - "id": "Core.Intl.getCanonicalLocalesExn", + "id": "Stdlib.WeakSet.t", + "kind": "type", + "name": "t", + "docstrings": [], + "signature": "type t<'a>" + }, + { + "id": "Stdlib.WeakSet.make", "kind": "value", - "name": "getCanonicalLocalesExn", - "docstrings": [ - "@throws RangeError" - ], - "signature": "let getCanonicalLocalesExn: string => array" + "name": "make", + "docstrings": [], + "signature": "let make: unit => t<'a>" }, { - "id": "Core.Intl.getCanonicalLocalesManyExn", + "id": "Stdlib.WeakSet.add", "kind": "value", - "name": "getCanonicalLocalesManyExn", - "docstrings": [ - "@throws RangeError" - ], - "signature": "let getCanonicalLocalesManyExn: array => array" + "name": "add", + "docstrings": [], + "signature": "let add: (t<'a>, 'a) => t<'a>" }, { - "id": "Core.Intl.supportedValuesOfExn", + "id": "Stdlib.WeakSet.delete", "kind": "value", - "name": "supportedValuesOfExn", + "name": "delete", + "docstrings": [], + "signature": "let delete: (t<'a>, 'a) => bool" + }, + { + "id": "Stdlib.WeakSet.has", + "kind": "value", + "name": "has", + "docstrings": [], + "signature": "let has: (t<'a>, 'a) => bool" + }, + { + "id": "Stdlib.WeakSet.ignore", + "kind": "value", + "name": "ignore", "docstrings": [ - "@throws RangeError" + "`ignore(weakSet)` ignores the provided weakSet and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." ], - "signature": "let supportedValuesOfExn: string => array" + "signature": "let ignore: t<'a> => unit" } ] }, - "core/biguint64array": { - "id": "Core.BigUint64Array", - "name": "BigUint64Array", - "docstrings": [], + "stdlib/set": { + "id": "Stdlib.Set", + "name": "Set", + "docstrings": [ + "Bindings to the mutable JavaScript `Set`.\n\nSee [`Set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) on MDN." + ], "items": [ { - "id": "Core.BigUint64Array.t", + "id": "Stdlib.Set.t", "kind": "type", "name": "t", "docstrings": [ - "The `BigUint64Array` typed array represents an array of 64-bit unsigned integers in platform byte order. See [BigUint64Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigUint64Array)" - ], - "signature": "type t = Core__TypedArray.t" - }, - { - "id": "Core.BigUint64Array.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray` creates a `BigUint64Array` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigUint64Array/BigUint64Array)" - ], - "signature": "let fromArray: array => t" - }, - { - "id": "Core.BigUint64Array.fromBuffer", - "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "`fromBuffer` creates a `BigUint64Array` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigUint64Array/BigUint64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." + "Type representing an instance of `Set`." ], - "signature": "let fromBuffer: Core__ArrayBuffer.t => t" + "signature": "type t<'a>" }, { - "id": "Core.BigUint64Array.fromBufferToEnd", + "id": "Stdlib.Set.make", "kind": "value", - "name": "fromBufferToEnd", + "name": "make", "docstrings": [ - "`fromBufferToEnd` creates a `BigUint64Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigUint64Array/BigUint64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." + "Creates a new, mutable JavaScript `Set`. A `Set` is a collection of unique values.\n\nSee [`Set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) on MDN.\n\n\n\n## Examples\n```rescript\n// You can annotate the type of your set if you want to\nlet mySet: Set.t = Set.make()\n\n// Or you can let ReScript infer what's in your Set\nlet set = Set.make()\nset->Set.add(\"Fine name\") // Inferred as Set.t\n```\n\n## Alternatives\nA JavaScript `Set` is mutable. If you're looking for an immutable alternative, check out `Belt.Set`." ], - "signature": "let fromBufferToEnd: (Core__ArrayBuffer.t, ~byteOffset: int) => t" + "signature": "let make: unit => t<'a>" }, { - "id": "Core.BigUint64Array.fromBufferWithRange", + "id": "Stdlib.Set.fromArray", "kind": "value", - "name": "fromBufferWithRange", + "name": "fromArray", "docstrings": [ - "`fromBufferWithRange` creates a `BigUint64Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigUint64Array/BigUint64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." + "Turns an array of values into a Set. Meaning only unique values are preserved.\n\n## Examples\n```rescript\ntype languages = ReScript | JavaScript | TypeScript\nlet languageRank = [ReScript, JavaScript, TypeScript]\n\nlet set = Set.fromArray(languageRank) // Set.t\n\nswitch set->Set.has(ReScript) {\n| true => Console.log(\"Yay, ReScript is in there!\")\n| false => Console.log(\"Uh-oh, something is _terribly_ wrong with this program... abort.\")\n}\n```" ], - "signature": "let fromBufferWithRange: (Core__ArrayBuffer.t, ~byteOffset: int, ~length: int) => t" + "signature": "let fromArray: array<'a> => t<'a>" }, { - "id": "Core.BigUint64Array.fromLength", + "id": "Stdlib.Set.fromIterator", "kind": "value", - "name": "fromLength", + "name": "fromIterator", "docstrings": [ - "`fromLength` creates a zero-initialized `BigUint64Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigUint64Array/BigUint64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." + "Turns an iterator into a `Set`.\n\n## Examples\n\n```rescript\n// Let's pretend we have an interator\nlet iterator: Iterator.t = %raw(`\n (() => {\n var array1 = ['a', 'b', 'c'];\n var iterator1 = array1[Symbol.iterator]();\n return iterator1\n })()\n`)\n\niterator\n->Set.fromIterator\n->Set.size\n->assertEqual(3)\n```" ], - "signature": "let fromLength: int => t" + "signature": "let fromIterator: Iterator.t<'a> => t<'a>" }, { - "id": "Core.BigUint64Array.fromArrayLikeOrIterable", + "id": "Stdlib.Set.size", "kind": "value", - "name": "fromArrayLikeOrIterable", + "name": "size", "docstrings": [ - "`fromArrayLikeOrIterable` creates a `BigUint64Array` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" + "Returns the size, the number of unique values, of the set.\n\nSee [`Set.prototype.size`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/size) on MDN.\n\n## Examples\n```rescript\nlet set = Set.make()\n\nset->Set.add(\"someValue\")\nset->Set.add(\"someValue\")\nset->Set.add(\"someValue2\")\n\nlet size = set->Set.size // 2\n```" ], - "signature": "let fromArrayLikeOrIterable: 'a => t" + "signature": "let size: t<'a> => int" }, { - "id": "Core.BigUint64Array.fromArrayLikeOrIterableWithMap", + "id": "Stdlib.Set.clear", "kind": "value", - "name": "fromArrayLikeOrIterableWithMap", - "docstrings": [ - "`fromArrayLikeOrIterableWithMap` creates a `BigUint64Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => bigint) => t" - } - ] - }, - "core/bigint64array": { - "id": "Core.BigInt64Array", - "name": "BigInt64Array", - "docstrings": [], - "items": [ - { - "id": "Core.BigInt64Array.t", - "kind": "type", - "name": "t", + "name": "clear", "docstrings": [ - "The `BigInt64Array` typed array represents an array of 64-bit signed integers in platform byte order. See [BigInt64Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt64Array)" + "Clears all entries in the set.\n\nSee [`Set.clear`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/clear) on MDN.\n\n## Examples\n```rescript\nlet set = Set.make()\n\nset->Set.add(\"someKey\")\nset->Set.size // 1\n\nset->Set.clear\nset->Set.size // 0\n```" ], - "signature": "type t = Core__TypedArray.t" + "signature": "let clear: t<'a> => unit" }, { - "id": "Core.BigInt64Array.fromArray", + "id": "Stdlib.Set.add", "kind": "value", - "name": "fromArray", + "name": "add", "docstrings": [ - "`fromArray` creates a `BigInt64Array` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt64Array/BigInt64Array)" + "Adds a new value to the set.\n\nSee [`Set.add`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/add) on MDN.\n\n## Examples\n```rescript\nlet set = Set.make()\nset->Set.add(\"someValue\")\n```" ], - "signature": "let fromArray: array => t" + "signature": "let add: (t<'a>, 'a) => unit" }, { - "id": "Core.BigInt64Array.fromBuffer", + "id": "Stdlib.Set.delete", "kind": "value", - "name": "fromBuffer", + "name": "delete", "docstrings": [ - "`fromBuffer` creates a `BigInt64Array` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt64Array/BigInt64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." + "Deletes the provided `value` from the set. Returns a `bool` for whether the value existed, and was deleted.\n\nSee [`Set.delete`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/delete) on MDN.\n\n## Examples\n```rescript\nlet set = Set.make()\nset->Set.add(\"someValue\")\nlet didDeleteValue = set->Set.delete(\"someValue\")\nConsole.log(didDeleteValue) // Logs `true` to the console, becuase the set had the value, so it was successfully deleted\n\nlet didDeleteValue = set->Set.delete(\"someNonExistantKey\")\nConsole.log(didDeleteValue) // Logs `false` to the console, becuase the value did not exist in the set\n```" ], - "signature": "let fromBuffer: Core__ArrayBuffer.t => t" + "signature": "let delete: (t<'a>, 'a) => bool" }, { - "id": "Core.BigInt64Array.fromBufferToEnd", + "id": "Stdlib.Set.has", "kind": "value", - "name": "fromBufferToEnd", + "name": "has", "docstrings": [ - "`fromBufferToEnd` creates a `BigInt64Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt64Array/BigInt64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." + "Checks whether the set has a specific value.\n\nSee [`Set.has`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/has) on MDN.\n\n## Examples\n```rescript\nlet set = Set.make()\nset->Set.add(\"someValue\")\n\nswitch set->Set.has(\"someValue\") {\n| false => Console.log(\"Nope, didn't have it.\")\n| true => Console.log(\"Yay, we have the value!\")\n}\n```" ], - "signature": "let fromBufferToEnd: (Core__ArrayBuffer.t, ~byteOffset: int) => t" + "signature": "let has: (t<'a>, 'a) => bool" }, { - "id": "Core.BigInt64Array.fromBufferWithRange", + "id": "Stdlib.Set.forEach", "kind": "value", - "name": "fromBufferWithRange", + "name": "forEach", "docstrings": [ - "`fromBufferWithRange` creates a `BigInt64Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt64Array/BigInt64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." + "Iterates through all values of the set.\n\nSee [`Set.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/forEach) on MDN.\n\n## Examples\n```rescript\nlet set = Set.make()\nset->Set.add(\"someValue\")\nset->Set.add(\"someValue2\")\n\nset->Set.forEach(value => {\n Console.log(value)\n})\n```" ], - "signature": "let fromBufferWithRange: (Core__ArrayBuffer.t, ~byteOffset: int, ~length: int) => t" + "signature": "let forEach: (t<'a>, 'a => unit) => unit" }, { - "id": "Core.BigInt64Array.fromLength", + "id": "Stdlib.Set.values", "kind": "value", - "name": "fromLength", + "name": "values", "docstrings": [ - "`fromLength` creates a zero-initialized `BigInt64Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt64Array/BigInt64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." + "Returns an iterator that holds all values of the set.\n\nSee [`Set.values`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/values) on MDN.\n\n## Examples\n```rescript\nlet set = Set.make()\nset->Set.add(\"someValue\")\nset->Set.add(\"anotherValue\")\n\nlet values = set->Set.values\n\n// Logs the first value\nConsole.log(Iterator.next(values).value)\n\n// You can also turn the iterator into an array.\n// Remember that an iterator consumes values. We'll need a fresh values iterator to get an array of all values, since we consumed a value via `next` above already.\nConsole.log(set->Set.values->Iterator.toArray)\n```" ], - "signature": "let fromLength: int => t" + "signature": "let values: t<'a> => Iterator.t<'a>" }, { - "id": "Core.BigInt64Array.fromArrayLikeOrIterable", + "id": "Stdlib.Set.difference", "kind": "value", - "name": "fromArrayLikeOrIterable", + "name": "difference", "docstrings": [ - "`fromArrayLikeOrIterable` creates a `BigInt64Array` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" + "Returns a new set with the values of the set that are not in the other set.\n\nSee [`Set.difference`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/difference) on MDN.\n\n## Examples\n```rescript\nlet set1 = Set.fromArray([\"apple\", \"orange\", \"banana\"])\nlet set2 = Set.fromArray([\"apple\", \"banana\", \"pear\"])\nset1->Set.difference(set2) // Set.fromArray([\"orange\"])\n```" ], - "signature": "let fromArrayLikeOrIterable: 'a => t" + "signature": "let difference: (t<'a>, t<'a>) => t<'a>" }, { - "id": "Core.BigInt64Array.fromArrayLikeOrIterableWithMap", + "id": "Stdlib.Set.symmetricDifference", "kind": "value", - "name": "fromArrayLikeOrIterableWithMap", - "docstrings": [ - "`fromArrayLikeOrIterableWithMap` creates a `BigInt64Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => bigint) => t" - } - ] - }, - "core/uint8clampedarray": { - "id": "Core.Uint8ClampedArray", - "name": "Uint8ClampedArray", - "docstrings": [], - "items": [ - { - "id": "Core.Uint8ClampedArray.t", - "kind": "type", - "name": "t", + "name": "symmetricDifference", "docstrings": [ - "The `Uint8ClampedArray` typed array represents an array of 8-bit unsigned integers clamped to 0-255. See [Uint8ClampedArray on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray)" + "Returns a new set with the values containing the values which are in either the set, but not in both.\n\nSee [`Set.symmetricDifference`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/symmetricDifference) on MDN.\n\n## Examples\n```rescript\nlet set1 = Set.fromArray([\"apple\", \"orange\", \"banana\"])\nlet set2 = Set.fromArray([\"apple\", \"banana\", \"pear\"])\nset1->Set.symmetricDifference(set2) // Set.fromArray([\"orange\", \"pear\"])\n```" ], - "signature": "type t = Core__TypedArray.t" + "signature": "let symmetricDifference: (t<'a>, t<'a>) => t<'a>" }, { - "id": "Core.Uint8ClampedArray.fromArray", + "id": "Stdlib.Set.intersection", "kind": "value", - "name": "fromArray", + "name": "intersection", "docstrings": [ - "`fromArray` creates a `Uint8ClampedArray` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray/Uint8ClampedArray)" + "Returns a new set with the values containing the values which are in both the set and the other set.\n\nSee [`Set.intersection`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/intersection) on MDN.\n\n## Examples\n```rescript\nlet set1 = Set.fromArray([\"apple\", \"orange\", \"banana\"])\nlet set2 = Set.fromArray([\"apple\", \"banana\", \"pear\"])\nset1->Set.intersection(set2) // Set.fromArray([\"apple\", \"banana\"])\n```" ], - "signature": "let fromArray: array => t" + "signature": "let intersection: (t<'a>, t<'a>) => t<'a>" }, { - "id": "Core.Uint8ClampedArray.fromBuffer", + "id": "Stdlib.Set.isDisjointFrom", "kind": "value", - "name": "fromBuffer", + "name": "isDisjointFrom", "docstrings": [ - "`fromBuffer` creates a `Uint8ClampedArray` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray/Uint8ClampedArray)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." + "Returns a bool indicating if this set has no elements in common with the given set.\n\nSee [`Set.isDisjointFrom`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/isDisjointFrom) on MDN.\n\n## Examples\n```rescript\nlet set1 = Set.fromArray([\"apple\", \"orange\", \"banana\"])\nlet set2 = Set.fromArray([\"kiwi\", \"melon\", \"pear\"])\nset1->Set.isDisjointFrom(set2) // true\n```" ], - "signature": "let fromBuffer: Core__ArrayBuffer.t => t" + "signature": "let isDisjointFrom: (t<'a>, t<'a>) => bool" }, { - "id": "Core.Uint8ClampedArray.fromBufferToEnd", + "id": "Stdlib.Set.isSubsetOf", "kind": "value", - "name": "fromBufferToEnd", + "name": "isSubsetOf", "docstrings": [ - "`fromBufferToEnd` creates a `Uint8ClampedArray` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray/Uint8ClampedArray)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." + "Returns a bool indicating if the all values in the set are in the given set.\n\nSee [`Set.isSubsetOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/isSubsetOf) on MDN.\n\n## Examples\n```rescript\nlet set1 = Set.fromArray([\"apple\", \"banana\"])\nlet set2 = Set.fromArray([\"apple\", \"banana\", \"pear\"])\nset1->Set.isSubsetOf(set2) // true\n```" ], - "signature": "let fromBufferToEnd: (Core__ArrayBuffer.t, ~byteOffset: int) => t" + "signature": "let isSubsetOf: (t<'a>, t<'a>) => bool" }, { - "id": "Core.Uint8ClampedArray.fromBufferWithRange", + "id": "Stdlib.Set.isSupersetOf", "kind": "value", - "name": "fromBufferWithRange", + "name": "isSupersetOf", "docstrings": [ - "`fromBufferWithRange` creates a `Uint8ClampedArray` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray/Uint8ClampedArray)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." + "Returns a bool indicating if the all values in the given set are in the set.\n\nSee [`Set.isSupersetOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/isSupersetOf) on MDN.\n\n## Examples\n```rescript\nlet set1 = Set.fromArray([\"apple\", \"banana\", \"pear\"])\nlet set2 = Set.fromArray([\"apple\", \"banana\"])\nset1->Set.isSupersetOf(set2) // true\n ```" ], - "signature": "let fromBufferWithRange: (Core__ArrayBuffer.t, ~byteOffset: int, ~length: int) => t" + "signature": "let isSupersetOf: (t<'a>, t<'a>) => bool" }, { - "id": "Core.Uint8ClampedArray.fromLength", + "id": "Stdlib.Set.union", "kind": "value", - "name": "fromLength", + "name": "union", "docstrings": [ - "`fromLength` creates a zero-initialized `Uint8ClampedArray` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray/Uint8ClampedArray)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." + "Returns a new set with the values of the set that are in both the set and the other set.\n\nSee [`Set.union`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/union) on MDN.\n\n## Examples\n```rescript\nlet set1 = Set.fromArray([\"apple\", \"orange\", \"banana\"])\nlet set2 = Set.fromArray([\"apple\", \"banana\", \"pear\"])\nset1->Set.union(set2) // Set.fromArray([\"apple\", \"orange\", \"banana\", \"pear\"])\n```" ], - "signature": "let fromLength: int => t" + "signature": "let union: (t<'a>, t<'a>) => t<'a>" }, { - "id": "Core.Uint8ClampedArray.fromArrayLikeOrIterable", + "id": "Stdlib.Set.toArray", "kind": "value", - "name": "fromArrayLikeOrIterable", + "name": "toArray", "docstrings": [ - "`fromArrayLikeOrIterable` creates a `Uint8ClampedArray` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" + "`toArray(set)` returns an array of all values of the set.\n\nSee [`Array.from`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from) on MDN.\n\n## Examples\n```rescript\nlet set = Set.fromArray([\"apple\", \"orange\", \"apple\", \"banana\"])\nset->Set.toArray // [\"apple\", \"orange\", \"banana\"]\n```" ], - "signature": "let fromArrayLikeOrIterable: 'a => t" + "signature": "let toArray: t<'a> => array<'a>" }, { - "id": "Core.Uint8ClampedArray.fromArrayLikeOrIterableWithMap", + "id": "Stdlib.Set.ignore", "kind": "value", - "name": "fromArrayLikeOrIterableWithMap", + "name": "ignore", "docstrings": [ - "`fromArrayLikeOrIterableWithMap` creates a `Uint8ClampedArray` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" + "`ignore(set)` ignores the provided set and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." ], - "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => int) => t" + "signature": "let ignore: t<'a> => unit" } ] }, - "core/uint32array": { - "id": "Core.Uint32Array", - "name": "Uint32Array", + "stdlib/weakmap": { + "id": "Stdlib.WeakMap", + "name": "WeakMap", "docstrings": [], "items": [ { - "id": "Core.Uint32Array.t", + "id": "Stdlib.WeakMap.t", "kind": "type", "name": "t", - "docstrings": [ - "The `Uint32Array` typed array represents an array of 32-bit unsigned integers in platform byte order. See [Uint32Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array)" - ], - "signature": "type t = Core__TypedArray.t" - }, - { - "id": "Core.Uint32Array.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray` creates a `Uint32Array` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array/Uint32Array)" - ], - "signature": "let fromArray: array => t" + "docstrings": [], + "signature": "type t<'k, 'v>" }, { - "id": "Core.Uint32Array.fromBuffer", + "id": "Stdlib.WeakMap.make", "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "`fromBuffer` creates a `Uint32Array` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array/Uint32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBuffer: Core__ArrayBuffer.t => t" + "name": "make", + "docstrings": [], + "signature": "let make: unit => t<'k, 'v>" }, { - "id": "Core.Uint32Array.fromBufferToEnd", + "id": "Stdlib.WeakMap.get", "kind": "value", - "name": "fromBufferToEnd", - "docstrings": [ - "`fromBufferToEnd` creates a `Uint32Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array/Uint32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferToEnd: (Core__ArrayBuffer.t, ~byteOffset: int) => t" + "name": "get", + "docstrings": [], + "signature": "let get: (t<'k, 'v>, 'k) => option<'v>" }, { - "id": "Core.Uint32Array.fromBufferWithRange", + "id": "Stdlib.WeakMap.has", "kind": "value", - "name": "fromBufferWithRange", - "docstrings": [ - "`fromBufferWithRange` creates a `Uint32Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array/Uint32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferWithRange: (Core__ArrayBuffer.t, ~byteOffset: int, ~length: int) => t" + "name": "has", + "docstrings": [], + "signature": "let has: (t<'k, 'v>, 'k) => bool" }, { - "id": "Core.Uint32Array.fromLength", + "id": "Stdlib.WeakMap.set", "kind": "value", - "name": "fromLength", - "docstrings": [ - "`fromLength` creates a zero-initialized `Uint32Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array/Uint32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromLength: int => t" + "name": "set", + "docstrings": [], + "signature": "let set: (t<'k, 'v>, 'k, 'v) => t<'k, 'v>" }, { - "id": "Core.Uint32Array.fromArrayLikeOrIterable", + "id": "Stdlib.WeakMap.delete", "kind": "value", - "name": "fromArrayLikeOrIterable", - "docstrings": [ - "`fromArrayLikeOrIterable` creates a `Uint32Array` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterable: 'a => t" + "name": "delete", + "docstrings": [], + "signature": "let delete: (t<'k, 'v>, 'k) => bool" }, { - "id": "Core.Uint32Array.fromArrayLikeOrIterableWithMap", + "id": "Stdlib.WeakMap.ignore", "kind": "value", - "name": "fromArrayLikeOrIterableWithMap", + "name": "ignore", "docstrings": [ - "`fromArrayLikeOrIterableWithMap` creates a `Uint32Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" + "`ignore(weakMap)` ignores the provided weakMap and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." ], - "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => int) => t" + "signature": "let ignore: t<'k, 'v> => unit" } ] }, - "core/uint16array": { - "id": "Core.Uint16Array", - "name": "Uint16Array", - "docstrings": [], + "stdlib/map": { + "id": "Stdlib.Map", + "name": "Map", + "docstrings": [ + "Bindings to the mutable JavaScript `Map`.\n\nSee [`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) on MDN." + ], "items": [ { - "id": "Core.Uint16Array.t", + "id": "Stdlib.Map.t", "kind": "type", "name": "t", "docstrings": [ - "The `Uint16Array` typed array represents an array of 16-bit unsigned integers in platform byte order. See [Uint16Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array)" + "Type representing an instance of `Map`." ], - "signature": "type t = Core__TypedArray.t" + "signature": "type t<'k, 'v>" }, { - "id": "Core.Uint16Array.fromArray", + "id": "Stdlib.Map.make", "kind": "value", - "name": "fromArray", + "name": "make", "docstrings": [ - "`fromArray` creates a `Uint16Array` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array/Uint16Array)" + "Creates a new, mutable JavaScript `Map`. A `Map` can have any values as both keys and values.\n\nSee [`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) on MDN.\n\n\n\n## Examples\n```rescript\n`make()`\n// You can annotate the type of your map if you want to\nlet myMap: Map.t = Map.make()\n\n// Or you can let ReScript infer what's in your map\nlet map = Map.make()\nmap->Map.set(\"lang\", \"ReScript\") // Inferred as Map.t\n```\n\n## Alternatives\nA JavaScript `Map` is mutable. If you're looking for an immutable alternative, check out`Belt.Map`." ], - "signature": "let fromArray: array => t" + "signature": "let make: unit => t<'k, 'v>" }, { - "id": "Core.Uint16Array.fromBuffer", + "id": "Stdlib.Map.fromArray", "kind": "value", - "name": "fromBuffer", + "name": "fromArray", "docstrings": [ - "`fromBuffer` creates a `Uint16Array` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array/Uint16Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." + "Turns an array of key/value pairs into a Map.\n\n## Examples\n```rescript\ntype languages = ReScript | JavaScript | TypeScript\nlet languageRank = [(ReScript, 1), (JavaScript, 2), (TypeScript, 3)]\n\nlet map = Map.fromArray(languageRank) // Map.t\n\nswitch map->Map.get(ReScript) {\n| Some(1) => Console.log(\"Yay, ReScript is #1!\")\n| _ => Console.log(\"Uh-oh, something is _terribly_ wrong with this program... abort.\")\n}\n```" ], - "signature": "let fromBuffer: Core__ArrayBuffer.t => t" + "signature": "let fromArray: array<('k, 'v)> => t<'k, 'v>" }, { - "id": "Core.Uint16Array.fromBufferToEnd", + "id": "Stdlib.Map.fromIterator", "kind": "value", - "name": "fromBufferToEnd", + "name": "fromIterator", "docstrings": [ - "`fromBufferToEnd` creates a `Uint16Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array/Uint16Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." + "Turns an iterator in the shape of `('key, 'value)` into a `Map`.\n\n## Examples\n\n```rescript\n// Let's pretend we have an interator in the correct shape\nlet iterator: Iterator.t<(string, string)> = %raw(`\n (() => {\n var map1 = new Map();\n\n map1.set('first', '1');\n map1.set('second', '2');\n\n var iterator1 = map1[Symbol.iterator]();\n return iterator1;\n })()\n`)\n\niterator\n->Map.fromIterator\n->Map.size\n->assertEqual(2)\n```" ], - "signature": "let fromBufferToEnd: (Core__ArrayBuffer.t, ~byteOffset: int) => t" + "signature": "let fromIterator: Iterator.t<('k, 'v)> => t<'k, 'v>" }, { - "id": "Core.Uint16Array.fromBufferWithRange", + "id": "Stdlib.Map.size", "kind": "value", - "name": "fromBufferWithRange", + "name": "size", "docstrings": [ - "`fromBufferWithRange` creates a `Uint16Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array/Uint16Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." + "Returns the size, the number of key/value pairs, of the map.\n\n## Examples\n```rescript\nlet map = Map.make()\n\nmap->Map.set(\"someKey\", \"someValue\")\n\nlet size = map->Map.size // 1\n```" ], - "signature": "let fromBufferWithRange: (Core__ArrayBuffer.t, ~byteOffset: int, ~length: int) => t" + "signature": "let size: t<'k, 'v> => int" }, { - "id": "Core.Uint16Array.fromLength", + "id": "Stdlib.Map.clear", "kind": "value", - "name": "fromLength", + "name": "clear", "docstrings": [ - "`fromLength` creates a zero-initialized `Uint16Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array/Uint16Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." + "Clears all entries in the map.\n\n## Examples\n```rescript\nlet map = Map.make()\n\nmap->Map.set(\"someKey\", \"someValue\")\nmap->Map.size // 1\n\nmap->Map.clear\nmap->Map.size // 0\n```" ], - "signature": "let fromLength: int => t" + "signature": "let clear: t<'k, 'v> => unit" }, { - "id": "Core.Uint16Array.fromArrayLikeOrIterable", + "id": "Stdlib.Map.forEach", "kind": "value", - "name": "fromArrayLikeOrIterable", + "name": "forEach", "docstrings": [ - "`fromArrayLikeOrIterable` creates a `Uint16Array` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" + "Iterates through all values of the map.\n\n> Please note that this is *without the keys*, just the values. If you need the key as well, use `Map.forEachWithKey`.\n\n## Examples\n```rescript\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\nmap->Map.set(\"someKey2\", \"someValue2\")\n\nmap->Map.forEach(value => {\n Console.log(value)\n})\n```" ], - "signature": "let fromArrayLikeOrIterable: 'a => t" + "signature": "let forEach: (t<'k, 'v>, 'v => unit) => unit" }, { - "id": "Core.Uint16Array.fromArrayLikeOrIterableWithMap", + "id": "Stdlib.Map.forEachWithKey", "kind": "value", - "name": "fromArrayLikeOrIterableWithMap", + "name": "forEachWithKey", "docstrings": [ - "`fromArrayLikeOrIterableWithMap` creates a `Uint16Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" + "Iterates through all values of the map, including the key for each value.\n\n## Examples\n```rescript\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\nmap->Map.set(\"someKey2\", \"someValue2\")\n\nmap->Map.forEachWithKey((value, key) => {\n Console.log2(value, key)\n})\n```" ], - "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => int) => t" - } - ] - }, - "core/uint8array": { - "id": "Core.Uint8Array", - "name": "Uint8Array", - "docstrings": [], - "items": [ + "signature": "let forEachWithKey: (t<'k, 'v>, ('v, 'k) => unit) => unit" + }, { - "id": "Core.Uint8Array.t", - "kind": "type", - "name": "t", + "id": "Stdlib.Map.get", + "kind": "value", + "name": "get", "docstrings": [ - "The `Uint8Array` typed array represents an array of 8-bit unsigned integers. See [Uint8Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array)" + "Returns the value for a key, if a value exists at that key.\n\n## Examples\n```rescript\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\n\nswitch map->Map.get(\"someKey\") {\n| None => Console.log(\"Nope, didn't have it.\")\n| Some(value) => Console.log2(\"Yay, had the value, and it's:\", value)\n}\n```" ], - "signature": "type t = Core__TypedArray.t" + "signature": "let get: (t<'k, 'v>, 'k) => option<'v>" }, { - "id": "Core.Uint8Array.fromArray", + "id": "Stdlib.Map.has", "kind": "value", - "name": "fromArray", + "name": "has", "docstrings": [ - "`fromArray` creates a `Uint8Array` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array/Uint8Array)" + "Checks whether the map has a specific key.\n\n## Examples\n```rescript\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\n\nswitch map->Map.has(\"someKey\") {\n| false => Console.log(\"Nope, didn't have it.\")\n| true => Console.log(\"Yay, we have the value!\")\n}\n```" ], - "signature": "let fromArray: array => t" + "signature": "let has: (t<'k, 'v>, 'k) => bool" }, { - "id": "Core.Uint8Array.fromBuffer", + "id": "Stdlib.Map.set", "kind": "value", - "name": "fromBuffer", + "name": "set", "docstrings": [ - "`fromBuffer` creates a `Uint8Array` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array/Uint8Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." + "Sets the provided `value` to the provided `key`.\n\n## Examples\n```rescript\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\n```" ], - "signature": "let fromBuffer: Core__ArrayBuffer.t => t" + "signature": "let set: (t<'k, 'v>, 'k, 'v) => unit" }, { - "id": "Core.Uint8Array.fromBufferToEnd", + "id": "Stdlib.Map.delete", "kind": "value", - "name": "fromBufferToEnd", + "name": "delete", "docstrings": [ - "`fromBufferToEnd` creates a `Uint8Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array/Uint8Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." + "Deletes the provided `key` and its value from the map. Returns a `bool` for whether the key existed, and was deleted.\n\n## Examples\n```rescript\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\nlet didDeleteKey = map->Map.delete(\"someKey\")\nConsole.log(didDeleteKey) // Logs `true` to the console, becuase the map had the key, so it was successfully deleted\n\nlet didDeleteKey = map->Map.delete(\"someNonExistantKey\")\nConsole.log(didDeleteKey) // Logs `false` to the console, becuase the key did not exist\n```" ], - "signature": "let fromBufferToEnd: (Core__ArrayBuffer.t, ~byteOffset: int) => t" + "signature": "let delete: (t<'k, 'v>, 'k) => bool" }, { - "id": "Core.Uint8Array.fromBufferWithRange", + "id": "Stdlib.Map.keys", "kind": "value", - "name": "fromBufferWithRange", + "name": "keys", "docstrings": [ - "`fromBufferWithRange` creates a `Uint8Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array/Uint8Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." + "Returns an iterator that holds all keys of the map.\n\n## Examples\n```rescript\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\nmap->Map.set(\"anotherKey\", \"anotherValue\")\n\nlet keys = map->Map.keys\n\n// Logs the first key\nConsole.log(Iterator.next(keys).value)\n\n// You can also turn the iterator into an array.\n// Remember that an iterator consumes values. We'll need a fresh keys iterator to get an array of all keys, since we consumed a value via `next` above already.\nConsole.log(map->Map.keys->Iterator.toArray)\n```" ], - "signature": "let fromBufferWithRange: (Core__ArrayBuffer.t, ~byteOffset: int, ~length: int) => t" + "signature": "let keys: t<'k, 'v> => Iterator.t<'k>" }, { - "id": "Core.Uint8Array.fromLength", + "id": "Stdlib.Map.values", "kind": "value", - "name": "fromLength", + "name": "values", "docstrings": [ - "`fromLength` creates a zero-initialized `Uint8Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array/Uint8Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." + "Returns an iterator that holds all values of the map.\n\n## Examples\n```rescript\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\nmap->Map.set(\"anotherKey\", \"anotherValue\")\n\nlet values = map->Map.values\n\n// Logs the first value\nConsole.log(Iterator.next(values).value)\n\n// You can also turn the iterator into an array.\n// Remember that an iterator consumes values. We'll need a fresh values iterator to get an array of all values, since we consumed a value via `next` above already.\nConsole.log(map->Map.values->Iterator.toArray)\n```" ], - "signature": "let fromLength: int => t" + "signature": "let values: t<'k, 'v> => Iterator.t<'v>" }, { - "id": "Core.Uint8Array.fromArrayLikeOrIterable", + "id": "Stdlib.Map.entries", "kind": "value", - "name": "fromArrayLikeOrIterable", + "name": "entries", "docstrings": [ - "`fromArrayLikeOrIterable` creates a `Uint8Array` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" + "Returns an iterator that holds all entries of the map.\nAn entry is represented as a tuple of `('key, 'value)`,\n\n## Examples\n```rescript\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\nmap->Map.set(\"anotherKey\", \"anotherValue\")\n\nlet entries = map->Map.entries\n\n// Logs the first value\nConsole.log(Iterator.next(entries).value)\n\n// You can also turn the iterator into an array.\n// Remember that an iterator consumes entries. We'll need a fresh entries iterator to get an array of all entries, since we consumed a value via `next` above already.\nConsole.log(map->Map.entries->Iterator.toArray)\n```" ], - "signature": "let fromArrayLikeOrIterable: 'a => t" + "signature": "let entries: t<'k, 'v> => Iterator.t<('k, 'v)>" }, { - "id": "Core.Uint8Array.fromArrayLikeOrIterableWithMap", + "id": "Stdlib.Map.ignore", "kind": "value", - "name": "fromArrayLikeOrIterableWithMap", + "name": "ignore", "docstrings": [ - "`fromArrayLikeOrIterableWithMap` creates a `Uint8Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" + "`ignore(map)` ignores the provided map and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." ], - "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => int) => t" + "signature": "let ignore: t<'k, 'v> => unit" } ] }, - "core/int32array": { - "id": "Core.Int32Array", - "name": "Int32Array", - "docstrings": [], + "stdlib/asynciterator": { + "id": "Stdlib.AsyncIterator", + "name": "AsyncIterator", + "docstrings": [ + "Bindings to async iterators, a way to do async iteration in JavaScript.\n\nSee [async iterator protocols](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#the_async_iterator_and_async_iterable_protocols) on MDN." + ], "items": [ { - "id": "Core.Int32Array.t", + "id": "Stdlib.AsyncIterator.t", "kind": "type", "name": "t", "docstrings": [ - "The `Int32Array` typed array represents an array of twos-complemenet 32-bit signed integers in platform byte order. See [Int32Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array)" + "The type representing an async iterator." ], - "signature": "type t = Core__TypedArray.t" + "signature": "type t<'a>" }, { - "id": "Core.Int32Array.fromArray", - "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray` creates a `Int32Array` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array/Int32Array)" - ], - "signature": "let fromArray: array => t" + "id": "Stdlib.AsyncIterator.value", + "kind": "type", + "name": "value", + "docstrings": [], + "signature": "type value<'a> = {done: bool, value: option<'a>}" }, { - "id": "Core.Int32Array.fromBuffer", + "id": "Stdlib.AsyncIterator.make", "kind": "value", - "name": "fromBuffer", + "name": "make", "docstrings": [ - "`fromBuffer` creates a `Int32Array` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array/Int32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." + "`make(nextFn)`\n\nCreates an async iterator from a function that returns the next value of the iterator.\n\n## Examples\n\n- A simple example, creating an async iterator that returns 1, 2, 3:\n\n```rescript\nlet context = ref(0)\n\nlet asyncIterator = AsyncIterator.make(async () => {\n let currentValue = context.contents\n // Increment current value\n context := currentValue + 1\n\n {\n AsyncIterator.value: Some(currentValue),\n done: currentValue >= 3\n }\n})\n\n// This will log 1, 2, 3\nlet main = async () => await asyncIterator->AsyncIterator.forEach(value =>\n switch value {\n | Some(value) => Console.log(value)\n | None => ()\n }\n)\n\nmain()->ignore\n```" ], - "signature": "let fromBuffer: Core__ArrayBuffer.t => t" + "signature": "let make: (unit => promise>) => t<'value>" }, { - "id": "Core.Int32Array.fromBufferToEnd", + "id": "Stdlib.AsyncIterator.value", "kind": "value", - "name": "fromBufferToEnd", + "name": "value", "docstrings": [ - "`fromBufferToEnd` creates a `Int32Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array/Int32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." + "`value(value)`\n\nShorthand for creating a value object with the provided value, and the `done` property set to false.\n\n## Examples\n\n```rescript\nlet context = ref(0)\n\nlet asyncIterator = AsyncIterator.make(async () => {\n let currentValue = context.contents\n // Increment current value\n context := currentValue + 1\n \n if currentValue >= 3 {\n AsyncIterator.done()\n } else {\n AsyncIterator.value(currentValue)\n }\n})\n```" ], - "signature": "let fromBufferToEnd: (Core__ArrayBuffer.t, ~byteOffset: int) => t" + "signature": "let value: 'value => value<'value>" }, { - "id": "Core.Int32Array.fromBufferWithRange", + "id": "Stdlib.AsyncIterator.done", "kind": "value", - "name": "fromBufferWithRange", + "name": "done", "docstrings": [ - "`fromBufferWithRange` creates a `Int32Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array/Int32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." + "`done(~finalValue=?)`\n\n Shorthand for creating a value object with the `done` property set to true, and the provided value as the final value, if any.\n\n ## Examples\n ```rescript\n let context = ref(0)\n\n let asyncIterator = AsyncIterator.make(async () => {\n let currentValue = context.contents\n // Increment current value\n context := currentValue + 1\n \n if currentValue >= 3 {\n AsyncIterator.done()\n } else {\n AsyncIterator.value(currentValue)\n }\n })\n ```" ], - "signature": "let fromBufferWithRange: (Core__ArrayBuffer.t, ~byteOffset: int, ~length: int) => t" + "signature": "let done: (~finalValue: 'value=?) => value<'value>" }, { - "id": "Core.Int32Array.fromLength", + "id": "Stdlib.AsyncIterator.next", "kind": "value", - "name": "fromLength", + "name": "next", "docstrings": [ - "`fromLength` creates a zero-initialized `Int32Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array/Int32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." + "`next(asyncIterator)`\n\nReturns the next value of the iterator, if any.\n\nSee [async iterator protocols](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#the_async_iterator_and_async_iterable_protocols) on MDN.\n\n## Examples\n\n- A simple example, getting the next value:\n\n```rescript\nlet asyncIterator: AsyncIterator.t<(string, string)> = %raw(`\n (() => {\n var map1 = new Map();\n\n map1.set('first', '1');\n map1.set('second', '2');\n\n var iterator1 = map1[Symbol.iterator]();\n return iterator1;\n })()\n`)\n\nlet processMyAsyncIterator = async () => {\n // ReScript doesn't have `for ... of` loops, but it's easy to mimic using a while loop.\n let break = ref(false)\n\n while !break.contents {\n // Await the next iterator value\n let {value, done} = await asyncIterator->AsyncIterator.next\n\n // Exit the while loop if the iterator says it's done\n break := done\n\n if done {\n value\n ->Option.isNone\n ->assertEqual(true)\n }\n }\n}\n\nprocessMyAsyncIterator()->ignore\n```" ], - "signature": "let fromLength: int => t" + "signature": "let next: t<'a> => promise>" }, { - "id": "Core.Int32Array.fromArrayLikeOrIterable", + "id": "Stdlib.AsyncIterator.forEach", "kind": "value", - "name": "fromArrayLikeOrIterable", + "name": "forEach", "docstrings": [ - "`fromArrayLikeOrIterable` creates a `Int32Array` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" + "`forEach(iterator, fn)` consumes all values in the async iterator and runs the callback `fn` for each value.\n\nSee [iterator protocols](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) on MDN.\n\n## Examples\n\n```rescript\n// Let's pretend we get an async iterator returning ints from somewhere.\nlet asyncIterator: AsyncIterator.t<(string, string)> = %raw(`\n (() => {\n var map1 = new Map();\n\n map1.set('first', '1');\n map1.set('second', '2');\n\n var iterator1 = map1[Symbol.iterator]();\n return iterator1;\n })()\n`)\n\nlet main = async () =>\n await asyncIterator->AsyncIterator.forEach(v => {\n switch v {\n | Some((\"second\", value)) => assertEqual(value, \"2\")\n | _ => ()\n }\n })\n\nmain()->ignore\n```" ], - "signature": "let fromArrayLikeOrIterable: 'a => t" + "signature": "let forEach: (t<'a>, option<'a> => unit) => promise" }, { - "id": "Core.Int32Array.fromArrayLikeOrIterableWithMap", + "id": "Stdlib.AsyncIterator.ignore", "kind": "value", - "name": "fromArrayLikeOrIterableWithMap", + "name": "ignore", "docstrings": [ - "`fromArrayLikeOrIterableWithMap` creates a `Int32Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" + "`ignore(iterator)` ignores the provided async iterator and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." ], - "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => int) => t" + "signature": "let ignore: t<'a> => unit" } ] }, - "core/int16array": { - "id": "Core.Int16Array", - "name": "Int16Array", - "docstrings": [], + "stdlib/iterator": { + "id": "Stdlib.Iterator", + "name": "Iterator", + "docstrings": [ + "Bindings to JavaScript iterators.\n\nSee [`Iterator`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator) on MDN." + ], "items": [ { - "id": "Core.Int16Array.t", + "id": "Stdlib.Iterator.t", "kind": "type", "name": "t", "docstrings": [ - "The `Int16Array` typed array represents an array of twos-complement 16-bit signed integers in platform byte order. See [Int16Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array)" + "The type representing an iterator." ], - "signature": "type t = Core__TypedArray.t" + "signature": "type t<'a>" }, { - "id": "Core.Int16Array.fromArray", - "kind": "value", - "name": "fromArray", + "id": "Stdlib.Iterator.value", + "kind": "type", + "name": "value", "docstrings": [ - "`fromArray` creates a `Int16Array` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array/Int16Array)" + "The current value of an iterator." ], - "signature": "let fromArray: array => t" + "signature": "type value<'a> = {done: bool, value: option<'a>}" }, { - "id": "Core.Int16Array.fromBuffer", + "id": "Stdlib.Iterator.next", "kind": "value", - "name": "fromBuffer", + "name": "next", "docstrings": [ - "`fromBuffer` creates a `Int16Array` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array/Int16Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." + "Returns the next value of the iterator, if any.\n\nSee [iterator protocols](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) on MDN.\n\n## Examples\n\n```rescript\nlet iterator: Iterator.t = %raw(`\n (() => {\n var array1 = ['a'];\n var iterator1 = array1[Symbol.iterator]();\n return iterator1\n })()\n`)\n(iterator->Iterator.next).done->assertEqual(false)\n(iterator->Iterator.next).done->assertEqual(true)\n```" ], - "signature": "let fromBuffer: Core__ArrayBuffer.t => t" + "signature": "let next: t<'a> => value<'a>" }, { - "id": "Core.Int16Array.fromBufferToEnd", + "id": "Stdlib.Iterator.toArray", "kind": "value", - "name": "fromBufferToEnd", + "name": "toArray", "docstrings": [ - "`fromBufferToEnd` creates a `Int16Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array/Int16Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." + "Turns an iterator into an array of the remaining values.\nRemember that each invocation of `next` of an iterator consumes a value. `Iterator.toArray` will consume all remaining values of the iterator and return them in an array to you.\n\nSee [Iterator.prototype.toArray](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator/toArray) on MDN.\n\n## Examples\n```rescript\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\nmap->Map.set(\"someKey2\", \"someValue2\")\n\n// `Map.keys` returns all keys of the map as an iterator.\nlet mapKeysAsArray = map->Map.keys->Iterator.toArray\n\nmapKeysAsArray->assertEqual([\"someKey\", \"someKey2\"])\n```\n\n## Remark\n\nSince March 2025, this feature works across the latest devices and browser versions.\nThis feature might not work in older devices or browsers.\n" ], - "signature": "let fromBufferToEnd: (Core__ArrayBuffer.t, ~byteOffset: int) => t" + "signature": "let toArray: t<'a> => array<'a>" }, { - "id": "Core.Int16Array.fromBufferWithRange", + "id": "Stdlib.Iterator.toArrayWithMapper", "kind": "value", - "name": "fromBufferWithRange", + "name": "toArrayWithMapper", "docstrings": [ - "`fromBufferWithRange` creates a `Int16Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array/Int16Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." + "`toArray(iterator)` turns `iterator` into an array of its remaining values, applying the provided mapper function on each item.\nRemember that each invocation of `next` of an iterator consumes a value. `Iterator.toArrayWithMapper` will consume all remaining values of the iterator and return them in an array to you.\n\nSee [Iterator.prototype.toArray](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator/toArray) on MDN.\n\n## Examples\n```rescript\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\nmap->Map.set(\"someKey2\", \"someValue2\")\n\n// `Map.keys` returns all keys of the map as an iterator.\nlet mapKeysAsArray = map\n ->Map.keys\n ->Iterator.toArrayWithMapper(key => key->String.length)\n\nmapKeysAsArray->assertEqual([7, 8])\n```" ], - "signature": "let fromBufferWithRange: (Core__ArrayBuffer.t, ~byteOffset: int, ~length: int) => t" + "signature": "let toArrayWithMapper: (t<'a>, 'a => 'b) => array<'b>" }, { - "id": "Core.Int16Array.fromLength", + "id": "Stdlib.Iterator.forEach", "kind": "value", - "name": "fromLength", + "name": "forEach", "docstrings": [ - "`fromLength` creates a zero-initialized `Int16Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array/Int16Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." + "`forEach(iterator, fn)` consumes all values in the iterator and runs the callback `fn` for each value.\n\nSee [iterator protocols](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) on MDN.\n\n## Examples\n```rescript\nlet iterator: Iterator.t = [\"a\", \"b\", \"c\"]->Array.values\nlet acc = ref(\"\")\niterator->Iterator.forEach(v => {\n acc := acc.contents ++ v\n})\n\nacc.contents->assertEqual(\"abc\")\n```\n\n## Remark\n\nSince March 2025, this feature works across the latest devices and browser versions.\nThis feature might not work in older devices or browsers." ], - "signature": "let fromLength: int => t" + "signature": "let forEach: (t<'a>, 'a => unit) => unit" }, { - "id": "Core.Int16Array.fromArrayLikeOrIterable", + "id": "Stdlib.Iterator.ignore", "kind": "value", - "name": "fromArrayLikeOrIterable", + "name": "ignore", "docstrings": [ - "`fromArrayLikeOrIterable` creates a `Int16Array` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" + "`ignore(iterator)` ignores the provided iterator and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." ], - "signature": "let fromArrayLikeOrIterable: 'a => t" + "signature": "let ignore: t<'a> => unit" }, { - "id": "Core.Int16Array.fromArrayLikeOrIterableWithMap", + "id": "Stdlib.Iterator.drop", "kind": "value", - "name": "fromArrayLikeOrIterableWithMap", + "name": "drop", "docstrings": [ - "`fromArrayLikeOrIterableWithMap` creates a `Int16Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" + "`drop(iterator, n)` returns a new iterator helper object that skips the given number of elements at the start of this iterator.\n\nSee [Iterator.prototype.drop](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator/drop) on MDN.\n\n## Examples\n```rescript\nlet fibonacci: Iterator.t = [ 1, 1, 2, 3, 5, 8, 13, 21 ]->Array.values\n\nlet seq = fibonacci->Iterator.drop(2)\nseq->Iterator.next->assertEqual({done: false, value: Some(2)})\nseq->Iterator.next->assertEqual({done: false, value: Some(3)})\n```\n\n## Remark\n\nSince March 2025, this feature works across the latest devices and browser versions.\nThis feature might not work in older devices or browsers.\n" ], - "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => int) => t" - } - ] - }, - "core/int8array": { - "id": "Core.Int8Array", - "name": "Int8Array", - "docstrings": [], - "items": [ + "signature": "let drop: (t<'a>, int) => t<'a>" + }, { - "id": "Core.Int8Array.t", - "kind": "type", - "name": "t", + "id": "Stdlib.Iterator.every", + "kind": "value", + "name": "every", "docstrings": [ - "The `Int8Array` typed array represents an array of twos-complement 8-bit signed integers. See [Int8Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array)" + "`every(iterator, fn)` tests whether all elements in the iterator pass the test implemented by the provided function.\n\nSee [Iterator.prototype.every](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator/every) on MDN.\n\n## Examples\n```rescript\nlet fibonacci: Iterator.t = [ 1, 1, 2, 3, 5, 8, 13, 21 ]->Array.values\n\nlet areAllEven = fibonacci->Iterator.every(n => n % 2 == 0)\nareAllEven->assertEqual(false)\n```\n\n## Remark\n\nSince March 2025, this feature works across the latest devices and browser versions.\nThis feature might not work in older devices or browsers." ], - "signature": "type t = Core__TypedArray.t" + "signature": "let every: (t<'a>, 'a => bool) => bool" }, { - "id": "Core.Int8Array.fromArray", + "id": "Stdlib.Iterator.filter", "kind": "value", - "name": "fromArray", + "name": "filter", "docstrings": [ - "`fromArray` creates a `Int8Array` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array/Int8Array)" + "`filter(iterator, fn)` returns a new iterator helper object that contains the elements of the original iterator that pass the test implemented by the provided function.\n\nSee [Iterator.prototype.filter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator/filter) on MDN.\n\n## Examples\n```rescript\nlet fibonacci: Iterator.t = [ 1, 1, 2, 3, 5, 8, 13, 21 ]->Array.values\n\nlet seq = fibonacci->Iterator.filter(n => n % 2 == 0)\nseq->Iterator.next->assertEqual({done: false, value: Some(2)})\nseq->Iterator.next->assertEqual({done: false, value: Some(8)})\n```\n\n## Remark\n\nSince March 2025, this feature works across the latest devices and browser versions.\nThis feature might not work in older devices or browsers." ], - "signature": "let fromArray: array => t" + "signature": "let filter: (t<'a>, 'a => bool) => t<'a>" }, { - "id": "Core.Int8Array.fromBuffer", + "id": "Stdlib.Iterator.find", "kind": "value", - "name": "fromBuffer", + "name": "find", "docstrings": [ - "`fromBuffer` creates a `Int8Array` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array/Int8Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." + "`find(iterator, fn)` returns the value of the first element in the iterator that satisfies the provided testing function.\n\nSee [Iterator.prototype.find](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator/find) on MDN.\n\n## Examples\n```rescript\nlet fibonacci: Iterator.t = [ 1, 1, 2, 3, 5, 8, 13, 21 ]->Array.values\n\nlet seq = fibonacci->Iterator.find(n => n % 2 == 0)\nseq->assertEqual(Some(2))\n```\n\n## Remark\n\nSince March 2025, this feature works across the latest devices and browser versions.\nThis feature might not work in older devices or browsers." ], - "signature": "let fromBuffer: Core__ArrayBuffer.t => t" + "signature": "let find: (t<'a>, 'a => bool) => option<'a>" }, { - "id": "Core.Int8Array.fromBufferToEnd", + "id": "Stdlib.Iterator.flatMap", "kind": "value", - "name": "fromBufferToEnd", + "name": "flatMap", "docstrings": [ - "`fromBufferToEnd` creates a `Int8Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array/Int8Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." + "`flatMap(iterator, fn)` returns a new iterator helper object that contains the elements of the original iterator that pass the test implemented by the provided function.\n\nSee [Iterator.prototype.flatMap](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator/flatMap) on MDN.\n\n## Examples\n```rescript\nlet map1 = Map.fromArray([(\"a\", 1), (\"b\", 2), (\"c\", 3)])\nlet map2 = Map.fromArray([(\"d\", 4), (\"e\", 5), (\"f\", 6)])\n\nlet letters =\n [map1, map2]\n ->Array.values\n ->Iterator.flatMap(m => Map.keys(m))\n ->Array.fromIterator\nletters->assertEqual([\"a\", \"b\", \"c\", \"d\", \"e\", \"f\"])\n```\n\n## Remark\n\nSince March 2025, this feature works across the latest devices and browser versions.\nThis feature might not work in older devices or browsers." ], - "signature": "let fromBufferToEnd: (Core__ArrayBuffer.t, ~byteOffset: int) => t" + "signature": "let flatMap: (t<'a>, 'a => t<'b>) => t<'b>" }, { - "id": "Core.Int8Array.fromBufferWithRange", + "id": "Stdlib.Iterator.map", "kind": "value", - "name": "fromBufferWithRange", + "name": "map", "docstrings": [ - "`fromBufferWithRange` creates a `Int8Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array/Int8Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." + "`map(iterator, fn)` returns a new iterator helper object that yields elements of the iterator, each transformed by a mapping function.\n\nSee [Iterator.prototype.map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator/map) on MDN.\n\n## Examples\n```rescript\nlet map = Map.fromArray([(\"a\", 1), (\"b\", 2), (\"c\", 3)])\nlet letters = map->Map.keys->Iterator.map(v => v->String.toUpperCase)->Array.fromIterator\nletters->assertEqual([\"A\", \"B\", \"C\"])\n```\n\n## Remark\n\nSince March 2025, this feature works across the latest devices and browser versions.\nThis feature might not work in older devices or browsers." ], - "signature": "let fromBufferWithRange: (Core__ArrayBuffer.t, ~byteOffset: int, ~length: int) => t" + "signature": "let map: (t<'a>, 'a => 'b) => t<'b>" }, { - "id": "Core.Int8Array.fromLength", + "id": "Stdlib.Iterator.reduce", "kind": "value", - "name": "fromLength", + "name": "reduce", "docstrings": [ - "`fromLength` creates a zero-initialized `Int8Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array/Int8Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." + "`reduce(iterator, fn, initialValue)` applies a function against an accumulator and each element in the iterator (from left to right) to reduce it to a single value.\n\nSee [Iterator.prototype.reduce](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator/reduce) on MDN.\n\n## Examples\n```rescript\nlet numbers: Iterator.t = [ 1, 2, 3 ]->Array.values\n\nlet sum = numbers->Iterator.reduce((acc, n) => acc + n, ~initialValue=0)\nsum->assertEqual(6)\n```\n\n## Remark\n\nSince March 2025, this feature works across the latest devices and browser versions.\nThis feature might not work in older devices or browsers." ], - "signature": "let fromLength: int => t" + "signature": "let reduce: (t<'a>, ('acc, 'a) => 'acc, ~initialValue: 'acc=?) => 'acc" }, { - "id": "Core.Int8Array.fromArrayLikeOrIterable", + "id": "Stdlib.Iterator.some", "kind": "value", - "name": "fromArrayLikeOrIterable", + "name": "some", "docstrings": [ - "`fromArrayLikeOrIterable` creates a `Int8Array` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" + "`some(iterator, fn)` The some() method of Iterator instances is similar to Array.some: \nit tests whether at least one element produced by the iterator passes the test implemented by the provided function. \nIt returns a boolean value.\n\nSee [Iterator.prototype.some](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator/some) on MDN.\n\n## Examples\n```rescript\nlet numbers: Iterator.t = [ 1, 2, 3 ]->Array.values\n\nlet hasEven = numbers->Iterator.some(n => n % 2 == 0)\nhasEven->assertEqual(true)\n```\n\n## Remark\n\nSince March 2025, this feature works across the latest devices and browser versions.\nThis feature might not work in older devices or browsers." ], - "signature": "let fromArrayLikeOrIterable: 'a => t" + "signature": "let some: (t<'a>, 'a => bool) => bool" }, { - "id": "Core.Int8Array.fromArrayLikeOrIterableWithMap", + "id": "Stdlib.Iterator.take", "kind": "value", - "name": "fromArrayLikeOrIterableWithMap", + "name": "take", "docstrings": [ - "`fromArrayLikeOrIterableWithMap` creates a `Int8Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" + "`take((iterator, n))` returns a new iterator helper object that contains the first `n` elements of this iterator.\n\nSee [Iterator.prototype.take](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator/take) on MDN.\n\n## Examples\n```rescript\nlet fibonacci: Iterator.t = [ 1, 1, 2, 3, 5, 8, 13, 21 ]->Array.values\n\nlet seq = fibonacci->Iterator.take(2)\nseq->Iterator.next->assertEqual({done: false, value: Some(1)})\nseq->Iterator.next->assertEqual({done: false, value: Some(1)})\nseq->Iterator.next->assertEqual({done: true, value: None})\n```\n\n## Remark\n\nSince March 2025, this feature works across the latest devices and browser versions.\nThis feature might not work in older devices or browsers." ], - "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => int) => t" + "signature": "let take: (t<'a>, int) => t<'a>" } ] }, - "core/float64array": { - "id": "Core.Float64Array", - "name": "Float64Array", - "docstrings": [], + "stdlib/type": { + "id": "Stdlib.Type", + "name": "Type", + "docstrings": [ + "Utilities for classifying the type of JavaScript values at runtime." + ], "items": [ { - "id": "Core.Float64Array.t", + "id": "Stdlib.Type.t", "kind": "type", "name": "t", "docstrings": [ - "The `Float64Array` typed array represents an array of 64-bit floating point numbers in platform byte order. See [Float64Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array)" + "The possible types of JavaScript values." ], - "signature": "type t = Core__TypedArray.t" + "signature": "type t = [\n | #bigint\n | #boolean\n | #function\n | #number\n | #object\n | #string\n | #symbol\n | #undefined\n]" }, { - "id": "Core.Float64Array.fromArray", + "id": "Stdlib.Type.typeof", "kind": "value", - "name": "fromArray", + "name": "typeof", "docstrings": [ - "`fromArray` creates a `Float64Array` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array/Float64Array)" + "`typeof(someValue)`\n\nReturns the underlying JavaScript type of any runtime value.\n\nSee [`typeof`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof) on MDN.\n\n## Examples\n```rescript\nConsole.log(Type.typeof(\"Hello\")) // Logs \"string\" to the console.\n\nlet someVariable = true\n\nswitch someVariable->Type.typeof {\n| #boolean => Console.log(\"This is a bool, yay!\")\n| _ => Console.log(\"Oh, not a bool sadly...\")\n}\n```" ], - "signature": "let fromArray: array => t" + "signature": "let typeof: 'a => t" }, { - "id": "Core.Float64Array.fromBuffer", + "id": "Stdlib.Type.ignore", "kind": "value", - "name": "fromBuffer", + "name": "ignore", "docstrings": [ - "`fromBuffer` creates a `Float64Array` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array/Float64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." + "`ignore(type)` ignores the provided type and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." ], - "signature": "let fromBuffer: Core__ArrayBuffer.t => t" - }, + "signature": "let ignore: t => unit" + } + ] + }, + "stdlib/symbol": { + "id": "Stdlib.Symbol", + "name": "Symbol", + "docstrings": [ + "A built-in object that serves as a namespace for globally-unique identifiers.\n\nCompiles to a regular JavaScript Symbol." + ], + "items": [ { - "id": "Core.Float64Array.fromBufferToEnd", - "kind": "value", - "name": "fromBufferToEnd", + "id": "Stdlib.Symbol.t", + "kind": "type", + "name": "t", "docstrings": [ - "`fromBufferToEnd` creates a `Float64Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array/Float64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." + "Type representing a Symbol." ], - "signature": "let fromBufferToEnd: (Core__ArrayBuffer.t, ~byteOffset: int) => t" + "signature": "type t" }, { - "id": "Core.Float64Array.fromBufferWithRange", + "id": "Stdlib.Symbol.make", "kind": "value", - "name": "fromBufferWithRange", + "name": "make", "docstrings": [ - "`fromBufferWithRange` creates a `Float64Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array/Float64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." + "`make(key)`\n\nMakes a new unique Symbol value.\n\n## Examples\n\n```rescript\nSymbol.make(\"sym1\")\n->Symbol.description\n->assertEqual(Some(\"sym1\"))\n```" ], - "signature": "let fromBufferWithRange: (Core__ArrayBuffer.t, ~byteOffset: int, ~length: int) => t" + "signature": "let make: string => t" }, { - "id": "Core.Float64Array.fromLength", + "id": "Stdlib.Symbol.getFor", "kind": "value", - "name": "fromLength", + "name": "getFor", "docstrings": [ - "`fromLength` creates a zero-initialized `Float64Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array/Float64Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." + "`getFor(key)`\n\nSearches for existing registered Symbols in the global Symbol registry with the given key and returns it if found.\nOtherwise a new Symbol gets created and registered with key.\n\n## Examples\n\n```rescript\nSymbol.getFor(\"sym1\")->assertEqual(Symbol.getFor(\"sym1\"))\n```" ], - "signature": "let fromLength: int => t" + "signature": "let getFor: string => option" }, { - "id": "Core.Float64Array.fromArrayLikeOrIterable", + "id": "Stdlib.Symbol.keyFor", "kind": "value", - "name": "fromArrayLikeOrIterable", + "name": "keyFor", "docstrings": [ - "`fromArrayLikeOrIterable` creates a `Float64Array` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" + "`keyFor(key)`\n\nRetrieves a shared Symbol key from the global Symbol registry for the given Symbol.\n\n## Examples\n\n```rescript\nlet globalSym = Symbol.getFor(\"sym1\") // Global symbol\n\nglobalSym->Option.flatMap(Symbol.description)->assertEqual(Some(\"sym1\"))\n```" ], - "signature": "let fromArrayLikeOrIterable: 'a => t" + "signature": "let keyFor: t => option" }, { - "id": "Core.Float64Array.fromArrayLikeOrIterableWithMap", + "id": "Stdlib.Symbol.description", "kind": "value", - "name": "fromArrayLikeOrIterableWithMap", + "name": "description", "docstrings": [ - "`fromArrayLikeOrIterableWithMap` creates a `Float64Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" + "`description`\n\nReturns `Some(string)` containing the description of this symbol, or `None` if the symbol has no description.\n## Examples\n\n```rescript\nlet sym = Symbol.make(\"sym1\")\nSymbol.description(sym)->assertEqual(Some(\"sym1\"))\n```" ], - "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => float) => t" - } - ] - }, - "core/float32array": { - "id": "Core.Float32Array", - "name": "Float32Array", - "docstrings": [], - "items": [ + "signature": "let description: t => option" + }, { - "id": "Core.Float32Array.t", - "kind": "type", - "name": "t", + "id": "Stdlib.Symbol.toString", + "kind": "value", + "name": "toString", "docstrings": [ - "The `Float32Array` typed array represents an array of 32-bit floating point numbers in platform byte order. See [Float32Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array)" + "`toString`\n\n// Returns a string representing this symbol value.\n\n## Examples\n\n```rescript\nlet sym = Symbol.make(\"sym1\")\n\nSymbol.toString(sym)->assertEqual(\"Symbol(sym1)\")\n```" ], - "signature": "type t = Core__TypedArray.t" + "signature": "let toString: t => string" }, { - "id": "Core.Float32Array.fromArray", + "id": "Stdlib.Symbol.asyncIterator", "kind": "value", - "name": "fromArray", - "docstrings": [ - "`fromArray` creates a `Float32Array` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array/Float32Array)" - ], - "signature": "let fromArray: array => t" + "name": "asyncIterator", + "docstrings": [], + "signature": "let asyncIterator: t" }, { - "id": "Core.Float32Array.fromBuffer", + "id": "Stdlib.Symbol.hasInstance", "kind": "value", - "name": "fromBuffer", - "docstrings": [ - "`fromBuffer` creates a `Float32Array` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array/Float32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBuffer: Core__ArrayBuffer.t => t" + "name": "hasInstance", + "docstrings": [], + "signature": "let hasInstance: t" }, { - "id": "Core.Float32Array.fromBufferToEnd", + "id": "Stdlib.Symbol.isConcatSpreadable", "kind": "value", - "name": "fromBufferToEnd", - "docstrings": [ - "`fromBufferToEnd` creates a `Float32Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array/Float32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferToEnd: (Core__ArrayBuffer.t, ~byteOffset: int) => t" + "name": "isConcatSpreadable", + "docstrings": [], + "signature": "let isConcatSpreadable: t" + }, + { + "id": "Stdlib.Symbol.iterator", + "kind": "value", + "name": "iterator", + "docstrings": [], + "signature": "let iterator: t" + }, + { + "id": "Stdlib.Symbol.match", + "kind": "value", + "name": "match", + "docstrings": [], + "signature": "let match: t" + }, + { + "id": "Stdlib.Symbol.matchAll", + "kind": "value", + "name": "matchAll", + "docstrings": [], + "signature": "let matchAll: t" + }, + { + "id": "Stdlib.Symbol.replace", + "kind": "value", + "name": "replace", + "docstrings": [], + "signature": "let replace: t" + }, + { + "id": "Stdlib.Symbol.search", + "kind": "value", + "name": "search", + "docstrings": [], + "signature": "let search: t" + }, + { + "id": "Stdlib.Symbol.species", + "kind": "value", + "name": "species", + "docstrings": [], + "signature": "let species: t" + }, + { + "id": "Stdlib.Symbol.split", + "kind": "value", + "name": "split", + "docstrings": [], + "signature": "let split: t" }, { - "id": "Core.Float32Array.fromBufferWithRange", + "id": "Stdlib.Symbol.toPrimitive", "kind": "value", - "name": "fromBufferWithRange", - "docstrings": [ - "`fromBufferWithRange` creates a `Float32Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array/Float32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromBufferWithRange: (Core__ArrayBuffer.t, ~byteOffset: int, ~length: int) => t" + "name": "toPrimitive", + "docstrings": [], + "signature": "let toPrimitive: t" }, { - "id": "Core.Float32Array.fromLength", + "id": "Stdlib.Symbol.toStringTag", "kind": "value", - "name": "fromLength", - "docstrings": [ - "`fromLength` creates a zero-initialized `Float32Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array/Float32Array)\n\n**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds." - ], - "signature": "let fromLength: int => t" + "name": "toStringTag", + "docstrings": [], + "signature": "let toStringTag: t" }, { - "id": "Core.Float32Array.fromArrayLikeOrIterable", + "id": "Stdlib.Symbol.unscopables", "kind": "value", - "name": "fromArrayLikeOrIterable", - "docstrings": [ - "`fromArrayLikeOrIterable` creates a `Float32Array` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" - ], - "signature": "let fromArrayLikeOrIterable: 'a => t" + "name": "unscopables", + "docstrings": [], + "signature": "let unscopables: t" }, { - "id": "Core.Float32Array.fromArrayLikeOrIterableWithMap", + "id": "Stdlib.Symbol.ignore", "kind": "value", - "name": "fromArrayLikeOrIterableWithMap", + "name": "ignore", "docstrings": [ - "`fromArrayLikeOrIterableWithMap` creates a `Float32Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" + "`ignore(symbol)` ignores the provided symbol and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." ], - "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => float) => t" + "signature": "let ignore: t => unit" } ] }, - "core/typedarray": { - "id": "Core.TypedArray", - "name": "TypedArray", - "docstrings": [], + "stdlib/string": { + "id": "Stdlib.String", + "name": "String", + "docstrings": [ + "Functions for interacting with JavaScript strings.\nSee: [`String`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)." + ], "items": [ { - "id": "Core.TypedArray.t", + "id": "Stdlib.String.t", "kind": "type", "name": "t", - "docstrings": [], - "signature": "type t<'a>" + "docstrings": [ + "Type representing a string." + ], + "signature": "type t = string" }, { - "id": "Core.TypedArray.get", + "id": "Stdlib.String.make", "kind": "value", - "name": "get", - "docstrings": [], - "signature": "let get: (t<'a>, int) => option<'a>" + "name": "make", + "docstrings": [ + "`make(value)` converts the given value to a `string`.\n\n## Examples\n\n```rescript\nString.make(3.5) == \"3.5\"\nString.make([1, 2, 3]) == \"1,2,3\"\n```" + ], + "signature": "let make: 'a => string" }, { - "id": "Core.TypedArray.set", + "id": "Stdlib.String.fromCharCode", "kind": "value", - "name": "set", - "docstrings": [], - "signature": "let set: (t<'a>, int, 'a) => unit" + "name": "fromCharCode", + "docstrings": [ + "`fromCharCode(n)` creates a `string` containing the character corresponding to\nthat number, `n` ranges from 0 to 65535. If out of range, the lower 16 bits of\nthe value are used. Thus, `fromCharCode(0x1F63A)` gives the same result as\n`fromCharCode(0xF63A)`.\nSee [`String.fromCharCode`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCharCode) on MDN.\n\n## Examples\n\n```rescript\nString.fromCharCode(65) == \"A\"\nString.fromCharCode(0x3c8) == `ψ`\nString.fromCharCode(0xd55c) == `한`\nString.fromCharCode(-64568) == `ψ`\n```" + ], + "signature": "let fromCharCode: int => string" }, { - "id": "Core.TypedArray.buffer", + "id": "Stdlib.String.fromCharCodeMany", "kind": "value", - "name": "buffer", - "docstrings": [], - "signature": "let buffer: t<'a> => Core__ArrayBuffer.t" + "name": "fromCharCodeMany", + "docstrings": [ + "`fromCharCodeMany([n1, n2, n3])` creates a `string` from the characters\ncorresponding to the given numbers, using the same rules as `fromCharCode`.\nSee [`String.fromCharCode`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCharCode) on MDN.\n\n## Examples\n\n```rescript\nString.fromCharCodeMany([189, 43, 190, 61]) == \"½+¾=\"\nString.fromCharCodeMany([65, 66, 67]) == \"ABC\"\n```" + ], + "signature": "let fromCharCodeMany: array => string" }, { - "id": "Core.TypedArray.byteLength", + "id": "Stdlib.String.fromCodePoint", "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t<'a> => int" + "name": "fromCodePoint", + "docstrings": [ + "`fromCodePoint(n)` creates a `string` containing the character corresponding to\nthat numeric code point.\nSee [`String.fromCodePoint`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCodePoint) on MDN.\n\n## Examples\n\n```rescript\nString.fromCodePoint(65) == \"A\"\nString.fromCodePoint(0x3c8) == `ψ`\nString.fromCodePoint(0xd55c) == `한`\nString.fromCodePoint(0x1f63a) == `😺`\n```\n\n## Exceptions\n\n- `RangeError`: If the number is not a valid code point, like `fromCharCode(-5)`." + ], + "signature": "let fromCodePoint: int => string" }, { - "id": "Core.TypedArray.byteOffset", + "id": "Stdlib.String.fromCodePointMany", "kind": "value", - "name": "byteOffset", - "docstrings": [], - "signature": "let byteOffset: t<'a> => int" + "name": "fromCodePointMany", + "docstrings": [ + "`fromCodePointMany([n1, n2, n3])` creates a `string` from the characters\ncorresponding to the given code point numbers, using the same rules as\n`fromCodePoint`.\nSee [`String.fromCodePoint`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCodePoint) on MDN.\n\n## Examples\n\n```rescript\nString.fromCodePointMany([0xd55c, 0xae00, 0x1f63a]) == `한글😺`\n```\n\n## Exceptions\n\n- `RangeError`: If one of the number is not a valid code point, like\n`fromCharCode([1, -5])`." + ], + "signature": "let fromCodePointMany: array => string" }, { - "id": "Core.TypedArray.setArray", + "id": "Stdlib.String.equal", "kind": "value", - "name": "setArray", + "name": "equal", "docstrings": [], - "signature": "let setArray: (t<'a>, array<'a>) => unit" + "signature": "let equal: (string, string) => bool" }, { - "id": "Core.TypedArray.setArrayFrom", + "id": "Stdlib.String.compare", "kind": "value", - "name": "setArrayFrom", + "name": "compare", "docstrings": [], - "signature": "let setArrayFrom: (t<'a>, array<'a>, int) => unit" + "signature": "let compare: (string, string) => Ordering.t" }, { - "id": "Core.TypedArray.length", + "id": "Stdlib.String.length", "kind": "value", "name": "length", - "docstrings": [], - "signature": "let length: t<'a> => int" - }, - { - "id": "Core.TypedArray.copyAllWithin", - "kind": "value", - "name": "copyAllWithin", - "docstrings": [], - "signature": "let copyAllWithin: (t<'a>, ~target: int) => array<'a>" + "docstrings": [ + "`length(str)` returns the length of the given `string`.\nSee [`String.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length) on MDN.\n\n## Examples\n\n```rescript\nString.length(\"abcd\") == 4\n```" + ], + "signature": "let length: string => int" }, { - "id": "Core.TypedArray.copyWithinToEnd", + "id": "Stdlib.String.get", "kind": "value", - "name": "copyWithinToEnd", - "docstrings": [], - "signature": "let copyWithinToEnd: (t<'a>, ~target: int, ~start: int) => array<'a>" + "name": "get", + "docstrings": [ + "`get(str, index)` returns an `option` at the given `index` number. If\n`index` is out of range, this function returns `None`.\n\n## Examples\n\n```rescript\nString.get(\"ReScript\", 0) == Some(\"R\")\nString.get(\"Hello\", 4) == Some(\"o\")\nString.get(`JS`, 4) == None\n```" + ], + "signature": "let get: (string, int) => option" }, { - "id": "Core.TypedArray.copyWithin", + "id": "Stdlib.String.getUnsafe", "kind": "value", - "name": "copyWithin", - "docstrings": [], - "signature": "let copyWithin: (t<'a>, ~target: int, ~start: int, ~end: int) => array<'a>" + "name": "getUnsafe", + "docstrings": [ + "`getUnsafe(str, index)` returns an `string` at the given `index` number.\n\nThis is _unsafe_, meaning it will return `undefined` value if `index` does not exist in `string`.\n\nUse `String.getUnsafe` only when you are sure the `index` exists.\n## Examples\n\n```rescript\nString.getUnsafe(\"ReScript\", 0) == \"R\"\nString.getUnsafe(\"Hello\", 4) == \"o\"\n```" + ], + "signature": "let getUnsafe: (string, int) => string" }, { - "id": "Core.TypedArray.fillAll", + "id": "Stdlib.String.charAt", "kind": "value", - "name": "fillAll", - "docstrings": [], - "signature": "let fillAll: (t<'a>, 'a) => t<'a>" + "name": "charAt", + "docstrings": [ + "`charAt(str, index)` gets the character at `index` within string `str`. If\n`index` is negative or greater than the length of `str`, it returns the empty\nstring. If the string contains characters outside the range \\u0000-\\uffff, it\nwill return the first 16-bit value at that position in the string.\nSee [`String.charAt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/charAt) on MDN.\n\n## Examples\n\n```rescript\nString.charAt(\"ReScript\", 0) == \"R\"\nString.charAt(\"Hello\", 12) == \"\"\nString.charAt(`JS`, 5) == \"\"\n```" + ], + "signature": "let charAt: (string, int) => string" }, { - "id": "Core.TypedArray.fillToEnd", + "id": "Stdlib.String.charCodeAt", "kind": "value", - "name": "fillToEnd", - "docstrings": [], - "signature": "let fillToEnd: (t<'a>, 'a, ~start: int) => t<'a>" + "name": "charCodeAt", + "docstrings": [ + "`charCodeAt(str, index)` returns the character code at position `index` in\nstring `str` the result is in the range 0-65535, unlike `codePointAt`, so it\nwill not work correctly for characters with code points greater than or equal\nto 0x10000. The return type is `float` because this function returns NaN if\n`index` is less than zero or greater than the length of the string.\nSee [`String.charCodeAt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/charCodeAt) on MDN.\n\n## Examples\n\n```rescript\nString.charCodeAt(`😺`, 0) == 0xd83d->Int.toFloat\nString.codePointAt(`😺`, 0) == Some(0x1f63a)\n```" + ], + "signature": "let charCodeAt: (string, int) => float" }, { - "id": "Core.TypedArray.fill", + "id": "Stdlib.String.codePointAt", "kind": "value", - "name": "fill", - "docstrings": [], - "signature": "let fill: (t<'a>, 'a, ~start: int, ~end: int) => t<'a>" + "name": "codePointAt", + "docstrings": [ + "`codePointAt(str, index)` returns the code point at position `index` within\nstring `str` as a `Some(value)`. The return value handles code points greater\nthan or equal to 0x10000. If there is no code point at the given position, the\nfunction returns `None`.\nSee [`String.codePointAt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/codePointAt) on MDN.\n\n## Examples\n\n```rescript\nString.codePointAt(`¿😺?`, 1) == Some(0x1f63a)\nString.codePointAt(\"abc\", 5) == None\n```" + ], + "signature": "let codePointAt: (string, int) => option" }, { - "id": "Core.TypedArray.reverse", + "id": "Stdlib.String.concat", "kind": "value", - "name": "reverse", - "docstrings": [], - "signature": "let reverse: t<'a> => unit" + "name": "concat", + "docstrings": [ + "`concat(original, append)` returns a new `string` with `append` added after\n`original`.\nSee [`String.concat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/concat) on MDN.\n\n## Examples\n\n```rescript\nString.concat(\"cow\", \"bell\") == \"cowbell\"\nString.concat(\"Re\", \"Script\") == \"ReScript\"\n```" + ], + "signature": "let concat: (string, string) => string" }, { - "id": "Core.TypedArray.toReversed", + "id": "Stdlib.String.concatMany", "kind": "value", - "name": "toReversed", - "docstrings": [], - "signature": "let toReversed: t<'a> => t<'a>" + "name": "concatMany", + "docstrings": [ + "`concatMany(original, arr)` returns a new `string` consisting of each item of an\narray of strings added to the `original` string.\nSee [`String.concat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/concat) on MDN.\n\n## Examples\n\n```rescript\nString.concatMany(\"1st\", [\"2nd\", \"3rd\", \"4th\"]) == \"1st2nd3rd4th\"\n```" + ], + "signature": "let concatMany: (string, array) => string" }, { - "id": "Core.TypedArray.sort", + "id": "Stdlib.String.endsWith", "kind": "value", - "name": "sort", - "docstrings": [], - "signature": "let sort: (t<'a>, ('a, 'a) => Core__Ordering.t) => unit" + "name": "endsWith", + "docstrings": [ + "`endsWith(str, substr)` returns `true` if the `str` ends with `substr`, `false`\notherwise.\nSee [`String.endsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith) on MDN.\n\n## Examples\n\n```rescript\nString.endsWith(\"BuckleScript\", \"Script\") == true\nString.endsWith(\"BuckleShoes\", \"Script\") == false\n```" + ], + "signature": "let endsWith: (string, string) => bool" }, { - "id": "Core.TypedArray.toSorted", + "id": "Stdlib.String.endsWithFrom", "kind": "value", - "name": "toSorted", - "docstrings": [], - "signature": "let toSorted: (t<'a>, ('a, 'a) => Core__Ordering.t) => t<'a>" + "name": "endsWithFrom", + "docstrings": [ + "`endsWithFrom(str, ending, len)` returns `true` if the first len characters of\n`str` end with `ending`, `false` otherwise. If `len` is greater than or equal\nto the length of `str`, then it works like `endsWith`.\nSee [`String.endsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith) on MDN.\n\n## Examples\n\n```rescript\nString.endsWithFrom(\"abcd\", \"cd\", 4) == true\nString.endsWithFrom(\"abcde\", \"cd\", 3) == false\nString.endsWithFrom(\"abcde\", \"cde\", 99) == true\nString.endsWithFrom(\"example.dat\", \"ple\", 7) == true\n```" + ], + "signature": "let endsWithFrom: (string, string, int) => bool" }, { - "id": "Core.TypedArray.with", + "id": "Stdlib.String.includes", "kind": "value", - "name": "with", - "docstrings": [], - "signature": "let with: (t<'a>, int, 'a) => t<'a>" + "name": "includes", + "docstrings": [ + "`includes(str, searchValue)` returns `true` if `searchValue` is found anywhere\nwithin `str`, `false` otherwise.\nSee [`String.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes) on MDN.\n\n## Examples\n\n```rescript\nString.includes(\"programmer\", \"gram\") == true\nString.includes(\"programmer\", \"er\") == true\nString.includes(\"programmer\", \"pro\") == true\nString.includes(\"programmer.dat\", \"xyz\") == false\n```" + ], + "signature": "let includes: (string, string) => bool" }, { - "id": "Core.TypedArray.includes", + "id": "Stdlib.String.includesFrom", "kind": "value", - "name": "includes", - "docstrings": [], - "signature": "let includes: (t<'a>, 'a) => bool" + "name": "includesFrom", + "docstrings": [ + "`includesFrom(str, searchValue, start)` returns `true` if `searchValue` is found\nanywhere within `str` starting at character number `start` (where 0 is the\nfirst character), `false` otherwise.\nSee [`String.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes) on MDN.\n\n## Examples\n\n```rescript\nString.includesFrom(\"programmer\", \"gram\", 1) == true\nString.includesFrom(\"programmer\", \"gram\", 4) == false\nString.includesFrom(`대한민국`, `한`, 1) == true\n```" + ], + "signature": "let includesFrom: (string, string, int) => bool" }, { - "id": "Core.TypedArray.indexOf", + "id": "Stdlib.String.indexOf", "kind": "value", "name": "indexOf", - "docstrings": [], - "signature": "let indexOf: (t<'a>, 'a) => int" + "docstrings": [ + "`indexOf(str, searchValue)` returns the position at which `searchValue` was\nfirst found within `str`, or `-1` if `searchValue` is not in `str`.\nSee [`String.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf) on MDN.\n\n## Examples\n\n```rescript\nString.indexOf(\"bookseller\", \"ok\") == 2\nString.indexOf(\"bookseller\", \"sell\") == 4\nString.indexOf(\"beekeeper\", \"ee\") == 1\nString.indexOf(\"bookseller\", \"xyz\") == -1\n```" + ], + "signature": "let indexOf: (string, string) => int" }, { - "id": "Core.TypedArray.indexOfFrom", + "id": "Stdlib.String.indexOfOpt", "kind": "value", - "name": "indexOfFrom", - "docstrings": [], - "signature": "let indexOfFrom: (t<'a>, 'a, int) => int" + "name": "indexOfOpt", + "docstrings": [ + "`indexOfOpt(str, searchValue)`. Like `indexOf`, but return an `option`.\n\n## Examples\n\n```rescript\nString.indexOfOpt(\"bookseller\", \"ok\") == Some(2)\nString.indexOfOpt(\"bookseller\", \"xyz\") == None\n```" + ], + "signature": "let indexOfOpt: (string, string) => option" }, { - "id": "Core.TypedArray.joinWith", + "id": "Stdlib.String.indexOfFrom", "kind": "value", - "name": "joinWith", - "docstrings": [], - "signature": "let joinWith: (t<'a>, string) => string" + "name": "indexOfFrom", + "docstrings": [ + "`indexOfFrom(str, searchValue, start)` returns the position at which\n`searchValue` was found within `str` starting at character position `start`, or\n`-1` if `searchValue` is not found in that portion of `str`. The return value is\nrelative to the beginning of the string, no matter where the search started\nfrom.\nSee [`String.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf) on MDN.\n\n## Examples\n\n```rescript\nString.indexOfFrom(\"bookseller\", \"ok\", 1) == 2\nString.indexOfFrom(\"bookseller\", \"sell\", 2) == 4\nString.indexOfFrom(\"bookseller\", \"sell\", 5) == -1\n```" + ], + "signature": "let indexOfFrom: (string, string, int) => int" }, { - "id": "Core.TypedArray.lastIndexOf", + "id": "Stdlib.String.lastIndexOf", "kind": "value", "name": "lastIndexOf", - "docstrings": [], - "signature": "let lastIndexOf: (t<'a>, 'a) => int" - }, - { - "id": "Core.TypedArray.lastIndexOfFrom", - "kind": "value", - "name": "lastIndexOfFrom", - "docstrings": [], - "signature": "let lastIndexOfFrom: (t<'a>, 'a, int) => int" + "docstrings": [ + "`lastIndexOf(str, searchValue)` returns the position of the last occurrence of\n`searchValue` within `str`, searching backwards from the end of the string.\nReturns `-1` if `searchValue` is not in `str`. The return value is always\nrelative to the beginning of the string.\nSee [`String.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/lastIndexOf) on MDN.\n\n## Examples\n\n```rescript\nString.lastIndexOf(\"bookseller\", \"ok\") == 2\nString.lastIndexOf(\"beekeeper\", \"ee\") == 4\nString.lastIndexOf(\"abcdefg\", \"xyz\") == -1\n```" + ], + "signature": "let lastIndexOf: (string, string) => int" }, { - "id": "Core.TypedArray.slice", + "id": "Stdlib.String.lastIndexOfOpt", "kind": "value", - "name": "slice", - "docstrings": [], - "signature": "let slice: (t<'a>, ~start: int, ~end: int) => t<'a>" + "name": "lastIndexOfOpt", + "docstrings": [ + "`lastIndexOfOpt(str, searchValue)`. Like `lastIndexOfOpt`, but return an\n`option`.\n\n## Examples\n\n```rescript\nString.lastIndexOfOpt(\"bookseller\", \"ok\") == Some(2)\nString.lastIndexOfOpt(\"beekeeper\", \"ee\") == Some(4)\nString.lastIndexOfOpt(\"abcdefg\", \"xyz\") == None\n```" + ], + "signature": "let lastIndexOfOpt: (string, string) => option" }, { - "id": "Core.TypedArray.sliceToEnd", + "id": "Stdlib.String.lastIndexOfFrom", "kind": "value", - "name": "sliceToEnd", - "docstrings": [], - "signature": "let sliceToEnd: (t<'a>, ~start: int) => t<'a>" + "name": "lastIndexOfFrom", + "docstrings": [ + "`lastIndexOfFrom(str, searchValue, start)` returns the position of the last\noccurrence of `searchValue` within `str`, searching backwards from the given\nstart position. Returns `-1` if `searchValue` is not in `str`. The return value\nis always relative to the beginning of the string.\nSee [`String.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/lastIndexOf) on MDN.\n\n## Examples\n\n```rescript\nString.lastIndexOfFrom(\"bookseller\", \"ok\", 6) == 2\nString.lastIndexOfFrom(\"beekeeper\", \"ee\", 8) == 4\nString.lastIndexOfFrom(\"beekeeper\", \"ee\", 3) == 1\nString.lastIndexOfFrom(\"abcdefg\", \"xyz\", 4) == -1\n```" + ], + "signature": "let lastIndexOfFrom: (string, string, int) => int" }, { - "id": "Core.TypedArray.copy", + "id": "Stdlib.String.match", "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: t<'a> => t<'a>" + "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\nthere 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.\nSee [`String.match`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/match) on MDN.\n\n## Examples\n\n```rescript\nString.match(\"The better bats\", %re(\"/b[aeiou]t/\")) == Some([Some(\"bet\")])\nString.match(\"The better bats\", %re(\"/b[aeiou]t/g\")) == Some([Some(\"bet\"), Some(\"bat\")])\nString.match(\"Today is 2018-04-05.\", %re(\"/(\\d+)-(\\d+)-(\\d+)/\")) ==\n Some([Some(\"2018-04-05\"), Some(\"2018\"), Some(\"04\"), Some(\"05\")])\nString.match(\"The optional example\", %re(\"/(foo)?(example)/\")) == Some([Some(\"example\"), None, Some(\"example\")])\nString.match(\"The large container.\", %re(\"/b[aeiou]g/\")) == None\n```" + ], + "signature": "let match: (string, RegExp.t) => option" }, { - "id": "Core.TypedArray.subarray", + "id": "Stdlib.String.normalize", "kind": "value", - "name": "subarray", - "docstrings": [], - "signature": "let subarray: (t<'a>, ~start: int, ~end: int) => t<'a>" + "name": "normalize", + "docstrings": [ + "`normalize(str)` returns the normalized Unicode string using Normalization Form\nCanonical (NFC) Composition. Consider the character ã, which can be represented\nas the single codepoint \\u00e3 or the combination of a lower case letter A\n\\u0061 and a combining tilde \\u0303. Normalization ensures that both can be\nstored in an equivalent binary representation.\nSee [`String.normalize`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize) on MDN.\nSee also [Unicode technical report #15](https://unicode.org/reports/tr15/) for details.\n\n## Examples\n\n```rescript\nlet string1 = \"\\u00F1\"\nlet string2 = \"\\u006E\\u0303\"\n\nassert(string1 != string2) // true\nassertEqual(String.normalize(string1), String.normalize(string2))\n```" + ], + "signature": "let normalize: string => string" }, { - "id": "Core.TypedArray.subarrayToEnd", - "kind": "value", - "name": "subarrayToEnd", - "docstrings": [], - "signature": "let subarrayToEnd: (t<'a>, ~start: int) => t<'a>" + "id": "Stdlib.String.normalizeForm", + "kind": "type", + "name": "normalizeForm", + "docstrings": [ + "`normalizeByForm(str, form)` returns the normalized Unicode string using the\nspecified form of normalization, which may be one of:\n- \"NFC\" — Normalization Form Canonical Composition.\n- \"NFD\" — Normalization Form Canonical Decomposition.\n- \"NFKC\" — Normalization Form Compatibility Composition.\n- \"NFKD\" — Normalization Form Compatibility Decomposition.\nSee [`String.normalize`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize) on MDN.\nSee also [Unicode technical report #15](https://unicode.org/reports/tr15/) for\ndetails.\n\n## Examples\n\n```rescript\nlet string1 = \"\\uFB00\"\nlet string2 = \"\\u0066\\u0066\"\nConsole.log(string1 == string2) // false\n\nlet normalizeString1 = String.normalizeByForm(string1, #NFKD)\nlet normalizeString2 = String.normalizeByForm(string2, #NFKD)\nConsole.log(normalizeString1 == normalizeString2) // true\n```" + ], + "signature": "type normalizeForm = [#NFC | #NFD | #NFKC | #NFKD]" }, { - "id": "Core.TypedArray.toString", + "id": "Stdlib.String.normalizeByForm", "kind": "value", - "name": "toString", + "name": "normalizeByForm", "docstrings": [], - "signature": "let toString: t<'a> => string" + "signature": "let normalizeByForm: (string, normalizeForm) => string" }, { - "id": "Core.TypedArray.toLocaleString", + "id": "Stdlib.String.repeat", "kind": "value", - "name": "toLocaleString", - "docstrings": [], - "signature": "let toLocaleString: t<'a> => string" + "name": "repeat", + "docstrings": [ + "`repeat(str, n)` returns a `string` that consists of `n` repetitions of `str`.\nSee [`String.repeat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/repeat) on MDN.\n\n## Examples\n\n```rescript\nString.repeat(\"ha\", 3) == \"hahaha\"\nString.repeat(\"empty\", 0) == \"\"\n```\n\n## Exceptions\n\n- `RangeError`: if `n` is negative." + ], + "signature": "let repeat: (string, int) => string" }, { - "id": "Core.TypedArray.every", + "id": "Stdlib.String.replace", "kind": "value", - "name": "every", - "docstrings": [], - "signature": "let every: (t<'a>, 'a => bool) => bool" + "name": "replace", + "docstrings": [ + "`replace(str, substr, newSubstr)` returns a new `string` which is\nidentical to `str` except with the first matching instance of `substr` replaced\nby `newSubstr`. `substr` is treated as a verbatim string to match, not a\nregular expression.\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) on MDN.\n\n## Examples\n\n```rescript\nString.replace(\"old string\", \"old\", \"new\") == \"new string\"\nString.replace(\"the cat and the dog\", \"the\", \"this\") == \"this cat and the dog\"\n```" + ], + "signature": "let replace: (string, string, string) => string" }, { - "id": "Core.TypedArray.everyWithIndex", + "id": "Stdlib.String.replaceRegExp", "kind": "value", - "name": "everyWithIndex", - "docstrings": [], - "signature": "let everyWithIndex: (t<'a>, ('a, int) => bool) => bool" + "name": "replaceRegExp", + "docstrings": [ + "`replaceRegExp(str, regex, replacement)` returns a new `string` where\noccurrences matching regex have been replaced by `replacement`.\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) on MDN.\n\n## Examples\n\n```rescript\nString.replaceRegExp(\"vowels be gone\", %re(\"/[aeiou]/g\"), \"x\") == \"vxwxls bx gxnx\"\nString.replaceRegExp(\"Juan Fulano\", %re(\"/(\\w+) (\\w+)/\"), \"$2, $1\") == \"Fulano, Juan\"\n```" + ], + "signature": "let replaceRegExp: (string, RegExp.t, string) => string" }, { - "id": "Core.TypedArray.filter", + "id": "Stdlib.String.replaceAll", "kind": "value", - "name": "filter", - "docstrings": [], - "signature": "let filter: (t<'a>, 'a => bool) => t<'a>" + "name": "replaceAll", + "docstrings": [ + "`replaceAll(str, substr, newSubstr)` returns a new `string` which is\nidentical to `str` except with all matching instances of `substr` replaced\nby `newSubstr`. `substr` is treated as a verbatim string to match, not a\nregular expression.\nSee [`String.replaceAll`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replaceAll) on MDN.\n\n## Examples\n\n```rescript\nString.replaceAll(\"old old string\", \"old\", \"new\") == \"new new string\"\nString.replaceAll(\"the cat and the dog\", \"the\", \"this\") == \"this cat and this dog\"\n```" + ], + "signature": "let replaceAll: (string, string, string) => string" }, { - "id": "Core.TypedArray.filterWithIndex", + "id": "Stdlib.String.replaceAllRegExp", "kind": "value", - "name": "filterWithIndex", - "docstrings": [], - "signature": "let filterWithIndex: (t<'a>, ('a, int) => bool) => t<'a>" + "name": "replaceAllRegExp", + "docstrings": [ + "`replaceAllRegExp(str, regex, replacement)` returns a new `string` where\nall occurrences matching regex have been replaced by `replacement`.\nThe pattern must include the global (`g`) flag or a runtime TypeError will be thrown.\nSee [`String.replaceAll`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replaceAll) on MDN.\n\n## Examples\n\n```rescript\nString.replaceAllRegExp(\"vowels be gone\", %re(\"/[aeiou]/g\"), \"x\") == \"vxwxls bx gxnx\"\nString.replaceAllRegExp(\"aabbcc\", %re(\"/b/g\"), \".\") == \"aa..cc\"\n```" + ], + "signature": "let replaceAllRegExp: (string, RegExp.t, string) => string" }, { - "id": "Core.TypedArray.find", + "id": "Stdlib.String.unsafeReplaceRegExpBy0", "kind": "value", - "name": "find", - "docstrings": [], - "signature": "let find: (t<'a>, 'a => bool) => option<'a>" + "name": "unsafeReplaceRegExpBy0", + "docstrings": [ + "`unsafeReplaceRegExpBy0(str, regex, f)` returns a new `string` with some or all\nmatches of a pattern with no capturing parentheses replaced by the value\nreturned from the given function. The function receives as its parameters the\nmatched string, the offset at which the match begins, and the whole string being\nmatched.\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) on MDN.\n\n## Examples\n\n```rescript\nlet str = \"beautiful vowels\"\nlet re = %re(\"/[aeiou]/g\")\nlet matchFn = (~match, ~offset as _, ~input as _) => String.toUpperCase(match)\nString.unsafeReplaceRegExpBy0(str, re, matchFn) == \"bEAUtIfUl vOwEls\"\n```" + ], + "signature": "let unsafeReplaceRegExpBy0: (\n string,\n RegExp.t,\n (~match: string, ~offset: int, ~input: string) => string,\n) => string", + "deprecated": "Use `replaceRegExpBy0Unsafe` instead" }, { - "id": "Core.TypedArray.findWithIndex", + "id": "Stdlib.String.unsafeReplaceRegExpBy1", "kind": "value", - "name": "findWithIndex", - "docstrings": [], - "signature": "let findWithIndex: (t<'a>, ('a, int) => bool) => option<'a>" + "name": "unsafeReplaceRegExpBy1", + "docstrings": [ + "`unsafeReplaceRegExpBy1(str, regexp, f)`. Like `unsafeReplaceRegExpBy0`, but `f`\nhas `group1` parameter.\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) on MDN.\n\n## Examples\n\n```rescript\nlet str = \"Jony is 40\"\nlet re = %re(\"/(Jony is )\\d+/g\")\nlet matchFn = (~match as _, ~group1, ~offset as _, ~input as _) => {\n group1 ++ \"41\"\n}\nString.unsafeReplaceRegExpBy1(str, re, matchFn) == \"Jony is 41\"\n```" + ], + "signature": "let unsafeReplaceRegExpBy1: (\n string,\n RegExp.t,\n (\n ~match: string,\n ~group1: string,\n ~offset: int,\n ~input: string,\n ) => string,\n) => string", + "deprecated": "Use `replaceRegExpBy1Unsafe` instead" }, { - "id": "Core.TypedArray.findIndex", + "id": "Stdlib.String.unsafeReplaceRegExpBy2", "kind": "value", - "name": "findIndex", - "docstrings": [], - "signature": "let findIndex: (t<'a>, 'a => bool) => int" + "name": "unsafeReplaceRegExpBy2", + "docstrings": [ + "`unsafeReplaceRegExpBy2(str, regexp, f)`. Like `unsafeReplaceRegExpBy1`, but `f`\nhas two group parameters.\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) on MDN.\n\n## Examples\n\n```rescript\nlet str = \"7 times 6\"\nlet re = %re(\"/(\\d+) times (\\d+)/\")\nlet matchFn = (~match as _, ~group1, ~group2, ~offset as _, ~input as _) => {\n switch (Int.fromString(group1), Int.fromString(group2)) {\n | (Some(x), Some(y)) => Int.toString(x * y)\n | _ => \"???\"\n }\n}\nString.unsafeReplaceRegExpBy2(str, re, matchFn) == \"42\"\n```" + ], + "signature": "let unsafeReplaceRegExpBy2: (\n string,\n RegExp.t,\n (\n ~match: string,\n ~group1: string,\n ~group2: string,\n ~offset: int,\n ~input: string,\n ) => string,\n) => string", + "deprecated": "Use `replaceRegExpBy2Unsafe` instead" }, { - "id": "Core.TypedArray.findIndexWithIndex", + "id": "Stdlib.String.unsafeReplaceRegExpBy3", "kind": "value", - "name": "findIndexWithIndex", - "docstrings": [], - "signature": "let findIndexWithIndex: (t<'a>, ('a, int) => bool) => int" + "name": "unsafeReplaceRegExpBy3", + "docstrings": [ + "`unsafeReplaceRegExpBy3(str, regexp, f)`. Like `unsafeReplaceRegExpBy2`, but `f`\nhas three group parameters.\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) on MDN." + ], + "signature": "let unsafeReplaceRegExpBy3: (\n string,\n RegExp.t,\n (\n ~match: string,\n ~group1: string,\n ~group2: string,\n ~group3: string,\n ~offset: int,\n ~input: string,\n ) => string,\n) => string", + "deprecated": "Use `replaceRegExpBy3Unsafe` instead" }, { - "id": "Core.TypedArray.forEach", + "id": "Stdlib.String.replaceRegExpBy0Unsafe", "kind": "value", - "name": "forEach", - "docstrings": [], - "signature": "let forEach: (t<'a>, 'a => unit) => unit" + "name": "replaceRegExpBy0Unsafe", + "docstrings": [ + "`replaceRegExpBy0Unsafe(str, regex, f)` returns a new `string` with some or all\nmatches of a pattern with no capturing parentheses replaced by the value\nreturned from the given function. The function receives as its parameters the\nmatched string, the offset at which the match begins, and the whole string being\nmatched.\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) on MDN.\n\n## Examples\n\n```rescript\nlet str = \"beautiful vowels\"\nlet re = %re(\"/[aeiou]/g\")\nlet matchFn = (~match, ~offset as _, ~input as _) => String.toUpperCase(match)\nString.replaceRegExpBy0Unsafe(str, re, matchFn) == \"bEAUtIfUl vOwEls\"\n```" + ], + "signature": "let replaceRegExpBy0Unsafe: (\n string,\n RegExp.t,\n (~match: string, ~offset: int, ~input: string) => string,\n) => string" }, { - "id": "Core.TypedArray.forEachWithIndex", + "id": "Stdlib.String.replaceRegExpBy1Unsafe", "kind": "value", - "name": "forEachWithIndex", - "docstrings": [], - "signature": "let forEachWithIndex: (t<'a>, ('a, int) => unit) => unit" + "name": "replaceRegExpBy1Unsafe", + "docstrings": [ + "`replaceRegExpBy1Unsafe(str, regexp, f)`. Like `replaceRegExpBy0Unsafe`, but `f`\nhas `group1` parameter.\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) on MDN.\n\n## Examples\n\n```rescript\nlet str = \"Jony is 40\"\nlet re = %re(\"/(Jony is )\\d+/g\")\nlet matchFn = (~match as _, ~group1, ~offset as _, ~input as _) => {\n group1 ++ \"41\"\n}\nString.replaceRegExpBy1Unsafe(str, re, matchFn) == \"Jony is 41\"\n```" + ], + "signature": "let replaceRegExpBy1Unsafe: (\n string,\n RegExp.t,\n (\n ~match: string,\n ~group1: string,\n ~offset: int,\n ~input: string,\n ) => string,\n) => string" }, { - "id": "Core.TypedArray.map", + "id": "Stdlib.String.replaceRegExpBy2Unsafe", "kind": "value", - "name": "map", - "docstrings": [], - "signature": "let map: (t<'a>, 'a => 'b) => t<'b>" + "name": "replaceRegExpBy2Unsafe", + "docstrings": [ + "`replaceRegExpBy2Unsafe(str, regexp, f)`. Like `replaceRegExpBy1Unsafe`, but `f`\nhas two group parameters.\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) on MDN.\n\n## Examples\n\n```rescript\nlet str = \"7 times 6\"\nlet re = %re(\"/(\\d+) times (\\d+)/\")\nlet matchFn = (~match as _, ~group1, ~group2, ~offset as _, ~input as _) => {\n switch (Int.fromString(group1), Int.fromString(group2)) {\n | (Some(x), Some(y)) => Int.toString(x * y)\n | _ => \"???\"\n }\n}\nString.replaceRegExpBy2Unsafe(str, re, matchFn) == \"42\"\n```" + ], + "signature": "let replaceRegExpBy2Unsafe: (\n string,\n RegExp.t,\n (\n ~match: string,\n ~group1: string,\n ~group2: string,\n ~offset: int,\n ~input: string,\n ) => string,\n) => string" }, { - "id": "Core.TypedArray.mapWithIndex", + "id": "Stdlib.String.replaceRegExpBy3Unsafe", "kind": "value", - "name": "mapWithIndex", - "docstrings": [], - "signature": "let mapWithIndex: (t<'a>, ('a, int) => 'b) => t<'b>" + "name": "replaceRegExpBy3Unsafe", + "docstrings": [ + "`replaceRegExpBy3Unsafe(str, regexp, f)`. Like `replaceRegExpBy2Unsafe`, but `f`\nhas three group parameters.\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) on MDN." + ], + "signature": "let replaceRegExpBy3Unsafe: (\n string,\n RegExp.t,\n (\n ~match: string,\n ~group1: string,\n ~group2: string,\n ~group3: string,\n ~offset: int,\n ~input: string,\n ) => string,\n) => string" }, { - "id": "Core.TypedArray.reduce", + "id": "Stdlib.String.search", "kind": "value", - "name": "reduce", - "docstrings": [], - "signature": "let reduce: (t<'a>, ('b, 'a) => 'b, 'b) => 'b" + "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.\nSee [`String.search`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/search) on MDN.\n\n## Examples\n\n```rescript\nString.search(\"testing 1 2 3\", %re(\"/\\d+/\")) == 8\nString.search(\"no numbers\", %re(\"/\\d+/\")) == -1\n```" + ], + "signature": "let search: (string, RegExp.t) => int" }, { - "id": "Core.TypedArray.reduceWithIndex", + "id": "Stdlib.String.searchOpt", "kind": "value", - "name": "reduceWithIndex", - "docstrings": [], - "signature": "let reduceWithIndex: (t<'a>, ('b, 'a, int) => 'b, 'b) => 'b" + "name": "searchOpt", + "docstrings": [ + "`searchOpt(str, regexp)`. Like `search`, but return an `option`.\n\n## Examples\n\n```rescript\nString.searchOpt(\"testing 1 2 3\", %re(\"/\\d+/\")) == Some(8)\nString.searchOpt(\"no numbers\", %re(\"/\\d+/\")) == None\n```" + ], + "signature": "let searchOpt: (string, RegExp.t) => option" }, { - "id": "Core.TypedArray.reduceRight", + "id": "Stdlib.String.slice", "kind": "value", - "name": "reduceRight", - "docstrings": [], - "signature": "let reduceRight: (t<'a>, ('b, 'a) => 'b, 'b) => 'b" + "name": "slice", + "docstrings": [ + "`slice(str, ~start, ~end)` returns the substring of `str` starting at\ncharacter `start` up to but not including `end`.\n- If either `start` or `end` is negative, then it is evaluated as\n`length(str - start)` or `length(str - end)`.\n- If `end` is greater than the length of `str`, then it is treated as\n`length(str)`.\n- If `start` is greater than `end`, slice returns the empty string.\nSee [`String.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) on MDN.\n\n## Examples\n\n```rescript\nString.slice(\"abcdefg\", ~start=2, ~end=5) == \"cde\"\nString.slice(\"abcdefg\", ~start=2, ~end=9) == \"cdefg\"\nString.slice(\"abcdefg\", ~start=-4, ~end=-2) == \"de\"\nString.slice(\"abcdefg\", ~start=5, ~end=1) == \"\"\n```" + ], + "signature": "let slice: (string, ~start: int, ~end: int) => string" }, { - "id": "Core.TypedArray.reduceRightWithIndex", + "id": "Stdlib.String.sliceToEnd", "kind": "value", - "name": "reduceRightWithIndex", - "docstrings": [], - "signature": "let reduceRightWithIndex: (t<'a>, ('b, 'a, int) => 'b, 'b) => 'b" + "name": "sliceToEnd", + "docstrings": [ + "`sliceToEnd(str, ~start)` returns the substring of `str` starting at character\n`start` to the end of the string.\n- If `start` is negative, then it is evaluated as `length(str - start)`.\n- If `start` is greater than the length of `str`, then sliceToEnd returns the empty string.\nSee [`String.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) on MDN.\n\n## Examples\n\n```rescript\nString.sliceToEnd(\"abcdefg\", ~start=4) == \"efg\"\nString.sliceToEnd(\"abcdefg\", ~start=-2) == \"fg\"\nString.sliceToEnd(\"abcdefg\", ~start=7) == \"\"\n```" + ], + "signature": "let sliceToEnd: (string, ~start: int) => string" }, { - "id": "Core.TypedArray.some", + "id": "Stdlib.String.split", "kind": "value", - "name": "some", - "docstrings": [], - "signature": "let some: (t<'a>, 'a => bool) => bool" + "name": "split", + "docstrings": [ + "`split(str, delimiter)` splits the given `str` at every occurrence of\n`delimiter` and returns an array of the resulting substrings.\nSee [`String.split`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split) on MDN.\n\n## Examples\n\n```rescript\nString.split(\"2018-01-02\", \"-\") == [\"2018\", \"01\", \"02\"]\nString.split(\"a,b,,c\", \",\") == [\"a\", \"b\", \"\", \"c\"]\nString.split(\"good::bad as great::awful\", \"::\") == [\"good\", \"bad as great\", \"awful\"]\nString.split(\"has-no-delimiter\", \";\") == [\"has-no-delimiter\"]\n```" + ], + "signature": "let split: (string, string) => array" }, { - "id": "Core.TypedArray.someWithIndex", + "id": "Stdlib.String.splitAtMost", "kind": "value", - "name": "someWithIndex", - "docstrings": [], - "signature": "let someWithIndex: (t<'a>, ('a, int) => bool) => bool" - } - ] - }, - "core/arraybuffer": { - "id": "Core.ArrayBuffer", - "name": "ArrayBuffer", - "docstrings": [], - "items": [ - { - "id": "Core.ArrayBuffer.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = Js.TypedArray2.ArrayBuffer.t" + "name": "splitAtMost", + "docstrings": [ + "`splitAtMost(str, delimiter, ~limit)` splits the given `str` at every\noccurrence of `delimiter` and returns an array of the first `limit` resulting\nsubstrings. If `limit` is negative or greater than the number of substrings,\nthe array will contain all the substrings.\n\n## Examples\n\n```rescript\nString.splitAtMost(\"ant/bee/cat/dog/elk\", \"/\", ~limit=3) == [\"ant\", \"bee\", \"cat\"]\nString.splitAtMost(\"ant/bee/cat/dog/elk\", \"/\", ~limit=0) == []\nString.splitAtMost(\"ant/bee/cat/dog/elk\", \"/\", ~limit=9) == [\"ant\", \"bee\", \"cat\", \"dog\", \"elk\"]\n```" + ], + "signature": "let splitAtMost: (string, string, ~limit: int) => array" }, { - "id": "Core.ArrayBuffer.make", + "id": "Stdlib.String.splitByRegExp", "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: int => t" + "name": "splitByRegExp", + "docstrings": [ + "`splitByRegExp(str, regexp)` splits the given `str` at every occurrence of\n`regexp` and returns an array of the resulting substrings.\nSee [`String.split`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split) on MDN.\n\n## Examples\n\n```rescript\nString.splitByRegExp(\"Jan,Feb,Mar\", %re(\"/,/\")) == [Some(\"Jan\"), Some(\"Feb\"), Some(\"Mar\")]\n```" + ], + "signature": "let splitByRegExp: (string, RegExp.t) => array>" }, { - "id": "Core.ArrayBuffer.byteLength", + "id": "Stdlib.String.splitByRegExpAtMost", "kind": "value", - "name": "byteLength", - "docstrings": [], - "signature": "let byteLength: t => int" + "name": "splitByRegExpAtMost", + "docstrings": [ + "`splitByRegExpAtMost(str, regexp, ~limit)` splits the given `str` at every\noccurrence of `regexp` and returns an array of the first `limit` resulting\nsubstrings. If `limit` is negative or greater than the number of substrings, the\narray will contain all the substrings.\nSee [`String.split`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split) on MDN.\n\n## Examples\n\n```rescript\nString.splitByRegExpAtMost(\"Hello World. How are you doing?\", / /, ~limit=3) ==\n [Some(\"Hello\"), Some(\"World.\"), Some(\"How\")]\n```" + ], + "signature": "let splitByRegExpAtMost: (\n string,\n RegExp.t,\n ~limit: int,\n) => array>" }, { - "id": "Core.ArrayBuffer.slice", + "id": "Stdlib.String.startsWith", "kind": "value", - "name": "slice", - "docstrings": [], - "signature": "let slice: (t, ~start: int, ~end: int) => t" + "name": "startsWith", + "docstrings": [ + "`startsWith(str, substr)` returns `true` if the `str` starts with `substr`,\n`false` otherwise.\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith) on MDN.\n\n## Examples\n\n```rescript\nString.startsWith(\"BuckleScript\", \"Buckle\") == true\nString.startsWith(\"BuckleScript\", \"\") == true\nString.startsWith(\"JavaScript\", \"Buckle\") == false\n```" + ], + "signature": "let startsWith: (string, string) => bool" }, { - "id": "Core.ArrayBuffer.sliceToEnd", + "id": "Stdlib.String.startsWithFrom", "kind": "value", - "name": "sliceToEnd", - "docstrings": [], - "signature": "let sliceToEnd: (t, ~start: int) => t" - } - ] - }, - "core/weakset": { - "id": "Core.WeakSet", - "name": "WeakSet", - "docstrings": [], - "items": [ + "name": "startsWithFrom", + "docstrings": [ + "`startsWithFrom(str, substr, n)` returns `true` if the `str` starts\nwith `substr` starting at position `n`, `false` otherwise. If `n` is negative,\nthe search starts at the beginning of `str`.\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith) on MDN.\n\n## Examples\n\n```rescript\nString.startsWithFrom(\"BuckleScript\", \"kle\", 3) == true\nString.startsWithFrom(\"BuckleScript\", \"\", 3) == true\nString.startsWithFrom(\"JavaScript\", \"Buckle\", 2) == false\n```" + ], + "signature": "let startsWithFrom: (string, string, int) => bool" + }, { - "id": "Core.WeakSet.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t<'a> = Js.WeakSet.t<'a>" + "id": "Stdlib.String.substring", + "kind": "value", + "name": "substring", + "docstrings": [ + "`substring(str, ~start, ~end)` returns characters `start` up to but not\nincluding end from `str`.\n- If `start` is less than zero, it is treated as zero.\n- If `end` is zero or negative, the empty string is returned.\n- If `start` is greater than `end`, the `start` and `end` points are swapped.\nSee [`String.substring`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substring) on MDN.\n\n## Examples\n\n```rescript\nString.substring(\"playground\", ~start=3, ~end=6) == \"ygr\"\nString.substring(\"playground\", ~start=6, ~end=3) == \"ygr\"\nString.substring(\"playground\", ~start=4, ~end=12) == \"ground\"\n```" + ], + "signature": "let substring: (string, ~start: int, ~end: int) => string" }, { - "id": "Core.WeakSet.make", + "id": "Stdlib.String.substringToEnd", "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: unit => t<'a>" + "name": "substringToEnd", + "docstrings": [ + "`substringToEnd(str, ~start)` returns the substring of `str` from position\n`start` to the end.\n- If `start` is less than or equal to zero, the entire string is returned.\n- If `start` is greater than or equal to the length of `str`, the empty string\nis returned.\nSee [`String.substring`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substring) on MDN.\n\n## Examples\n\n```rescript\nString.substringToEnd(\"playground\", ~start=4) == \"ground\"\nString.substringToEnd(\"playground\", ~start=-3) == \"playground\"\nString.substringToEnd(\"playground\", ~start=12) == \"\"\n```" + ], + "signature": "let substringToEnd: (string, ~start: int) => string" }, { - "id": "Core.WeakSet.add", + "id": "Stdlib.String.toLowerCase", "kind": "value", - "name": "add", - "docstrings": [], - "signature": "let add: (t<'a>, 'a) => t<'a>" + "name": "toLowerCase", + "docstrings": [ + "`toLowerCase(str)` converts `str` to lower case using the locale-insensitive\ncase mappings in the Unicode Character Database. Notice that the conversion can\ngive different results depending upon context, for example with the Greek\nletter sigma, which has two different lower case forms, one when it is the last\ncharacter in a string and another when it is not.\nSee [`String.toLowerCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLowerCase) on MDN.\n\n## Examples\n\n```rescript\nString.toLowerCase(\"ABC\") == \"abc\"\nString.toLowerCase(`ΣΠ`) == `σπ`\nString.toLowerCase(`ΠΣ`) == `πς`\n```" + ], + "signature": "let toLowerCase: string => string" }, { - "id": "Core.WeakSet.delete", + "id": "Stdlib.String.toLocaleLowerCase", "kind": "value", - "name": "delete", - "docstrings": [], - "signature": "let delete: (t<'a>, 'a) => bool" + "name": "toLocaleLowerCase", + "docstrings": [ + "`toLocaleLowerCase(str)` converts `str` to lower case using the current locale.\nSee [`String.toLocaleLowerCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLocaleLowerCase) on MDN." + ], + "signature": "let toLocaleLowerCase: string => string" }, { - "id": "Core.WeakSet.has", + "id": "Stdlib.String.toUpperCase", "kind": "value", - "name": "has", - "docstrings": [], - "signature": "let has: (t<'a>, 'a) => bool" - } - ] - }, - "core/set": { - "id": "Core.Set", - "name": "Set", - "docstrings": [ - "Bindings to the mutable JavaScript `Set`.\n\nSee [`Set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) on MDN." - ], - "items": [ + "name": "toUpperCase", + "docstrings": [ + "`toUpperCase(str)` converts `str` to upper case using the locale-insensitive\ncase mappings in the Unicode Character Database. Notice that the conversion can\nexpand the number of letters in the result, for example the German ß\ncapitalizes to two Ses in a row.\nSee [`String.toUpperCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toUpperCase) on MDN.\n\n## Examples\n\n```rescript\nString.toUpperCase(\"abc\") == \"ABC\"\nString.toUpperCase(`Straße`) == `STRASSE`\nString.toUpperCase(`πς`) == `ΠΣ`\n```" + ], + "signature": "let toUpperCase: string => string" + }, { - "id": "Core.Set.t", - "kind": "type", - "name": "t", + "id": "Stdlib.String.toLocaleUpperCase", + "kind": "value", + "name": "toLocaleUpperCase", "docstrings": [ - "Type representing an instance of `Set`." + "`toLocaleUpperCase(str)` converts `str` to upper case using the current locale.\nSee [`String.toLocaleUpperCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLocaleUpperCase) on MDN." ], - "signature": "type t<'a> = Js.Set.t<'a>" + "signature": "let toLocaleUpperCase: string => string" }, { - "id": "Core.Set.make", + "id": "Stdlib.String.trim", "kind": "value", - "name": "make", + "name": "trim", "docstrings": [ - "Creates a new, mutable JavaScript `Set`. A `Set` is a collection of unique values.\n\nSee [`Set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) on MDN.\n\n\n\n## Examples\n```rescript\n// You can annotate the type of your set if you want to\nlet mySet: Set.t = Set.make()\n\n// Or you can let ReScript infer what's in your Set\nlet set = Set.make()\nset->Set.add(\"Fine name\") // Inferred as Set.t\n```\n\n## Alternatives\nA JavaScript `Set` is mutable. If you're looking for an immutable alternative, check out `Belt.Set`." + "`trim(str)` returns a string that is `str` with whitespace stripped from both\nends. Internal whitespace is not removed.\nSee [`String.trim`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/trim) on MDN.\n\n## Examples\n\n```rescript\nString.trim(\" abc def \") == \"abc def\"\nString.trim(\"\\n\\r\\t abc def \\n\\n\\t\\r \") == \"abc def\"\n```" ], - "signature": "let make: unit => t<'a>" + "signature": "let trim: string => string" }, { - "id": "Core.Set.fromArray", + "id": "Stdlib.String.trimStart", "kind": "value", - "name": "fromArray", + "name": "trimStart", "docstrings": [ - "Turns an array of values into a Set. Meaning only unique values are preserved.\n\n## Examples\n```rescript\ntype languages = ReScript | JavaScript | TypeScript\nlet languageRank = [ReScript, JavaScript, TypeScript]\n\nlet set = Set.fromArray(languageRank) // Set.t\n\nswitch set->Set.has(ReScript) {\n| true => Console.log(\"Yay, ReScript is in there!\")\n| false => Console.log(\"Uh-oh, something is _terribly_ wrong with this program... abort.\")\n}\n```" + "`trimStart(str)` returns a string that is `str` with whitespace stripped from\nthe beginning of a string. Internal whitespace is not removed.\nSee [`String.trimStart`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/trimStart) on MDN.\n\n## Examples\n\n```rescript\nString.trimStart(\" Hello world! \") == \"Hello world! \"\nString.trimStart(\" Hello world! \") == \"Hello world! \"\n```" ], - "signature": "let fromArray: array<'a> => t<'a>" + "signature": "let trimStart: string => string" }, { - "id": "Core.Set.fromIterator", + "id": "Stdlib.String.trimEnd", "kind": "value", - "name": "fromIterator", + "name": "trimEnd", "docstrings": [ - "Turns an iterator into a `Set`.\n\n## Examples\n```rescript\n// Let's pretend we have an interator\n@val external someIterator: Iterator.t = \"someIterator\"\n\nlet set = Set.fromIterator(someIterator) // Set.t\n```" + "`trinEnd(str)` returns a string that is `str` with whitespace stripped from the\nend of a string. Internal whitespace is not removed.\nSee [`String.trimEnd`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/trimEnd) on MDN.\n\n## Examples\n\n```rescript\nString.trimEnd(\" Hello world! \") == \" Hello world!\"\nString.trimEnd(\" Hello world! \") == \" Hello world!\"\n```" ], - "signature": "let fromIterator: Core__Iterator.t<'a> => t<'a>" + "signature": "let trimEnd: string => string" }, { - "id": "Core.Set.size", + "id": "Stdlib.String.padStart", "kind": "value", - "name": "size", + "name": "padStart", "docstrings": [ - "Returns the size, the number of unique values, of the set.\n\n## Examples\n```rescript\nlet set = Set.make()\n\nset->Set.add(\"someValue\")\nset->Set.add(\"someValue\")\nset->Set.add(\"someValue2\")\n\nlet size = set->Set.size // 2\n```" + "`padStart(str, n, padStr)` returns a string that has been padded with `padStr`\n(multiple times, if needed) until the resulting string reaches the given `n`\nlength. The padding is applied from the start of the current string.\nSee [`String.padStart`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/padStart) on MDN.\n\n## Examples\n\n```rescript\nString.padStart(\"abc\", 5, \" \") == \" abc\"\nString.padStart(\"abc\", 6, \"123465\") == \"123abc\"\n```" ], - "signature": "let size: t<'a> => int" + "signature": "let padStart: (string, int, string) => string" }, { - "id": "Core.Set.clear", + "id": "Stdlib.String.padEnd", "kind": "value", - "name": "clear", + "name": "padEnd", "docstrings": [ - "Clears all entries in the set.\n\n## Examples\n```rescript\nlet set = Set.make()\n\nset->Set.add(\"someKey\")\nset->Set.size // 1\n\nset->Set.clear\nset->Set.size // 0\n```" + "`padEnd(str, n, padStr)` returns a string that has been padded with `padStr`\n(multiple times, if needed) until the resulting string reaches the given `n`\nlength. The padding is applied from the end of the current string.\nSee [`String.padEnd`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/padEnd) on MDN.\n\n## Examples\n\n```rescript\nString.padEnd(\"Hello\", 10, \".\") == \"Hello.....\"\nString.padEnd(\"abc\", 1, \"\") == \"abc\"\n```" ], - "signature": "let clear: t<'a> => unit" + "signature": "let padEnd: (string, int, string) => string" }, { - "id": "Core.Set.add", + "id": "Stdlib.String.getSymbol", "kind": "value", - "name": "add", - "docstrings": [ - "Adds a new value to the set.\n\n## Examples\n```rescript\nlet set = Set.make()\nset->Set.add(\"someValue\")\n```" - ], - "signature": "let add: (t<'a>, 'a) => unit" + "name": "getSymbol", + "docstrings": [], + "signature": "let getSymbol: (string, Symbol.t) => option<'a>" }, { - "id": "Core.Set.delete", + "id": "Stdlib.String.getSymbolUnsafe", "kind": "value", - "name": "delete", - "docstrings": [ - "Deletes the provided `value` from the set. Returns a `bool` for whether the value existed, and was deleted.\n\n## Examples\n```rescript\nlet set = Set.make()\nset->Set.add(\"someValue\")\nlet didDeleteValue = set->Set.delete(\"someValue\")\nConsole.log(didDeleteValue) // Logs `true` to the console, becuase the set had the value, so it was successfully deleted\n\nlet didDeleteValue = set->Set.delete(\"someNonExistantKey\")\nConsole.log(didDeleteValue) // Logs `false` to the console, becuase the value did not exist in the set\n```" - ], - "signature": "let delete: (t<'a>, 'a) => bool" + "name": "getSymbolUnsafe", + "docstrings": [], + "signature": "let getSymbolUnsafe: (string, Symbol.t) => 'a" }, { - "id": "Core.Set.has", + "id": "Stdlib.String.setSymbol", "kind": "value", - "name": "has", - "docstrings": [ - "Checks whether the set has a specific value.\n\n## Examples\n```rescript\nlet set = Set.make()\nset->Set.add(\"someValue\")\n\nswitch set->Set.has(\"someValue\") {\n| false => Console.log(\"Nope, didn't have it.\")\n| true => Console.log(\"Yay, we have the value!\")\n}\n```" - ], - "signature": "let has: (t<'a>, 'a) => bool" + "name": "setSymbol", + "docstrings": [], + "signature": "let setSymbol: (string, Symbol.t, 'a) => unit" }, { - "id": "Core.Set.forEach", + "id": "Stdlib.String.localeCompare", "kind": "value", - "name": "forEach", + "name": "localeCompare", "docstrings": [ - "Iterates through all values of the set.\n\n## Examples\n```rescript\nlet set = Set.make()\nset->Set.add(\"someValue\")\nset->Set.add(\"someValue2\")\n\nset->Set.forEach(value => {\n Console.log(value)\n})\n```" + "`localeCompare(referenceStr, compareStr)` returns a float than indicatings\nwhether a reference string comes before or after, or is the same as the given\nstring in sort order. If `referenceStr` occurs before `compareStr` positive if\nthe `referenceStr` occurs after `compareStr`, `0` if they are equivalent.\nDo not rely on exact return values of `-1` or `1`\nSee [`String.localeCompare`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/localeCompare) on MDN.\n\n## Examples\n\n```rescript\nString.localeCompare(\"a\", \"c\") < 0.0 == true\nString.localeCompare(\"a\", \"a\") == 0.0\n```" ], - "signature": "let forEach: (t<'a>, 'a => unit) => unit" + "signature": "let localeCompare: (string, string) => float" }, { - "id": "Core.Set.values", + "id": "Stdlib.String.ignore", "kind": "value", - "name": "values", + "name": "ignore", "docstrings": [ - "Returns an iterator that holds all values of the set.\n\n## Examples\n```rescript\nlet set = Set.make()\nset->Set.add(\"someValue\")\nset->Set.add(\"anotherValue\")\n\nlet values = set->Set.values\n\n// Logs the first value\nConsole.log(Iterator.next(values).value)\n\n// You can also turn the iterator into an array.\n// Remember that an iterator consumes values. We'll need a fresh values iterator to get an array of all values, since we consumed a value via `next` above already.\nConsole.log(set->Set.values->Iterator.toArray)\n```" + "`ignore(string)` ignores the provided string and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." ], - "signature": "let values: t<'a> => Core__Iterator.t<'a>" + "signature": "let ignore: string => unit" } ] }, - "core/weakmap": { - "id": "Core.WeakMap", - "name": "WeakMap", + "stdlib/result": { + "id": "Stdlib.Result", + "name": "Result", "docstrings": [], "items": [ { - "id": "Core.WeakMap.t", + "id": "Stdlib.Result.t", "kind": "type", "name": "t", - "docstrings": [], - "signature": "type t<'k, 'v> = Js.WeakMap.t<'k, 'v>" + "docstrings": [ + "Result types are really useful to describe the result of a certain operation\n without relying on exceptions or `option` types.\n\n This module gives you useful utilities to create and combine `Result` data." + ], + "signature": "type t<'res, 'err> = result<'res, 'err> =\n | Ok('res)\n | Error('err)" }, { - "id": "Core.WeakMap.make", + "id": "Stdlib.Result.getExn", "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: unit => t<'k, 'v>" + "name": "getExn", + "docstrings": [ + "`getExn(res)`: when `res` is `Ok(n)`, returns `n` when `res` is `Error(m)`, raise an exception\n\n ```res example\n Result.getExn(Result.Ok(42)) == 42\n\n switch Result.getExn(Error(\"Invalid data\")) {\n | exception Not_found => assert(true)\n | _ => assert(false)\n }\n ```" + ], + "signature": "let getExn: result<'a, 'b> => 'a" }, { - "id": "Core.WeakMap.get", + "id": "Stdlib.Result.mapOr", "kind": "value", - "name": "get", - "docstrings": [], - "signature": "let get: (t<'k, 'v>, 'k) => option<'v>" + "name": "mapOr", + "docstrings": [ + "`mapOr(res, default, f)`: When res is `Ok(n)`, returns `f(n)`, otherwise `default`.\n\n## Examples\n\n```rescript\nlet ok = Ok(42)\nResult.mapOr(ok, 0, (x) => x / 2) == 21\n\nlet error = Error(\"Invalid data\")\nResult.mapOr(error, 0, (x) => x / 2) == 0\n```" + ], + "signature": "let mapOr: (result<'a, 'c>, 'b, 'a => 'b) => 'b" }, { - "id": "Core.WeakMap.has", + "id": "Stdlib.Result.mapWithDefault", "kind": "value", - "name": "has", + "name": "mapWithDefault", "docstrings": [], - "signature": "let has: (t<'k, 'v>, 'k) => bool" + "signature": "let mapWithDefault: (result<'a, 'c>, 'b, 'a => 'b) => 'b", + "deprecated": "Use mapOr instead" }, { - "id": "Core.WeakMap.set", + "id": "Stdlib.Result.map", "kind": "value", - "name": "set", - "docstrings": [], - "signature": "let set: (t<'k, 'v>, 'k, 'v) => t<'k, 'v>" + "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(Int.toFloat(x))\n\nResult.map(Ok(64), f) == Ok(8.0)\n\nResult.map(Error(\"Invalid data\"), f) == Error(\"Invalid data\")\n```" + ], + "signature": "let map: (result<'a, 'c>, 'a => 'b) => result<'b, 'c>" }, { - "id": "Core.WeakMap.delete", + "id": "Stdlib.Result.flatMap", "kind": "value", - "name": "delete", - "docstrings": [], - "signature": "let delete: (t<'k, 'v>, 'k) => bool" - } - ] - }, - "core/map": { - "id": "Core.Map", - "name": "Map", - "docstrings": [ - "Bindings to the mutable JavaScript `Map`.\n\nSee [`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) on MDN." - ], - "items": [ - { - "id": "Core.Map.t", - "kind": "type", - "name": "t", + "name": "flatMap", "docstrings": [ - "Type representing an instance of `Map`." + "`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`Result`.\n\n## Examples\n\n```rescript\nlet recip = (x) =>\n if (x !== 0.0) {\n Ok(1.0 /. x)\n } else {\n Error(\"Divide by zero\")\n }\n\nResult.flatMap(Ok(2.0), recip) == Ok(0.5)\n\nResult.flatMap(Ok(0.0), recip) == Error(\"Divide by zero\")\n\nResult.flatMap(Error(\"Already bad\"), recip) == Error(\"Already bad\")\n```" ], - "signature": "type t<'k, 'v> = Js.Map.t<'k, 'v>" + "signature": "let flatMap: (result<'a, 'c>, 'a => result<'b, 'c>) => result<'b, 'c>" }, { - "id": "Core.Map.make", + "id": "Stdlib.Result.getOr", "kind": "value", - "name": "make", + "name": "getOr", "docstrings": [ - "Creates a new, mutable JavaScript `Map`. A `Map` can have any values as both keys and values.\n\nSee [`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) on MDN.\n\n\n\n## Examples\n```rescript\n`make()`\n// You can annotate the type of your map if you want to\nlet myMap: Map.t = Map.make()\n\n// Or you can let ReScript infer what's in your map\nlet map = Map.make()\nmap->Map.set(\"lang\", \"ReScript\") // Inferred as Map.t\n```\n\n## Alternatives\nA JavaScript `Map` is mutable. If you're looking for an immutable alternative, check out`Belt.Map`." + "`getOr(res, defaultValue)`: If `res` is `Ok(n)`, returns `n`, otherwise `default`\n\n## Examples\n\n```rescript\nResult.getOr(Ok(42), 0) == 42\n\nResult.getOr(Error(\"Invalid Data\"), 0) == 0\n```" ], - "signature": "let make: unit => t<'k, 'v>" + "signature": "let getOr: (result<'a, 'b>, 'a) => 'a" }, { - "id": "Core.Map.fromArray", + "id": "Stdlib.Result.getWithDefault", "kind": "value", - "name": "fromArray", + "name": "getWithDefault", + "docstrings": [], + "signature": "let getWithDefault: (result<'a, 'b>, 'a) => 'a", + "deprecated": "Use getOr instead" + }, + { + "id": "Stdlib.Result.isOk", + "kind": "value", + "name": "isOk", "docstrings": [ - "Turns an array of key/value pairs into a Map.\n\n## Examples\n```rescript\ntype languages = ReScript | JavaScript | TypeScript\nlet languageRank = [(ReScript, 1), (JavaScript, 2), (TypeScript, 3)]\n\nlet map = Map.fromArray(languageRank) // Map.t\n\nswitch map->Map.get(ReScript) {\n| Some(1) => Console.log(\"Yay, ReScript is #1!\")\n| _ => Console.log(\"Uh-oh, something is _terribly_ wrong with this program... abort.\")\n}\n```" + "`isOk(res)`: Returns `true` if `res` is of the form `Ok(n)`, `false` if it is the `Error(e)` variant." ], - "signature": "let fromArray: array<('k, 'v)> => t<'k, 'v>" + "signature": "let isOk: result<'a, 'b> => bool" }, { - "id": "Core.Map.fromIterator", + "id": "Stdlib.Result.isError", "kind": "value", - "name": "fromIterator", + "name": "isError", "docstrings": [ - "Turns an iterator in the shape of `('key, 'value)` into a `Map`.\n\n## Examples\n```rescript\n// Let's pretend we have an interator in the correct shape\n@val external someIterator: Iterator.t<(string, int)> = \"someIterator\"\n\nlet map = Map.fromIterator(someIterator) // Map.t\n```" + "`isError(res)`: Returns `true` if `res` is of the form `Error(e)`, `false` if it is the `Ok(n)` variant." ], - "signature": "let fromIterator: Core__Iterator.t<('k, 'v)> => t<'k, 'v>" + "signature": "let isError: result<'a, 'b> => bool" }, { - "id": "Core.Map.size", + "id": "Stdlib.Result.equal", "kind": "value", - "name": "size", + "name": "equal", "docstrings": [ - "Returns the size, the number of key/value pairs, of the map.\n\n## Examples\n```rescript\nlet map = Map.make()\n\nmap->Map.set(\"someKey\", \"someValue\")\n\nlet size = map->Map.size // 1\n```" + "`equal(res1, res2, f)`: Determine if two `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 = Ok(42)\n\nlet good2 = Ok(32)\n\nlet bad1 = Error(\"invalid\")\n\nlet bad2 = Error(\"really invalid\")\n\nlet mod10equal = (a, b) => mod(a, 10) === mod(b, 10)\n\nResult.equal(good1, good2, mod10equal) == true\n\nResult.equal(good1, bad1, mod10equal) == false\n\nResult.equal(bad2, good2, mod10equal) == false\n\nResult.equal(bad1, bad2, mod10equal) == true\n```" ], - "signature": "let size: t<'k, 'v> => int" + "signature": "let equal: (result<'a, 'c>, result<'b, 'd>, ('a, 'b) => bool) => bool" }, { - "id": "Core.Map.clear", + "id": "Stdlib.Result.compare", "kind": "value", - "name": "clear", + "name": "compare", "docstrings": [ - "Clears all entries in the map.\n\n## Examples\n```rescript\nlet map = Map.make()\n\nmap->Map.set(\"someKey\", \"someValue\")\nmap->Map.size // 1\n\nmap->Map.clear\nmap->Map.size // 0\n```" + "`compare(res1, res2, f)`: Compare two `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 = Ok(59)\n\nlet good2 = Ok(37)\n\nlet bad1 = Error(\"invalid\")\n\nlet bad2 = Error(\"really invalid\")\n\nlet mod10cmp = (a, b) => Int.compare(mod(a, 10), mod(b, 10))\n\nResult.compare(Ok(39), Ok(57), mod10cmp) == 1.\n\nResult.compare(Ok(57), Ok(39), mod10cmp) == (-1.)\n\nResult.compare(Ok(39), Error(\"y\"), mod10cmp) == 1.\n\nResult.compare(Error(\"x\"), Ok(57), mod10cmp) == (-1.)\n\nResult.compare(Error(\"x\"), Error(\"y\"), mod10cmp) == 0.\n```" ], - "signature": "let clear: t<'k, 'v> => unit" + "signature": "let compare: (\n result<'a, 'c>,\n result<'b, 'd>,\n ('a, 'b) => Ordering.t,\n) => Ordering.t" }, { - "id": "Core.Map.forEach", + "id": "Stdlib.Result.forEach", "kind": "value", "name": "forEach", "docstrings": [ - "Iterates through all values of the map.\n\n> Please note that this is *without the keys*, just the values. If you need the key as well, use `Map.forEachWithKey`.\n\n## Examples\n```rescript\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\nmap->Map.set(\"someKey2\", \"someValue2\")\n\nmap->Map.forEach(value => {\n Console.log(value)\n})\n```" + "`forEach(res, f)` runs the provided function `f` on the `Ok` value. If `res` is `Error`, nothing happens.\n\n## Examples\n\n```rescript\nResult.forEach(Ok(3), Console.log) // Logs \"3\", returns ()\nResult.forEach(Error(\"x\"), Console.log) // Does nothing, returns ()\n```" ], - "signature": "let forEach: (t<'k, 'v>, 'v => unit) => unit" + "signature": "let forEach: (result<'a, 'b>, 'a => unit) => unit" }, { - "id": "Core.Map.forEachWithKey", + "id": "Stdlib.Result.mapError", "kind": "value", - "name": "forEachWithKey", + "name": "mapError", "docstrings": [ - "Iterates through all values of the map, including the key for each value.\n\n## Examples\n```rescript\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\nmap->Map.set(\"someKey2\", \"someValue2\")\n\nmap->Map.forEachWithKey((value, key) => {\n Console.log2(value, key)\n})\n```" + "`mapError(r, f)` generates a new `result` by applying the function `f` to the `Error` value. If the source is `Ok`, return it as-is.\n\n## Examples\n\n```rescript\nlet format = n => `Error code: ${n->Int.toString}`\nResult.mapError(Error(14), format) // Error(\"Error code: 14\")\nResult.mapError(Ok(\"abc\"), format) // Ok(\"abc\")\n```" ], - "signature": "let forEachWithKey: (t<'k, 'v>, ('v, 'k) => unit) => unit" + "signature": "let mapError: (result<'a, 'b>, 'b => 'c) => result<'a, 'c>" }, { - "id": "Core.Map.get", + "id": "Stdlib.Result.all", "kind": "value", - "name": "get", + "name": "all", "docstrings": [ - "Returns the value for a key, if a value exists at that key.\n\n## Examples\n```rescript\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\n\nswitch map->Map.get(\"someKey\") {\n| None => Console.log(\"Nope, didn't have it.\")\n| Some(value) => Console.log2(\"Yay, had the value, and it's:\", value)\n}\n```" + "`all(results)` returns a result of array if all options are Ok, otherwise returns Error.\n## Examples\n```rescript\nResult.all([Ok(1), Ok(2), Ok(3)]) // Ok([1, 2, 3])\nResult.all([Ok(1), Error(1)]) // Error(1)\n```" ], - "signature": "let get: (t<'k, 'v>, 'k) => option<'v>" + "signature": "let all: array> => result, 'b>" }, { - "id": "Core.Map.has", + "id": "Stdlib.Result.all2", "kind": "value", - "name": "has", + "name": "all2", "docstrings": [ - "Checks whether the map has a specific key.\n\n## Examples\n```rescript\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\n\nswitch map->Map.has(\"someKey\") {\n| false => Console.log(\"Nope, didn't have it.\")\n| true => Console.log(\"Yay, we have the value!\")\n}\n```" + "`all2((r1, r2))`. Like `all()`, but with a fixed size tuple of 2" ], - "signature": "let has: (t<'k, 'v>, 'k) => bool" + "signature": "let all2: (\n (result<'r1, 'e>, result<'r2, 'e>),\n) => result<('r1, 'r2), 'e>" }, { - "id": "Core.Map.set", + "id": "Stdlib.Result.all3", "kind": "value", - "name": "set", + "name": "all3", "docstrings": [ - "Sets the provided `value` to the provided `key`.\n\n## Examples\n```rescript\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\n```" + "`all3((r1, r2, r3))`. Like `all()`, but with a fixed size tuple of 2" ], - "signature": "let set: (t<'k, 'v>, 'k, 'v) => unit" + "signature": "let all3: (\n (result<'r1, 'e>, result<'r2, 'e>, result<'r3, 'e>),\n) => result<('r1, 'r2, 'r3), 'e>" }, { - "id": "Core.Map.delete", + "id": "Stdlib.Result.all4", "kind": "value", - "name": "delete", + "name": "all4", "docstrings": [ - "Deletes the provided `key` and its value from the map. Returns a `bool` for whether the key existed, and was deleted.\n\n## Examples\n```rescript\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\nlet didDeleteKey = map->Map.delete(\"someKey\")\nConsole.log(didDeleteKey) // Logs `true` to the console, becuase the map had the key, so it was successfully deleted\n\nlet didDeleteKey = map->Map.delete(\"someNonExistantKey\")\nConsole.log(didDeleteKey) // Logs `false` to the console, becuase the key did not exist\n```" + "`all4((r1, r2, r3, r4))`. Like `all()`, but with a fixed size tuple of 2" ], - "signature": "let delete: (t<'k, 'v>, 'k) => bool" + "signature": "let all4: (\n (\n result<'r1, 'e>,\n result<'r2, 'e>,\n result<'r3, 'e>,\n result<'r4, 'e>,\n ),\n) => result<('r1, 'r2, 'r3, 'r4), 'e>" }, { - "id": "Core.Map.keys", + "id": "Stdlib.Result.all5", "kind": "value", - "name": "keys", + "name": "all5", "docstrings": [ - "Returns an iterator that holds all keys of the map.\n\n## Examples\n```rescript\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\nmap->Map.set(\"anotherKey\", \"anotherValue\")\n\nlet keys = map->Map.keys\n\n// Logs the first key\nConsole.log(Iterator.next(keys).value)\n\n// You can also turn the iterator into an array.\n// Remember that an iterator consumes values. We'll need a fresh keys iterator to get an array of all keys, since we consumed a value via `next` above already.\nConsole.log(map->Map.keys->Iterator.toArray)\n```" + "`all5((r1, r2, r3, r4, r5))`. Like `all()`, but with a fixed size tuple of 2" ], - "signature": "let keys: t<'k, 'v> => Core__Iterator.t<'k>" + "signature": "let all5: (\n (\n result<'r1, 'e>,\n result<'r2, 'e>,\n result<'r3, 'e>,\n result<'r4, 'e>,\n result<'r5, 'e>,\n ),\n) => result<('r1, 'r2, 'r3, 'r4, 'r5), 'e>" }, { - "id": "Core.Map.values", + "id": "Stdlib.Result.all6", "kind": "value", - "name": "values", + "name": "all6", "docstrings": [ - "Returns an iterator that holds all values of the map.\n\n## Examples\n```rescript\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\nmap->Map.set(\"anotherKey\", \"anotherValue\")\n\nlet values = map->Map.values\n\n// Logs the first value\nConsole.log(Iterator.next(values).value)\n\n// You can also turn the iterator into an array.\n// Remember that an iterator consumes values. We'll need a fresh values iterator to get an array of all values, since we consumed a value via `next` above already.\nConsole.log(map->Map.values->Iterator.toArray)\n```" + "`all6((r1, r2, r3, r4, r5, r6))`. Like `all()`, but with a fixed size tuple of 2" ], - "signature": "let values: t<'k, 'v> => Core__Iterator.t<'v>" + "signature": "let all6: (\n (\n result<'r1, 'e>,\n result<'r2, 'e>,\n result<'r3, 'e>,\n result<'r4, 'e>,\n result<'r5, 'e>,\n result<'r6, 'e>,\n ),\n) => result<('r1, 'r2, 'r3, 'r4, 'r5, 'r6), 'e>" }, { - "id": "Core.Map.entries", + "id": "Stdlib.Result.ignore", "kind": "value", - "name": "entries", + "name": "ignore", "docstrings": [ - "Returns an iterator that holds all entries of the map.\nAn entry is represented as a tuple of `('key, 'value)`,\n\n## Examples\n```rescript\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\nmap->Map.set(\"anotherKey\", \"anotherValue\")\n\nlet entries = map->Map.entries\n\n// Logs the first value\nConsole.log(Iterator.next(entries).value)\n\n// You can also turn the iterator into an array.\n// Remember that an iterator consumes entries. We'll need a fresh entries iterator to get an array of all entries, since we consumed a value via `next` above already.\nConsole.log(map->Map.entries->Iterator.toArray)\n```" + "`ignore(result)` ignores the provided result and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." ], - "signature": "let entries: t<'k, 'v> => Core__Iterator.t<('k, 'v)>" + "signature": "let ignore: result<'res, 'err> => unit" } ] }, - "core/asynciterator": { - "id": "Core.AsyncIterator", - "name": "AsyncIterator", + "stdlib/regexp": { + "id": "Stdlib.RegExp", + "name": "RegExp", "docstrings": [ - "Bindings to async iterators, a way to do async iteration in JavaScript.\n\nSee [async iterator protocols](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#the_async_iterator_and_async_iterable_protocols) on MDN." + "Functions for handling RegExp's in ReScript.\n\nSee [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp) on MDN." ], "items": [ { - "id": "Core.AsyncIterator.t", + "id": "Stdlib.RegExp.t", "kind": "type", "name": "t", "docstrings": [ - "The type representing an async iterator." + "Type representing an instantiated `RegExp`." ], - "signature": "type t<'a>" + "signature": "type t" }, { - "id": "Core.AsyncIterator.value", - "kind": "type", - "name": "value", - "docstrings": [], - "signature": "type value<'a> = {done: bool, value: option<'a>}" + "id": "Stdlib.RegExp.fromString", + "kind": "value", + "name": "fromString", + "docstrings": [ + "`fromString(string)` creates a `RegExp.t` from the provided string. This can then be used to match on strings using `RegExp.exec`.\n\nSee [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/RegExp) on MDN.\n\n## Examples\n```rescript\n// Match the first word in a sentence\nlet regexp = RegExp.fromString(\"\\\\w+\")\n\nswitch regexp->RegExp.exec(\"ReScript is pretty cool, right?\") {\n| None => Console.log(\"Nope, no match...\")\n| Some(result) => Console.log(result->RegExp.Result.fullMatch) // Prints \"ReScript\"\n}\n\n// Match 'foo' with case insensitive flag\nlet regexp = RegExp.fromString(\"foo\", ~flags=\"i\")\n\nswitch regexp->RegExp.exec(\"FOO\") {\n| None => Console.log(\"Nope, no match...\")\n| Some(result) => Console.log(result->RegExp.Result.fullMatch) // Prints \"FOO\"\n}\n```" + ], + "signature": "let fromString: (string, ~flags: string=?) => t" }, { - "id": "Core.AsyncIterator.next", + "id": "Stdlib.RegExp.fromStringWithFlags", "kind": "value", - "name": "next", + "name": "fromStringWithFlags", "docstrings": [ - "`next(asyncIterator)`\n\nReturns the next value of the iterator, if any.\n\nSee [async iterator protocols](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#the_async_iterator_and_async_iterable_protocols) on MDN.\n\n## Examples\n- A simple example, getting the next value:\n```rescript\n@val external asyncIterator: AsyncIterator.t = \"someAsyncIterator\"\nlet {AsyncIterator.done, value} = await asyncIterator->AsyncIterator.next\n```\n\n- Complete example, including looping over all values:\n```rescript\n// Let's pretend we get an async iterator returning ints from somewhere.\n@val external asyncIterator: AsyncIterator.t = \"someAsyncIterator\"\n\n\nlet processMyAsyncIterator = async () => {\n // ReScript doesn't have `for ... of` loops, but it's easy to mimic using a while loop.\n let break = ref(false)\n\n while !break.contents {\n // Await the next iterator value\n let {value, done} = await asyncIterator->AsyncIterator.next\n\n // Exit the while loop if the iterator says it's done\n break := done\n\n // This will log the (int) value of the current async iteration, if a value was returned.\n Console.log(value)\n }\n}\n```" + "`fromStringWithFlags(string)` creates a `RegExp.t` from the provided string, using the provided `flags`. This can then be used to match on strings using `RegExp.exec`.\n\nSee [`RegExp parameters`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/RegExp#parameters) on MDN.\n\n## Examples\n```rescript\n// Match the first word in a sentence\nlet regexp = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"g\")\n\nswitch regexp->RegExp.exec(\"ReScript is pretty cool, right?\") {\n| None => Console.log(\"Nope, no match...\")\n| Some(result) => Console.log(result->RegExp.Result.fullMatch) // Prints \"ReScript\"\n}\n```" ], - "signature": "let next: t<'a> => promise>" + "signature": "let fromStringWithFlags: (string, ~flags: string) => t", + "deprecated": "Use `fromString` instead" }, { - "id": "Core.AsyncIterator.forEach", + "id": "Stdlib.RegExp.test", "kind": "value", - "name": "forEach", + "name": "test", "docstrings": [ - "`forEach(iterator, fn)` consumes all values in the async iterator and runs the callback `fn` for each value.\n\nSee [iterator protocols](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) on MDN.\n\n## Examples\n```rescript\n// Let's pretend we get an async iterator returning ints from somewhere.\n@val external asyncIterator: AsyncIterator.t = \"someAsyncIterator\"\n\nawait asyncIterator->AsyncIterator.forEach(value =>\n switch value {\n | Some(value) if value > 10 => Console.log(\"More than 10!\")\n | _ => ()\n }\n)\n```" + "`test(regexp, string)` tests whether the provided `regexp` matches on the provided string.\n\nSee [`RegExp.test`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/test) on MDN.\n\n## Examples\n```rescript\n// Match the first word in a sentence\nlet regexp = RegExp.fromString(\"\\\\w+\")\n\nif regexp->RegExp.test(\"ReScript is cool!\") {\n Console.log(\"Yay, there's a word in there.\")\n}\n```" ], - "signature": "let forEach: (t<'a>, option<'a> => unit) => promise" - } - ] - }, - "core/iterator": { - "id": "Core.Iterator", - "name": "Iterator", - "docstrings": [ - "Bindings to JavaScript iterators.\n\nSee [`iterator protocols`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) on MDN." - ], - "items": [ + "signature": "let test: (t, string) => bool" + }, { - "id": "Core.Iterator.t", - "kind": "type", - "name": "t", + "id": "Stdlib.RegExp.exec", + "kind": "value", + "name": "exec", "docstrings": [ - "The type representing an iterator." + "`exec(regexp, string)` executes the provided regexp on the provided string, optionally returning a `RegExp.Result.t` if the regexp matches on the string.\n\nSee [`RegExp.exec`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/exec) on MDN.\n\n## Examples\n```rescript\n// Match the first word in a sentence\nlet regexp = RegExp.fromString(\"\\\\w+\")\n\nswitch regexp->RegExp.exec(\"ReScript is pretty cool, right?\") {\n| None => Console.log(\"Nope, no match...\")\n| Some(result) => Console.log(result->RegExp.Result.fullMatch) // Prints \"ReScript\"\n}\n```" ], - "signature": "type t<'a>" + "signature": "let exec: (t, string) => option" }, { - "id": "Core.Iterator.value", - "kind": "type", - "name": "value", + "id": "Stdlib.RegExp.lastIndex", + "kind": "value", + "name": "lastIndex", "docstrings": [ - "The current value of an iterator." + "`lastIndex(regexp)` returns the index the next match will start from.\n\nSee [`RegExp.lastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/lastIndex) on MDN.\n\n## Examples\n```rescript\n// Match the first word in a sentence\nlet regexp = RegExp.fromString(\"\\\\w+\")\nlet someStr = \"Many words here.\"\n\nConsole.log(regexp->RegExp.lastIndex) // Logs `0` to the console\n\nregexp->RegExp.exec(someStr)->ignore\n\nConsole.log(regexp->RegExp.lastIndex) // Logs `4` to the console\n```" ], - "signature": "type value<'a> = {done: bool, value: option<'a>}" + "signature": "let lastIndex: t => int" }, { - "id": "Core.Iterator.next", + "id": "Stdlib.RegExp.setLastIndex", "kind": "value", - "name": "next", + "name": "setLastIndex", "docstrings": [ - "Returns the next value of the iterator, if any.\n\nSee [iterator protocols](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) on MDN.\n\n## Examples\n```rescript\n@val external someIterator: Iterator.t = \"someIterator\"\n\n// Pulls out the next value of the iterator\nlet {Iterator.done, value} = someIterator->Iterator.next\n```" + "`setLastIndex(regexp, index)` set the index the next match will start from.\n\nSee [`RegExp.lastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/lastIndex) on MDN.\n\n## Examples\n```rescript\n// Match the first word in a sentence\nlet regexp = RegExp.fromString(\"\\\\w+\")\nlet someStr = \"Many words here.\"\n\nregexp->RegExp.setLastIndex(4)\nregexp->RegExp.exec(someStr)->ignore\n\nConsole.log(regexp->RegExp.lastIndex) // Logs `10` to the console\n```" ], - "signature": "let next: t<'a> => value<'a>" + "signature": "let setLastIndex: (t, int) => unit" }, { - "id": "Core.Iterator.toArray", + "id": "Stdlib.RegExp.ignoreCase", "kind": "value", - "name": "toArray", + "name": "ignoreCase", "docstrings": [ - "Turns an iterator into an array of the remaining values.\nRemember that each invocation of `next` of an iterator consumes a value. `Iterator.toArray` will consume all remaining values of the iterator and return them in an array to you.\n\nSee [iterator protocols](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) on MDN.\n\n## Examples\n```rescript\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\nmap->Map.set(\"someKey2\", \"someValue2\")\n\n// `Map.keys` returns all keys of the map as an iterator.\nlet mapKeysAsArray = map->Map.keys->Iterator.toArray\n\nConsole.log(mapKeysAsArray) // Logs [\"someKey\", \"someKey2\"] to the console.\n```" + "`ignoreCase(regexp)` returns whether the ignore case (`i`) flag is set on this `RegExp`.\n\nSee [`RegExp.ignoreCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/ignoreCase) on MDN.\n\n## Examples\n```rescript\nlet regexp1 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"g\")\nConsole.log(regexp1->RegExp.ignoreCase) // Logs `false`, since `i` is not set\n\nlet regexp2 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"i\")\nConsole.log(regexp2->RegExp.ignoreCase) // Logs `true`, since `i` is set\n```" ], - "signature": "let toArray: t<'a> => array<'a>" + "signature": "let ignoreCase: t => bool" }, { - "id": "Core.Iterator.toArrayWithMapper", + "id": "Stdlib.RegExp.global", "kind": "value", - "name": "toArrayWithMapper", + "name": "global", "docstrings": [ - "`toArray(iterator)` turns `iterator` into an array of its remaining values, applying the provided mapper function on each item.\nRemember that each invocation of `next` of an iterator consumes a value. `Iterator.toArrayWithMapper` will consume all remaining values of the iterator and return them in an array to you.\n\nSee [iterator protocols](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) on MDN.\n\n## Examples\n```rescript\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\nmap->Map.set(\"someKey2\", \"someValue2\")\n\n// `Map.keys` returns all keys of the map as an iterator.\nlet mapKeysAsArray = map\n ->Map.keys\n ->Iterator.toArrayWithMapper(key => key->String.length)\n\nConsole.log(mapKeysAsArray) // Logs [7, 8] to the console.\n```" + "`global(regexp)` returns whether the global (`g`) flag is set on this `RegExp`.\n\nSee [`RegExp.global`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/global) on MDN.\n\n## Examples\n```rescript\nlet regexp1 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"g\")\nConsole.log(regexp1->RegExp.global) // Logs `true`, since `g` is set\n\nlet regexp2 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"i\")\nConsole.log(regexp2->RegExp.global) // Logs `false`, since `g` is not set\n```" ], - "signature": "let toArrayWithMapper: (t<'a>, 'a => 'b) => array<'b>" + "signature": "let global: t => bool" }, { - "id": "Core.Iterator.forEach", + "id": "Stdlib.RegExp.multiline", "kind": "value", - "name": "forEach", + "name": "multiline", + "docstrings": [ + "`multiline(regexp)` returns whether the multiline (`m`) flag is set on this `RegExp`.\n\nSee [`RegExp.multiline`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/multiline) on MDN.\n\n## Examples\n```rescript\nlet regexp1 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"g\")\nConsole.log(regexp1->RegExp.multiline) // Logs `false`, since `m` is not set\n\nlet regexp2 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"mi\")\nConsole.log(regexp2->RegExp.multiline) // Logs `true`, since `m` is set\n```" + ], + "signature": "let multiline: t => bool" + }, + { + "id": "Stdlib.RegExp.source", + "kind": "value", + "name": "source", + "docstrings": [ + "`source(regexp)` returns the source text for this `RegExp`, without the two forward slashes (if present), and without any set flags.\n\nSee [`RegExp.source`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/source) on MDN.\n\n## Examples\n```rescript\nlet regexp = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"g\")\nConsole.log(regexp->RegExp.source) // Logs `\\w+`, the source text of the `RegExp`\n```" + ], + "signature": "let source: t => string" + }, + { + "id": "Stdlib.RegExp.sticky", + "kind": "value", + "name": "sticky", + "docstrings": [ + "`sticky(regexp)` returns whether the sticky (`y`) flag is set on this `RegExp`.\n\nSee [`RegExp.sticky`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/sticky) on MDN.\n\n## Examples\n```rescript\nlet regexp1 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"g\")\nConsole.log(regexp1->RegExp.unicode) // Logs `false`, since `y` is not set\n\nlet regexp2 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"my\")\nConsole.log(regexp2->RegExp.unicode) // Logs `true`, since `y` is set\n```" + ], + "signature": "let sticky: t => bool" + }, + { + "id": "Stdlib.RegExp.unicode", + "kind": "value", + "name": "unicode", + "docstrings": [ + "`unicode(regexp)` returns whether the unicode (`y`) flag is set on this `RegExp`.\n\nSee [`RegExp.unicode`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/unicode) on MDN.\n\n## Examples\n```rescript\nlet regexp1 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"g\")\nConsole.log(regexp1->RegExp.unicode) // Logs `false`, since `u` is not set\n\nlet regexp2 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"mu\")\nConsole.log(regexp2->RegExp.unicode) // Logs `true`, since `u` is set\n```" + ], + "signature": "let unicode: t => bool" + }, + { + "id": "Stdlib.RegExp.flags", + "kind": "value", + "name": "flags", + "docstrings": [ + "`flags(regexp)` returns a string consisting of all the flags set on this `RegExp`.\n\nSee [`RegExp.flags`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/flags) on MDN.\n\n## Examples\n```rescript\nlet regexp = RegExp.fromString(\"\\\\w+\", ~flags=\"gi\")\nConsole.log(regexp->RegExp.flags) // Logs \"gi\", all the flags set on the RegExp\n```" + ], + "signature": "let flags: t => string" + }, + { + "id": "Stdlib.RegExp.ignore", + "kind": "value", + "name": "ignore", "docstrings": [ - "`forEach(iterator, fn)` consumes all values in the iterator and runs the callback `fn` for each value.\n\nSee [iterator protocols](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) on MDN.\n\n## Examples\n```rescript\n@val external someIterator: Iterator.t = \"someIterator\"\n\nsomeIterator->Iterator.forEach(value =>\n switch value {\n | Some(value) if value > 10 => Console.log(\"More than 10!\")\n | _ => ()\n }\n)\n```" + "`ignore(regExp)` ignores the provided regExp and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." ], - "signature": "let forEach: (t<'a>, option<'a> => unit) => unit" + "signature": "let ignore: t => unit" } ] }, - "core/json": { - "id": "Core.JSON", - "name": "JSON", + "stdlib/promise": { + "id": "Stdlib.Promise", + "name": "Promise", "docstrings": [ - "Functions for interacting with JSON." + "Functions for interacting with JavaScript Promise.\nSee: [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)." ], "items": [ { - "id": "Core.JSON.t", + "id": "Stdlib.Promise.t", "kind": "type", "name": "t", - "docstrings": [ - "A type representing a JSON object." - ], - "signature": "type t = Js.Json.t =\n | Boolean(bool)\n | Null\n | String(string)\n | Number(float)\n | Object(Core__Dict.t)\n | Array(array)" - }, - { - "id": "Core.JSON.replacer", - "kind": "type", - "name": "replacer", "docstrings": [], - "signature": "type replacer =\n | Keys(array)\n | Replacer((string, t) => t)" + "signature": "type t<'a> = promise<'a>" }, { - "id": "Core.JSON.parseExn", + "id": "Stdlib.Promise.resolve", "kind": "value", - "name": "parseExn", + "name": "resolve", "docstrings": [ - "`parseExn(string, ~reviver=?)` \n\nParses a JSON string or throws a JavaScript exception (SyntaxError), if the string isn't valid.\nThe reviver describes how the value should be transformed. It is a function which receives a key and a value.\nIt returns a JSON type.\n\n## Examples\n```rescript\ntry {\n let _ = JSON.parseExn(`{\"foo\":\"bar\",\"hello\":\"world\"}`)\n // { foo: 'bar', hello: 'world' }\n\n let _ = JSON.parseExn(\"\")\n // error\n} catch {\n| Exn.Error(_) => Console.log(\"error\")\n}\n\nlet reviver = (_, value: JSON.t) =>\n switch value {\n | String(string) => string->String.toUpperCase->JSON.Encode.string\n | Number(number) => (number *. 2.0)->JSON.Encode.float\n | _ => value\n }\n\nlet jsonString = `{\"hello\":\"world\",\"someNumber\":21}`\n\ntry {\n JSON.parseExn(jsonString, ~reviver)->Console.log\n // { hello: 'WORLD', someNumber: 42 }\n\n JSON.parseExn(\"\", ~reviver)->Console.log\n // error\n} catch {\n| Exn.Error(_) => Console.log(\"error\")\n}\n```\n\n## Exceptions \n\n- Raises a SyntaxError (Exn.t) if the string isn't valid JSON." + "`resolve(value)` creates a resolved Promise with a given `value`.\nSee [`Promise.resolve`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/resolve) on MDN.\n\n## Examples\n\n```rescript\nlet p = Promise.resolve(5) // promise\n```" ], - "signature": "let parseExn: (string, ~reviver: (string, t) => t=?) => t" + "signature": "let resolve: 'a => t<'a>" }, { - "id": "Core.JSON.parseExnWithReviver", + "id": "Stdlib.Promise.reject", "kind": "value", - "name": "parseExnWithReviver", + "name": "reject", "docstrings": [ - "`parseExnWithReviver(string, reviver)` \n\nParses a JSON string or throws a JavaScript exception (SyntaxError), if the string isn't valid.\nThe reviver describes how the value should be transformed. It is a function which receives a key and a value.\nIt returns a JSON type.\n\n## Examples\n```rescript\nlet reviver = (_, value: JSON.t) =>\n switch value {\n | String(string) => string->String.toUpperCase->JSON.Encode.string\n | Number(number) => (number *. 2.0)->JSON.Encode.float\n | _ => value\n }\n\nlet jsonString = `{\"hello\":\"world\",\"someNumber\":21}`\n\ntry {\n JSON.parseExnWithReviver(jsonString, reviver)->Console.log\n // { hello: 'WORLD', someNumber: 42 }\n\n JSON.parseExnWithReviver(\"\", reviver)->Console.log\n // error\n} catch {\n| Exn.Error(_) => Console.log(\"error\")\n}\n```\n\n## Exceptions \n\n- Raises a SyntaxError if the string isn't valid JSON." + "`reject(exn)` reject a Promise.\nSee [`Promise.reject`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/reject) on MDN.\n\n## Examples\n\n```rescript\nexception TestError(string)\n\nTestError(\"some rejected value\")\n->Promise.reject\n->Promise.catch(v => {\n switch v {\n | TestError(msg) => assertEqual(msg, \"some rejected value\")\n | _ => assert(false)\n }\n Promise.resolve()\n})\n->ignore\n```" ], - "signature": "let parseExnWithReviver: (string, (string, t) => t) => t", - "deprecated": "Use `parseExn` with optional parameter instead" + "signature": "let reject: exn => t<'a>" }, { - "id": "Core.JSON.stringify", + "id": "Stdlib.Promise.make", "kind": "value", - "name": "stringify", + "name": "make", "docstrings": [ - "`stringify(json, ~replacer=?, ~space=?)` \n\nConverts a JSON object to a JSON string.\nThe replacer describes how the value should be transformed. It is a function which receives a key and a value,\nor an array of keys which should be included in the output.\nIf you want to stringify any type, use `JSON.stringifyAny` instead.\n\n## Examples\n```rescript\nlet json =\n Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n ])->JSON.Encode.object\n\nJSON.stringify(json)\n// {\"foo\":\"bar\",\"hello\":\"world\",\"someNumber\":42}\n\nJSON.stringify(json, ~space=2)\n// {\n// \"foo\": \"bar\",\n// \"hello\": \"world\",\n// \"someNumber\": 42\n// }\n\nJSON.stringify(json, ~replacer=Keys([\"foo\", \"someNumber\"]))\n// {\"foo\":\"bar\",\"someNumber\":42}\n\nlet replacer = JSON.Replacer((_, value) => {\n let decodedValue = value->JSON.Decode.string\n\n switch decodedValue {\n | Some(string) => string->String.toUpperCase->JSON.Encode.string\n | None => value\n }\n})\n\nJSON.stringify(json, ~replacer)\n// {\"foo\":\"BAR\",\"hello\":\"WORLD\",\"someNumber\":42}\n```" + "`make(callback)` creates a new Promise based on a `callback` that receives two\nuncurried functions `resolve` and `reject` for defining the Promise's result.\n\n## Examples\n\n```rescript\nopen Promise\n\nlet n = 4\nPromise.make((resolve, reject) => {\n if(n < 5) {\n resolve(. \"success\")\n }\n else {\n reject(. \"failed\")\n }\n})\n->then(str => {\n Console.log(str)->resolve\n})\n->catch(_ => {\n Console.log(\"Error occurred\")\n resolve()\n})\n->ignore\n```" ], - "signature": "let stringify: (t, ~replacer: replacer=?, ~space: int=?) => string" + "signature": "let make: (('a => unit, 'e => unit) => unit) => t<'a>" }, { - "id": "Core.JSON.stringifyWithIndent", - "kind": "value", - "name": "stringifyWithIndent", - "docstrings": [ - "`stringifyWithIndent(json, indentation)` \n\nConverts a JSON object to a JSON string. The output will be indented.\nIf you want to stringify any type, use `JSON.stringifyAnyWithIndent` instead.\n\n## Examples\n```rescript\nlet json =\n Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n ])->JSON.Encode.object\n\nJSON.stringifyWithIndent(json, 2)\n// {\n// \"foo\": \"bar\",\n// \"hello\": \"world\",\n// \"someNumber\": 42\n// }\n```" - ], - "signature": "let stringifyWithIndent: (t, int) => string", - "deprecated": "Use `stringify` with optional parameter instead" + "id": "Stdlib.Promise.promiseAndResolvers", + "kind": "type", + "name": "promiseAndResolvers", + "docstrings": [], + "signature": "type promiseAndResolvers<'a> = {\n promise: t<'a>,\n resolve: 'a => unit,\n reject: exn => unit,\n}" }, { - "id": "Core.JSON.stringifyWithReplacer", + "id": "Stdlib.Promise.withResolvers", "kind": "value", - "name": "stringifyWithReplacer", + "name": "withResolvers", "docstrings": [ - "`stringifyWithReplacer(json, replacer)` \n\nConverts a JSON object to a JSON string.\nThe replacer describes how the value should be transformed. It is a function which receives a key and a value.\nIf you want to stringify any type, use `JSON.stringifyAnyWithReplacer` instead.\n\n## Examples\n```rescript\nlet json =\n Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n ])->JSON.Encode.object\n\nlet replacer = (_, value) => {\n let decodedValue = value->JSON.Decode.string\n\n switch decodedValue {\n | Some(string) => string->String.toUpperCase->JSON.Encode.string\n | None => value\n }\n}\n\nJSON.stringifyWithReplacer(json, replacer)\n// {\"foo\":\"BAR\",\"hello\":\"WORLD\",\"someNumber\":42}\n```" + "`withResolvers()` returns a object containing a new promise with functions to resolve or reject it. See [`Promise.withResolvers`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/withResolvers) on MDN.\n\n## Examples\n\n```rescript\nopen Promise\n\nlet {promise, resolve, _} = Promise.withResolvers()\n\nsetTimeout(() => {\n resolve(. \"success\")\n}, 1000)->TimeoutId.ignore\n\npromise\n->thenResolve(str => {\n Console.log(str)\n})\n->ignore\n```" ], - "signature": "let stringifyWithReplacer: (t, (string, t) => t) => string", - "deprecated": "Use `stringify` with optional parameter instead" + "signature": "let withResolvers: unit => promiseAndResolvers<'a>" }, { - "id": "Core.JSON.stringifyWithReplacerAndIndent", + "id": "Stdlib.Promise.catch", "kind": "value", - "name": "stringifyWithReplacerAndIndent", + "name": "catch", "docstrings": [ - "`stringifyWithReplacerAndIndent(json, replacer, indentation)`\n\nConverts a JSON object to a JSON string. The output will be indented.\nThe replacer describes how the value should be transformed. It is a function which receives a key and a value.\nIf you want to stringify any type, use `JSON.stringifyAnyWithReplacerAndIndent` instead.\n\n## Examples\n```rescript\nlet json =\n Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n ])->JSON.Encode.object\n\nlet replacer = (_, value) => {\n let decodedValue = value->JSON.Decode.string\n\n switch decodedValue {\n | Some(string) => string->String.toUpperCase->JSON.Encode.string\n | None => value\n }\n}\n\nJSON.stringifyWithReplacerAndIndent(json, replacer, 2)\n// {\n// \"foo\": \"BAR\",\n// \"hello\": \"WORLD\",\n// \"someNumber\": 42\n// }\n```" + "`catch(promise, errorCallback)` registers an exception handler in a promise chain.\nThe `errorCallback` receives an `exn` value that can later be refined into a JS\nerror or ReScript error. The `errorCallback` needs to return a promise with the\nsame type as the consumed promise. See [`Promise.catch`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/catch) on MDN.\n\n## Examples\n\n```rescript\nopen Promise\n\nexception SomeError(string)\n\nreject(SomeError(\"this is an error\"))\n->then(_ => {\n Ok(\"This result will never be returned\")->resolve\n})\n->catch(e => {\n let msg = switch(e) {\n | SomeError(msg) => \"ReScript error occurred: \" ++ msg\n | JsExn(obj) =>\n switch JsExn.message(obj) {\n | Some(msg) => \"JS exception occurred: \" ++ msg\n | None => \"Some other JS value has been thrown\"\n }\n | _ => \"Unexpected error occurred\"\n }\n\n Error(msg)->resolve\n})\n->then(result => {\n switch result {\n | Ok(r) => Console.log2(\"Operation successful: \", r)\n | Error(msg) => Console.log2(\"Operation failed: \", msg)\n }->resolve\n})\n->ignore // Ignore needed for side-effects\n```\n\nIn case you want to return another promise in your `callback`, consider using\n`then` instead." ], - "signature": "let stringifyWithReplacerAndIndent: (t, (string, t) => t, int) => string", - "deprecated": "Use `stringify` with optional parameters instead" + "signature": "let catch: (t<'a>, exn => t<'a>) => t<'a>" }, { - "id": "Core.JSON.stringifyWithFilter", + "id": "Stdlib.Promise.then", "kind": "value", - "name": "stringifyWithFilter", + "name": "then", "docstrings": [ - "`stringifyWithFilter(json, filter)` \n\nConverts a JSON object to a JSON string.\nThe filter is an array of keys, which should be included in the output.\nIf you want to stringify any type, use `JSON.stringifyAnyWithFilter` instead.\n\n## Examples\n```rescript\nlet json =\n Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n ])->JSON.Encode.object\n\nJSON.stringifyWithFilter(json, [\"foo\", \"someNumber\"])\n// {\"foo\":\"bar\",\"someNumber\":42}\n```" + "`then(promise, callback)` returns a new promise based on the result of `promise`'s \nvalue. The `callback` needs to explicitly return a new promise via `resolve`.\nIt is **not allowed** to resolve a nested promise (like `resolve(resolve(1))`).\nSee [`Promise.then`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/then) on MDN.\n## Examples\n\n```rescript\nopen Promise\nresolve(5)\n->then(num => {\n resolve(num + 5)\n})\n->then(num => {\n Console.log2(\"Your lucky number is: \", num)\n resolve()\n})\n->ignore\n```" ], - "signature": "let stringifyWithFilter: (t, array) => string", - "deprecated": "Use `stringify` with optional parameter instead" + "signature": "let then: (t<'a>, 'a => t<'b>) => t<'b>" }, { - "id": "Core.JSON.stringifyWithFilterAndIndent", + "id": "Stdlib.Promise.thenResolve", "kind": "value", - "name": "stringifyWithFilterAndIndent", + "name": "thenResolve", "docstrings": [ - "`stringifyWithFilterAndIndent(json, filter, indentation)` \n\nConverts a JSON object to a JSON string. The output will be indented.\nThe filter is an array of keys, which should be included in the output.\nIf you want to stringify any type, use `JSON.stringifyAnyWithFilterAndIndent` instead.\n\n## Examples\n```rescript\nlet json =\n Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n ])->JSON.Encode.object\n\nJSON.stringifyWithFilterAndIndent(json, [\"foo\", \"someNumber\"], 2)\n// {\n// \"foo\": \"bar\",\n// \"someNumber\": 42\n// }\n```" + "`thenResolve(promise, callback)` converts an encapsulated value of a promise\ninto another promise wrapped value. It is **not allowed** to return a promise\nwithin the provided callback (e.g. `thenResolve(value => resolve(value))`).\n\n## Examples\n\n```rescript\nopen Promise\nresolve(\"Anna\")\n->thenResolve(str => {\n \"Hello \" ++ str\n})\n->thenResolve(str => {\n Console.log(str)\n})\n->ignore // Ignore needed for side-effects\n```\n\nIn case you want to return another promise in your `callback`, consider using\n`then` instead." ], - "signature": "let stringifyWithFilterAndIndent: (t, array, int) => string", - "deprecated": "Use `stringify` with optional parameters instead" + "signature": "let thenResolve: (t<'a>, 'a => 'b) => t<'b>" }, { - "id": "Core.JSON.stringifyAny", + "id": "Stdlib.Promise.finally", "kind": "value", - "name": "stringifyAny", + "name": "finally", "docstrings": [ - "`stringifyAny(any, ~replacer=?, ~space=?)` \n\nConverts any type to a JSON string.\nThe replacer describes how the value should be transformed. It is a function which receives a key and a value.\nStringifying a function or `undefined` will return `None`.\nIf the value contains circular references or `BigInt`s, the function will throw a JavaScript exception (TypeError).\nIf you want to stringify a JSON object, use `JSON.stringify` instead.\n\n## Examples\n```rescript\nlet dict = Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n])\n\nJSON.stringifyAny(dict)\n// {\"foo\":\"bar\",\"hello\":\"world\",\"someNumber\":42}\n\nJSON.stringifyAny(dict, ~space=2)\n// {\n// \"foo\": \"bar\",\n// \"hello\": \"world\",\n// \"someNumber\": 42\n// }\n\nJSON.stringifyAny(dict, ~replacer=Keys([\"foo\", \"someNumber\"]))\n// {\"foo\":\"bar\",\"someNumber\":42}\n\nlet replacer = JSON.Replacer((_, value) => {\n let decodedValue = value->JSON.Decode.string\n\n switch decodedValue {\n | Some(string) => string->String.toUpperCase->JSON.Encode.string\n | None => value\n }\n})\n\nJSON.stringifyAny(dict, ~replacer)\n// {\"foo\":\"BAR\",\"hello\":\"WORLD\",\"someNumber\":42}\n\nJSON.stringifyAny(() => \"hello world\")\n// None\n\nBigInt.fromInt(0)->JSON.stringifyAny\n// exception\n```\n\n## Exceptions \n\n- Raises a TypeError if the value contains circular references.\n- Raises a TypeError if the value contains `BigInt`s." + "`finally(promise, callback)` is used to execute a function that is called no\nmatter if a promise was resolved or rejected. It will return the same `promise`\nit originally received. See [`Promise.finally`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/finally) on MDN.\n\n## Examples\n\n```rescript\nopen Promise\nexception SomeError(string)\nlet isDone = ref(false)\n\nresolve(5)\n->then(_ => {\n reject(SomeError(\"test\"))\n})\n->then(v => {\n Console.log2(\"final result\", v)\n resolve()\n})\n->catch(_ => {\n Console.log(\"Error handled\")\n resolve()\n})\n->finally(() => {\n Console.log(\"finally\")\n isDone := true\n})\n->then(() => {\n Console.log2(\"isDone:\", isDone.contents)\n resolve()\n})\n->ignore\n```" ], - "signature": "let stringifyAny: ('a, ~replacer: replacer=?, ~space: int=?) => option" + "signature": "let finally: (t<'a>, unit => unit) => t<'a>" }, { - "id": "Core.JSON.stringifyAnyWithIndent", + "id": "Stdlib.Promise.race", "kind": "value", - "name": "stringifyAnyWithIndent", + "name": "race", "docstrings": [ - "`stringifyAnyWithIndent(any, indentation)` \n\nConverts any type to a JSON string. The output will be indented.\nStringifying a function or `undefined` will return `None`.\nIf the value contains circular references or `BigInt`s, the function will throw a JavaScript exception (TypeError).\nIf you want to stringify a JSON object, use `JSON.stringifyWithIndent` instead.\n\n## Examples\n```rescript\nlet dict = Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n])\n\nJSON.stringifyAnyWithIndent(dict, 2)\n// {\n// \"foo\": \"bar\",\n// \"hello\": \"world\",\n// \"someNumber\": 42\n// }\n\nJSON.stringifyAny(() => \"hello world\")\n// None\n\nBigInt.fromInt(0)->JSON.stringifyAny\n// exception\n```\n\n## Exceptions \n\n- Raises a TypeError if the value contains circular references.\n- Raises a TypeError if the value contains `BigInt`s." + "`race(arr)` runs all promises concurrently and returns promise settles with the eventual state of the first promise that settles. See [`Promise.race`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/race) on MDN.\n\n## Examples\n\n```rescript\nopen Promise\nlet racer = (ms, name) => {\n Promise.make((resolve, _) => {\n setTimeout(() => {\n resolve(name)\n }, ms)->TimeoutId.ignore\n })\n}\n\nlet promises = [racer(1000, \"Turtle\"), racer(500, \"Hare\"), racer(100, \"Eagle\")]\n\nrace(promises)->then(winner => {\n Console.log(\"The winner is \" ++ winner)\n resolve()\n})\n```" ], - "signature": "let stringifyAnyWithIndent: ('a, int) => option", - "deprecated": "Use `stringifyAny` with optional parameter instead" + "signature": "let race: array> => t<'a>" }, { - "id": "Core.JSON.stringifyAnyWithReplacer", + "id": "Stdlib.Promise.any", "kind": "value", - "name": "stringifyAnyWithReplacer", + "name": "any", "docstrings": [ - "`stringifyAnyWithReplacer(json, replacer)`\n\nConverts any type to a JSON string.\nThe replacer describes how the value should be transformed. It is a function which receives a key and a value.\nStringifying a function or `undefined` will return `None`.\nIf the value contains circular references or `BigInt`s, the function will throw a JavaScript exception (TypeError).\nIf you want to stringify a JSON object, use `JSON.stringifyWithReplacer` instead.\n\n## Examples\n```rescript\nlet dict = Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n])\n\nlet replacer = (_, value) => {\n let decodedValue = value->JSON.Decode.string\n\n switch decodedValue {\n | Some(string) => string->String.toUpperCase->JSON.Encode.string\n | None => value\n }\n}\n\nJSON.stringifyAnyWithReplacer(dict, replacer)\n// {\"foo\":\"BAR\",\"hello\":\"WORLD\",\"someNumber\":42}\n\nJSON.stringifyAny(() => \"hello world\")\n// None\n\nBigInt.fromInt(0)->JSON.stringifyAny\n// exception\n```\n\n## Exceptions \n\n- Raises a TypeError if the value contains circular references.\n- Raises a TypeError if the value contains `BigInt`s." + "`any(arr)` runs all promises concurrently and returns promise fulfills when any of the input's promises fulfills, with this first fulfillment value. See [`Promise.any`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/any) on MDN.\n\n## Examples\n\n```rescript\nopen Promise\nlet racer = (ms, name) => {\n Promise.make((resolve, _) => {\n setTimeout(() => {\n resolve(name)\n }, ms)->TimeoutId.ignore\n })\n}\n\nlet promises = [racer(1000, \"Turtle\"), racer(500, \"Hare\"), racer(100, \"Eagle\")]\n\nany(promises)->then(winner => {\n Console.log(\"The winner is \" ++ winner)\n resolve()\n})\n```" ], - "signature": "let stringifyAnyWithReplacer: ('a, (string, t) => t) => option", - "deprecated": "Use `stringifyAny` with optional parameter instead" + "signature": "let any: array> => t<'a>" }, { - "id": "Core.JSON.stringifyAnyWithReplacerAndIndent", + "id": "Stdlib.Promise.all", "kind": "value", - "name": "stringifyAnyWithReplacerAndIndent", + "name": "all", "docstrings": [ - "`stringifyAnyWithReplacerAndIndent(json, replacer, indentation)` \n\nConverts any type to a JSON string. The output will be indented.\nThe replacer describes how the value should be transformed. It is a function which receives a key and a value.\nStringifying a function or `undefined` will return `None`.\nIf the value contains circular references or `BigInt`s, the function will throw a JavaScript exception (TypeError).\nIf you want to stringify a JSON object, use `JSON.stringifyWithReplacerAndIndent` instead.\n\n## Examples\n```rescript\nlet dict = Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n])\n\nlet replacer = (_, value) => {\n let decodedValue = value->JSON.Decode.string\n\n switch decodedValue {\n | Some(string) => string->String.toUpperCase->JSON.Encode.string\n | None => value\n }\n}\n\nJSON.stringifyAnyWithReplacerAndIndent(dict, replacer, 2)\n// {\n// \"foo\": \"BAR\",\n// \"hello\": \"WORLD\",\n// \"someNumber\": 42\n// }\n\nJSON.stringifyAny(() => \"hello world\")\n// None\n\nBigInt.fromInt(0)->JSON.stringifyAny\n// exception\n```\n\n## Exceptions \n\n- Raises a TypeError if the value contains circular references.\n- Raises a TypeError if the value contains `BigInt`s." + "`all(promises)` runs all promises concurrently and returns a promise fulfills when all of the input's promises fulfill, with an array of the fulfillment values. See [`Promise.all`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/all) on MDN.\n\n```rescript\nopen Promise\nlet promises = [resolve(1), resolve(2), resolve(3)]\n\nall(promises)\n->then((results) => {\n results->Array.forEach(num => {\n Console.log2(\"Number: \", num)\n })\n\n resolve()\n})\n->ignore\n```" ], - "signature": "let stringifyAnyWithReplacerAndIndent: ('a, (string, t) => t, int) => option", - "deprecated": "Use `stringifyAny` with optional parameters instead" + "signature": "let all: array> => t>" }, { - "id": "Core.JSON.stringifyAnyWithFilter", + "id": "Stdlib.Promise.all2", "kind": "value", - "name": "stringifyAnyWithFilter", + "name": "all2", "docstrings": [ - "`stringifyAnyWithFilter(json, filter)` \n\nConverts any type to a JSON string.\nThe filter is an array of keys, which should be included in the output.\nStringifying a function or `undefined` will return `None`.\nIf the value contains circular references or `BigInt`s, the function will throw a JavaScript exception (TypeError).\nIf you want to stringify a JSON object, use `JSON.stringifyWithFilter` instead.\n\n## Examples\n```rescript\nlet dict = Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n])\n\nJSON.stringifyAnyWithFilter(dict, [\"foo\", \"someNumber\"])\n// {\"foo\": \"bar\",\"someNumber\": 42}\n\nJSON.stringifyAny(() => \"hello world\")\n// None\n\nBigInt.fromInt(0)->JSON.stringifyAny\n// exception\n```\n\n## Exceptions \n\n- Raises a TypeError if the value contains circular references.\n- Raises a TypeError if the value contains `BigInt`s." + "`all2((p1, p2))`. Like `all()`, but with a fixed size tuple of 2" ], - "signature": "let stringifyAnyWithFilter: ('a, array) => string", - "deprecated": "Use `stringifyAny` with optional parameter instead" + "signature": "let all2: ((t<'a>, t<'b>)) => t<('a, 'b)>" }, { - "id": "Core.JSON.stringifyAnyWithFilterAndIndent", + "id": "Stdlib.Promise.all3", "kind": "value", - "name": "stringifyAnyWithFilterAndIndent", + "name": "all3", "docstrings": [ - "`stringifyAnyWithFilterAndIndent(json, filter, indentation)` \n\nConverts any type to a JSON string. The output will be indented.\nThe filter is an array of keys, which should be included in the output.\nStringifying a function or `undefined` will return `None`.\nIf the value contains circular references or `BigInt`s, the function will throw a JavaScript exception (TypeError).\nIf you want to stringify a JSON object, use `JSON.stringifyWithFilterAndIndent` instead.\n\n## Examples\n```rescript\nlet dict = Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n])\n\nJSON.stringifyAnyWithFilterAndIndent(dict, [\"foo\", \"someNumber\"], 2)\n// {\n// \"foo\": \"bar\",\n// \"someNumber\": 42\n// }\n\nJSON.stringifyAny(() => \"hello world\")\n// None\n\nBigInt.fromInt(0)->JSON.stringifyAny\n// exception\n```\n\n## Exceptions \n\n- Raises a TypeError if the value contains circular references.\n- Raises a TypeError if the value contains `BigInt`s." + "`all3((p1, p2, p3))`. Like `all()`, but with a fixed size tuple of 3" ], - "signature": "let stringifyAnyWithFilterAndIndent: ('a, array, int) => string", - "deprecated": "Use `stringifyAny` with optional parameters instead" - } - ] - }, - "core/type": { - "id": "Core.Type", - "name": "Type", - "docstrings": [ - "Utilities for classifying the type of JavaScript values at runtime." - ], - "items": [ + "signature": "let all3: ((t<'a>, t<'b>, t<'c>)) => t<('a, 'b, 'c)>" + }, { - "id": "Core.Type.t", - "kind": "type", - "name": "t", + "id": "Stdlib.Promise.all4", + "kind": "value", + "name": "all4", "docstrings": [ - "The possible types of JavaScript values." + "`all4((p1, p2, p3, p4))`. Like `all()`, but with a fixed size tuple of 4" ], - "signature": "type t = [\n | #bigint\n | #boolean\n | #function\n | #number\n | #object\n | #string\n | #symbol\n | #undefined\n]" + "signature": "let all4: ((t<'a>, t<'b>, t<'c>, t<'d>)) => t<('a, 'b, 'c, 'd)>" }, { - "id": "Core.Type.typeof", + "id": "Stdlib.Promise.all5", "kind": "value", - "name": "typeof", + "name": "all5", "docstrings": [ - "`typeof(someValue)`\n\nReturns the underlying JavaScript type of any runtime value.\n\nSee [`typeof`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof) on MDN.\n\n## Examples\n```rescript\nConsole.log(Type.typeof(\"Hello\")) // Logs \"string\" to the console.\n\nlet someVariable = true\n\nswitch someVariable->Type.typeof {\n| #boolean => Console.log(\"This is a bool, yay!\")\n| _ => Console.log(\"Oh, not a bool sadly...\")\n}\n```" + "`all5((p1, p2, p3, p4, p5))`. Like `all()`, but with a fixed size tuple of 5" ], - "signature": "let typeof: 'a => t" - } - ] - }, - "core/symbol": { - "id": "Core.Symbol", - "name": "Symbol", - "docstrings": [], - "items": [ - { - "id": "Core.Symbol.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = Js.Types.symbol" + "signature": "let all5: (\n (t<'a>, t<'b>, t<'c>, t<'d>, t<'e>),\n) => t<('a, 'b, 'c, 'd, 'e)>" }, { - "id": "Core.Symbol.make", + "id": "Stdlib.Promise.all6", "kind": "value", - "name": "make", - "docstrings": [], - "signature": "let make: string => t" + "name": "all6", + "docstrings": [ + "`all6((p1, p2, p4, p5, p6))`. Like `all()`, but with a fixed size tuple of 6\n\")" + ], + "signature": "let all6: (\n (t<'a>, t<'b>, t<'c>, t<'d>, t<'e>, t<'f>),\n) => t<('a, 'b, 'c, 'd, 'e, 'f)>" }, { - "id": "Core.Symbol.getFor", - "kind": "value", - "name": "getFor", + "id": "Stdlib.Promise.settledResult", + "kind": "type", + "name": "settledResult", "docstrings": [], - "signature": "let getFor: string => t" + "signature": "type settledResult<'a> =\n | Fulfilled({value: 'a})\n | Rejected({reason: exn})" }, { - "id": "Core.Symbol.keyFor", + "id": "Stdlib.Promise.allSettled", "kind": "value", - "name": "keyFor", - "docstrings": [], - "signature": "let keyFor: t => option" + "name": "allSettled", + "docstrings": [ + "`allSettled(promises)` runs all promises concurrently and returns promise fulfills when all of the input's promises settle with an array of objects that describe the outcome of each promise. See [`Promise.allSettled`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/allSettled) on MDN.\n\n```rescript\nopen Promise\n\nexception TestError(string)\n\nlet promises = [resolve(1), resolve(2), reject(TestError(\"some rejected promise\"))]\n\nallSettled(promises)\n->then((results) => {\n results->Array.forEach((result) => {\n switch result {\n | Fulfilled({value: num}) => \n Console.log2(\"Number: \", num)\n | Rejected({reason}) =>\n Console.log(reason)\n }\n })\n\n resolve()\n})\n->ignore\n```" + ], + "signature": "let allSettled: array> => t>>" }, { - "id": "Core.Symbol.asyncIterator", + "id": "Stdlib.Promise.allSettled2", "kind": "value", - "name": "asyncIterator", - "docstrings": [], - "signature": "let asyncIterator: t" + "name": "allSettled2", + "docstrings": [ + "`allSettled2((p1, p2))`. Like `allSettled()`, but with a fixed size tuple of 2" + ], + "signature": "let allSettled2: (\n (t<'a>, t<'b>),\n) => t<(settledResult<'a>, settledResult<'b>)>" }, { - "id": "Core.Symbol.hasInstance", + "id": "Stdlib.Promise.allSettled3", "kind": "value", - "name": "hasInstance", - "docstrings": [], - "signature": "let hasInstance: t" + "name": "allSettled3", + "docstrings": [ + "`allSettled3((p1, p2, p3))`. Like `allSettled()`, but with a fixed size tuple of 3" + ], + "signature": "let allSettled3: (\n (t<'a>, t<'b>, t<'c>),\n) => t<\n (settledResult<'a>, settledResult<'b>, settledResult<'c>),\n>" }, { - "id": "Core.Symbol.isConcatSpreadable", + "id": "Stdlib.Promise.allSettled4", "kind": "value", - "name": "isConcatSpreadable", - "docstrings": [], - "signature": "let isConcatSpreadable: t" + "name": "allSettled4", + "docstrings": [ + "`allSettled4((p1, p2, p3, p4))`. Like `allSettled()`, but with a fixed size tuple of 4" + ], + "signature": "let allSettled4: (\n (t<'a>, t<'b>, t<'c>, t<'d>),\n) => t<\n (\n settledResult<'a>,\n settledResult<'b>,\n settledResult<'c>,\n settledResult<'d>,\n ),\n>" }, { - "id": "Core.Symbol.iterator", + "id": "Stdlib.Promise.allSettled5", "kind": "value", - "name": "iterator", - "docstrings": [], - "signature": "let iterator: t" + "name": "allSettled5", + "docstrings": [ + "`allSettled5((p1, p2, p3, p4, p5))`. Like `allSettled()`, but with a fixed size tuple of 5" + ], + "signature": "let allSettled5: (\n (t<'a>, t<'b>, t<'c>, t<'d>, t<'e>),\n) => t<\n (\n settledResult<'a>,\n settledResult<'b>,\n settledResult<'c>,\n settledResult<'d>,\n settledResult<'e>,\n ),\n>" }, { - "id": "Core.Symbol.match", + "id": "Stdlib.Promise.allSettled6", "kind": "value", - "name": "match", - "docstrings": [], - "signature": "let match: t" + "name": "allSettled6", + "docstrings": [ + "`allSettled6((p1, p2, p4, p5, p6))`. Like `allSettled()`, but with a fixed size tuple of 6\n\")" + ], + "signature": "let allSettled6: (\n (t<'a>, t<'b>, t<'c>, t<'d>, t<'e>, t<'f>),\n) => t<\n (\n settledResult<'a>,\n settledResult<'b>,\n settledResult<'c>,\n settledResult<'d>,\n settledResult<'e>,\n settledResult<'f>,\n ),\n>" }, { - "id": "Core.Symbol.matchAll", + "id": "Stdlib.Promise.done", "kind": "value", - "name": "matchAll", - "docstrings": [], - "signature": "let matchAll: t" + "name": "done", + "docstrings": [ + "`done(p)` is a safe way to ignore a promise. If a value is anything else than a\npromise, it will raise a type error." + ], + "signature": "let done: promise<'a> => unit", + "deprecated": "Please use `Promise.ignore` instead" }, { - "id": "Core.Symbol.replace", + "id": "Stdlib.Promise.ignore", "kind": "value", - "name": "replace", - "docstrings": [], - "signature": "let replace: t" - }, + "name": "ignore", + "docstrings": [ + "`ignore(promise)` ignores the provided promise and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." + ], + "signature": "let ignore: promise<'a> => unit" + } + ] + }, + "stdlib/pair": { + "id": "Stdlib.Pair", + "name": "Pair", + "docstrings": [ + "This module provides functions to work with pairs, which are 2-element tuples." + ], + "items": [ { - "id": "Core.Symbol.search", - "kind": "value", - "name": "search", + "id": "Stdlib.Pair.t", + "kind": "type", + "name": "t", "docstrings": [], - "signature": "let search: t" + "signature": "type t<'a, 'b> = ('a, 'b)" }, { - "id": "Core.Symbol.species", + "id": "Stdlib.Pair.first", "kind": "value", - "name": "species", - "docstrings": [], - "signature": "let species: t" + "name": "first", + "docstrings": [ + "`first(pair)` returns the first element of a pair.\n\n## Examples\n\n```rescript\nPair.first((1, 2))->assertEqual(1)\n```" + ], + "signature": "let first: (('a, 'b)) => 'a" }, { - "id": "Core.Symbol.split", + "id": "Stdlib.Pair.second", "kind": "value", - "name": "split", - "docstrings": [], - "signature": "let split: t" + "name": "second", + "docstrings": [ + "`second(pair)` returns the second element of a pair.\n\n## Examples\n\n```rescript\nPair.second((1, 2))->assertEqual(2)\n```" + ], + "signature": "let second: (('a, 'b)) => 'b" }, { - "id": "Core.Symbol.toPrimitive", + "id": "Stdlib.Pair.ignore", "kind": "value", - "name": "toPrimitive", - "docstrings": [], - "signature": "let toPrimitive: t" + "name": "ignore", + "docstrings": [ + "`ignore(pair)` ignores the provided pair and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." + ], + "signature": "let ignore: ('a, 'b) => unit" }, { - "id": "Core.Symbol.toStringTag", + "id": "Stdlib.Pair.equal", "kind": "value", - "name": "toStringTag", - "docstrings": [], - "signature": "let toStringTag: t" + "name": "equal", + "docstrings": [ + "`equal(pair1, pair2, f1, f2)` check equality of `pair2` and `pair2` using `f1` for\nequality on the first element and `f2` for equality on the second element.\n\n## Examples\n\n```rescript\nPair.equal((1, \"test\"), (1, \"test\"), Int.equal, String.equal)->assertEqual(true)\n\nPair.equal((1, \"test\"), (2, \"test\"), Int.equal, String.equal)->assertEqual(false)\n```" + ], + "signature": "let equal: (\n ('a, 'b),\n ('c, 'd),\n ('a, 'c) => bool,\n ('b, 'd) => bool,\n) => bool" }, { - "id": "Core.Symbol.unscopables", + "id": "Stdlib.Pair.compare", "kind": "value", - "name": "unscopables", - "docstrings": [], - "signature": "let unscopables: t" + "name": "compare", + "docstrings": [ + "`compare(pair1, pair2, f1, f2)` compares two pairs, using `f1` to compare the first element\nand `f2` to compare the second element. Ordering is based on the first element,\nif they are equal, the second element is compared.\n\n## Examples\n\n```rescript\nPair.compare((1, \"a\"), (1, \"a\"), Int.compare, String.compare)->assertEqual(Ordering.equal)\nPair.compare((1, \"a\"), (1, \"b\"), Int.compare, String.compare)->assertEqual(Ordering.less)\nPair.compare((2, \"a\"), (1, \"b\"), Int.compare, String.compare)->assertEqual(Ordering.greater)\n```" + ], + "signature": "let compare: (\n ('a, 'b),\n ('c, 'd),\n ('a, 'c) => float,\n ('b, 'd) => float,\n) => float" } ] }, - "core/string": { - "id": "Core.String", - "name": "String", - "docstrings": [ - "Functions for interacting with JavaScript strings.\nSee: [`String`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)." - ], + "stdlib/ordering": { + "id": "Stdlib.Ordering", + "name": "Ordering", + "docstrings": [], "items": [ { - "id": "Core.String.make", - "kind": "value", - "name": "make", - "docstrings": [ - "`make(value)` converts the given value to a `string`.\n\n## Examples\n\n```rescript\nString.make(3.5) == \"3.5\"\nString.make([1, 2, 3]) == \"1,2,3\"\n```" - ], - "signature": "let make: 'a => string" + "id": "Stdlib.Ordering.t", + "kind": "type", + "name": "t", + "docstrings": [], + "signature": "type t = float" }, { - "id": "Core.String.fromCharCode", + "id": "Stdlib.Ordering.less", "kind": "value", - "name": "fromCharCode", - "docstrings": [ - "`fromCharCode(n)` creates a `string` containing the character corresponding to\nthat number, `n` ranges from 0 to 65535. If out of range, the lower 16 bits of\nthe value are used. Thus, `fromCharCode(0x1F63A)` gives the same result as\n`fromCharCode(0xF63A)`.\nSee [`String.fromCharCode`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCharCode) on MDN.\n\n## Examples\n\n```rescript\nString.fromCharCode(65) == \"A\"\nString.fromCharCode(0x3c8) == `ψ`\nString.fromCharCode(0xd55c) == `한`\nString.fromCharCode(-64568) == `ψ`\n```" - ], - "signature": "let fromCharCode: int => string" + "name": "less", + "docstrings": [], + "signature": "let less: float" }, { - "id": "Core.String.fromCharCodeMany", + "id": "Stdlib.Ordering.equal", "kind": "value", - "name": "fromCharCodeMany", - "docstrings": [ - "`fromCharCodeMany([n1, n2, n3])` creates a `string` from the characters\ncorresponding to the given numbers, using the same rules as `fromCharCode`.\nSee [`String.fromCharCode`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCharCode) on MDN.\n\n## Examples\n\n```rescript\nString.fromCharCodeMany([189, 43, 190, 61]) == \"½+¾=\"\nString.fromCharCodeMany([65, 66, 67]) == \"ABC\"\n```" - ], - "signature": "let fromCharCodeMany: array => string" + "name": "equal", + "docstrings": [], + "signature": "let equal: float" }, { - "id": "Core.String.fromCodePoint", + "id": "Stdlib.Ordering.greater", "kind": "value", - "name": "fromCodePoint", - "docstrings": [ - "`fromCodePoint(n)` creates a `string` containing the character corresponding to\nthat numeric code point.\nSee [`String.fromCodePoint`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCodePoint) on MDN.\n\n## Examples\n\n```rescript\nString.fromCodePoint(65) == \"A\"\nString.fromCodePoint(0x3c8) == `ψ`\nString.fromCodePoint(0xd55c) == `한`\nString.fromCodePoint(0x1f63a) == `😺`\n```\n\n## Exceptions\n\n- `RangeError`: If the number is not a valid code point, like `fromCharCode(-5)`." - ], - "signature": "let fromCodePoint: int => string" + "name": "greater", + "docstrings": [], + "signature": "let greater: float" }, { - "id": "Core.String.fromCodePointMany", + "id": "Stdlib.Ordering.isLess", "kind": "value", - "name": "fromCodePointMany", - "docstrings": [ - "`fromCodePointMany([n1, n2, n3])` creates a `string` from the characters\ncorresponding to the given code point numbers, using the same rules as\n`fromCodePoint`.\nSee [`String.fromCodePoint`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCodePoint) on MDN.\n\n## Examples\n\n```rescript\nString.fromCodePointMany([0xd55c, 0xae00, 0x1f63a]) == `한글😺`\n```\n\n## Exceptions\n\n- `RangeError`: If one of the number is not a valid code point, like\n`fromCharCode([1, -5])`." - ], - "signature": "let fromCodePointMany: array => string" + "name": "isLess", + "docstrings": [], + "signature": "let isLess: float => bool" }, { - "id": "Core.String.equal", + "id": "Stdlib.Ordering.isEqual", "kind": "value", - "name": "equal", + "name": "isEqual", "docstrings": [], - "signature": "let equal: (string, string) => bool" + "signature": "let isEqual: float => bool" }, { - "id": "Core.String.compare", + "id": "Stdlib.Ordering.isGreater", "kind": "value", - "name": "compare", + "name": "isGreater", "docstrings": [], - "signature": "let compare: (string, string) => Core__Ordering.t" + "signature": "let isGreater: float => bool" }, { - "id": "Core.String.length", + "id": "Stdlib.Ordering.invert", "kind": "value", - "name": "length", - "docstrings": [ - "`length(str)` returns the length of the given `string`.\nSee [`String.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length) on MDN.\n\n## Examples\n\n```rescript\nString.length(\"abcd\") == 4\n```" - ], - "signature": "let length: string => int" + "name": "invert", + "docstrings": [], + "signature": "let invert: float => float" }, { - "id": "Core.String.get", + "id": "Stdlib.Ordering.fromInt", "kind": "value", - "name": "get", - "docstrings": [ - "`get(str, index)` returns an `option` at the given `index` number. If\n`index` is out of range, this function returns `None`.\n\n## Examples\n\n```rescript\nString.get(\"ReScript\", 0) == Some(\"R\")\nString.get(\"Hello\", 4) == Some(\"o\")\nString.get(`JS`, 4) == None\n```" - ], - "signature": "let get: (string, int) => option" + "name": "fromInt", + "docstrings": [], + "signature": "let fromInt: int => float" }, { - "id": "Core.String.getUnsafe", + "id": "Stdlib.Ordering.ignore", "kind": "value", - "name": "getUnsafe", + "name": "ignore", "docstrings": [ - "`getUnsafe(str, index)` returns an `string` at the given `index` number.\n\nThis is _unsafe_, meaning it will return `undefined` value if `index` does not exist in `string`.\n\nUse `String.getUnsafe` only when you are sure the `index` exists.\n## Examples\n\n```rescript\nString.getUnsafe(\"ReScript\", 0) == \"R\"\nString.getUnsafe(\"Hello\", 4) == \"o\"\n```" + "`ignore(ordering)` ignores the provided ordering and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." ], - "signature": "let getUnsafe: (string, int) => string" - }, + "signature": "let ignore: t => unit" + } + ] + }, + "stdlib/option": { + "id": "Stdlib.Option", + "name": "Option", + "docstrings": [ + "We represent the existence and nonexistence of a value by wrapping it with\nthe `option` type. In order to make it a bit more convenient to work with\noption-types, we provide utility-functions for it.\n\nThe `option` type is a part of the ReScript standard library which is defined\nlike this:\n\n```rescript\ntype option<'a> = None | Some('a)\n```\n\n```rescript\nlet someString: option = Some(\"hello\")\n```" + ], + "items": [ { - "id": "Core.String.charAt", - "kind": "value", - "name": "charAt", + "id": "Stdlib.Option.t", + "kind": "type", + "name": "t", "docstrings": [ - "`charAt(str, index)` gets the character at `index` within string `str`. If\n`index` is negative or greater than the length of `str`, it returns the empty\nstring. If the string contains characters outside the range \\u0000-\\uffff, it\nwill return the first 16-bit value at that position in the string.\nSee [`String.charAt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/charAt) on MDN.\n\n## Examples\n\n```rescript\nString.charAt(\"ReScript\", 0) == \"R\"\nString.charAt(\"Hello\", 12) == \"\"\nString.charAt(`JS`, 5) == \"\"\n```" + "Type representing an option of type 'a." ], - "signature": "let charAt: (string, int) => string" + "signature": "type t<'a> = option<'a> = None | Some('a)" }, { - "id": "Core.String.charCodeAt", + "id": "Stdlib.Option.filter", "kind": "value", - "name": "charCodeAt", + "name": "filter", "docstrings": [ - "`charCodeAt(str, index)` returns the character code at position `index` in\nstring `str` the result is in the range 0-65535, unlike `codePointAt`, so it\nwill not work correctly for characters with code points greater than or equal\nto 0x10000. The return type is `float` because this function returns NaN if\n`index` is less than zero or greater than the length of the string.\nSee [`String.charCodeAt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/charCodeAt) on MDN.\n\n## Examples\n\n```rescript\nString.charCodeAt(`😺`, 0) == 0xd83d->Int.toFloat\nString.codePointAt(`😺`, 0) == Some(0x1f63a)\n```" + "`filter(opt, f)` applies `f` to `opt`, if `f` returns `true`, then it returns `Some(value)`, otherwise returns `None`.\n\n## Examples\n\n```rescript\nOption.filter(Some(10), x => x > 5) // Some(10)\nOption.filter(Some(4), x => x > 5) // None\nOption.filter(None, x => x > 5) // None\n```" ], - "signature": "let charCodeAt: (string, int) => float" + "signature": "let filter: (option<'a>, 'a => bool) => option<'a>" }, { - "id": "Core.String.codePointAt", + "id": "Stdlib.Option.forEach", "kind": "value", - "name": "codePointAt", + "name": "forEach", "docstrings": [ - "`codePointAt(str, index)` returns the code point at position `index` within\nstring `str` as a `Some(value)`. The return value handles code points greater\nthan or equal to 0x10000. If there is no code point at the given position, the\nfunction returns `None`.\nSee [`String.codePointAt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/codePointAt) on MDN.\n\n## Examples\n\n```rescript\nString.codePointAt(`¿😺?`, 1) == Some(0x1f63a)\nString.codePointAt(\"abc\", 5) == None\n```" + "`forEach(opt, f)` call `f` on `opt`. if `opt` is `Some(value)`, then if calls\n`f`, otherwise returns `unit`.\n\n## Examples\n\n```rescript\nOption.forEach(Some(\"thing\"), x => Console.log(x)) // logs \"thing\"\nOption.forEach(None, x => Console.log(x)) // returns ()\n```" ], - "signature": "let codePointAt: (string, int) => option" + "signature": "let forEach: (option<'a>, 'a => unit) => unit" }, { - "id": "Core.String.concat", + "id": "Stdlib.Option.getExn", "kind": "value", - "name": "concat", + "name": "getExn", "docstrings": [ - "`concat(original, append)` returns a new `string` with `append` added after\n`original`.\nSee [`String.concat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/concat) on MDN.\n\n## Examples\n\n```rescript\nString.concat(\"cow\", \"bell\") == \"cowbell\"\nString.concat(\"Re\", \"Script\") == \"ReScript\"\n```" + "`getExn(opt, ~message=?)` returns `value` if `opt` is `Some(value)`, otherwise raises an exception with the message provided, or a generic message if no message was provided.\n\n```rescript\nOption.getExn(Some(3))->assertEqual(3)\n\nswitch Option.getExn(None) {\n| exception _ => assert(true)\n| _ => assert(false)\n}\n\nswitch Option.getExn(None, ~message=\"was None!\") {\n| exception _ => assert(true) // Raises an Error with the message \"was None!\"\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Raises an error if `opt` is `None`" ], - "signature": "let concat: (string, string) => string" + "signature": "let getExn: (option<'a>, ~message: string=?) => 'a" }, { - "id": "Core.String.concatMany", + "id": "Stdlib.Option.getUnsafe", "kind": "value", - "name": "concatMany", + "name": "getUnsafe", "docstrings": [ - "`concatMany(original, arr)` returns a new `string` consisting of each item of an\narray of strings added to the `original` string.\nSee [`String.concat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/concat) on MDN.\n\n## Examples\n\n```rescript\nString.concatMany(\"1st\", [\"2nd\", \"3rd\", \"4th\"]) == \"1st2nd3rd4th\"\n```" + "`getUnsafe(opt)` returns `value` if `opt` is `Some(value)`, otherwise `undefined`.\n\n## Examples\n\n```rescript\nOption.getUnsafe(Some(3)) == 3\nOption.getUnsafe(None: option) // Returns `undefined`, which is not a valid `int`\n```\n\n## Notes\n\n- This is an unsafe operation. It assumes `value` is not `None`, and may cause undefined behaviour if it is." ], - "signature": "let concatMany: (string, array) => string" + "signature": "let getUnsafe: option<'a> => 'a" }, { - "id": "Core.String.endsWith", + "id": "Stdlib.Option.mapOr", "kind": "value", - "name": "endsWith", + "name": "mapOr", "docstrings": [ - "`endsWith(str, substr)` returns `true` if the `str` ends with `substr`, `false`\notherwise.\nSee [`String.endsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith) on MDN.\n\n## Examples\n\n```rescript\nString.endsWith(\"BuckleScript\", \"Script\") == true\nString.endsWith(\"BuckleShoes\", \"Script\") == false\n```" + "`mapOr(opt, default, f)` returns `f(value)` if `opt` is `Some(value)`, otherwise `default`.\n\n## Examples\n\n```rescript\nlet someValue = Some(3)\nsomeValue->Option.mapOr(0, x => x + 5) // 8\n\nlet noneValue = None\nnoneValue->Option.mapOr(0, x => x + 5) // 0\n```" ], - "signature": "let endsWith: (string, string) => bool" + "signature": "let mapOr: (option<'a>, 'b, 'a => 'b) => 'b" }, { - "id": "Core.String.endsWithFrom", + "id": "Stdlib.Option.mapWithDefault", "kind": "value", - "name": "endsWithFrom", - "docstrings": [ - "`endsWithFrom(str, ending, len)` returns `true` if the first len characters of\n`str` end with `ending`, `false` otherwise. If `len` is greater than or equal\nto the length of `str`, then it works like `endsWith`.\nSee [`String.endsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith) on MDN.\n\n## Examples\n\n```rescript\nString.endsWithFrom(\"abcd\", \"cd\", 4) == true\nString.endsWithFrom(\"abcde\", \"cd\", 3) == false\nString.endsWithFrom(\"abcde\", \"cde\", 99) == true\nString.endsWithFrom(\"example.dat\", \"ple\", 7) == true\n```" - ], - "signature": "let endsWithFrom: (string, string, int) => bool" + "name": "mapWithDefault", + "docstrings": [], + "signature": "let mapWithDefault: (option<'a>, 'b, 'a => 'b) => 'b", + "deprecated": "Use mapOr instead" }, { - "id": "Core.String.includes", + "id": "Stdlib.Option.map", "kind": "value", - "name": "includes", + "name": "map", "docstrings": [ - "`includes(str, searchValue)` returns `true` if `searchValue` is found anywhere\nwithin `str`, `false` otherwise.\nSee [`String.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes) on MDN.\n\n## Examples\n\n```rescript\nString.includes(\"programmer\", \"gram\") == true\nString.includes(\"programmer\", \"er\") == true\nString.includes(\"programmer\", \"pro\") == true\nString.includes(\"programmer.dat\", \"xyz\") == false\n```" + "`map(opt, f)` returns `Some(f(value))` if `opt` is `Some(value)`, otherwise `None`.\n\n## Examples\n\n```rescript\nOption.map(Some(3), x => x * x) // Some(9)\nOption.map(None, x => x * x) // None\n```" ], - "signature": "let includes: (string, string) => bool" + "signature": "let map: (option<'a>, 'a => 'b) => option<'b>" }, { - "id": "Core.String.includesFrom", + "id": "Stdlib.Option.flatMap", "kind": "value", - "name": "includesFrom", + "name": "flatMap", "docstrings": [ - "`includesFrom(str, searchValue, start)` returns `true` if `searchValue` is found\nanywhere within `str` starting at character number `start` (where 0 is the\nfirst character), `false` otherwise.\nSee [`String.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes) on MDN.\n\n## Examples\n\n```rescript\nString.includesFrom(\"programmer\", \"gram\", 1) == true\nString.includesFrom(\"programmer\", \"gram\", 4) == false\nString.includesFrom(`대한민국`, `한`, 1) == true\n```" + "`flatMap(opt, f)` returns `f(value)` if `opt` is `Some(value)`, otherwise `None`.\n\n## Examples\n\n```rescript\nlet addIfAboveOne = value =>\n if (value > 1) {\n Some(value + 1)\n } else {\n None\n }\n\nOption.flatMap(Some(2), addIfAboveOne) // Some(3)\nOption.flatMap(Some(-4), addIfAboveOne) // None\nOption.flatMap(None, addIfAboveOne) // None\n```" ], - "signature": "let includesFrom: (string, string, int) => bool" + "signature": "let flatMap: (option<'a>, 'a => option<'b>) => option<'b>" }, { - "id": "Core.String.indexOf", + "id": "Stdlib.Option.getOr", "kind": "value", - "name": "indexOf", + "name": "getOr", "docstrings": [ - "`indexOf(str, searchValue)` returns the position at which `searchValue` was\nfirst found within `str`, or `-1` if `searchValue` is not in `str`.\nSee [`String.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf) on MDN.\n\n## Examples\n\n```rescript\nString.indexOf(\"bookseller\", \"ok\") == 2\nString.indexOf(\"bookseller\", \"sell\") == 4\nString.indexOf(\"beekeeper\", \"ee\") == 1\nString.indexOf(\"bookseller\", \"xyz\") == -1\n```" + "`getOr(opt, default)` returns `value` if `opt` is `Some(value)`, otherwise `default`.\n\n## Examples\n\n```rescript\nOption.getOr(None, \"Banana\") // Banana\nOption.getOr(Some(\"Apple\"), \"Banana\") // Apple\n\nlet greet = (firstName: option) =>\n \"Greetings \" ++ firstName->Option.getOr(\"Anonymous\")\n\nSome(\"Jane\")->greet // \"Greetings Jane\"\nNone->greet // \"Greetings Anonymous\"\n```" ], - "signature": "let indexOf: (string, string) => int" + "signature": "let getOr: (option<'a>, 'a) => 'a" }, { - "id": "Core.String.indexOfOpt", + "id": "Stdlib.Option.getWithDefault", "kind": "value", - "name": "indexOfOpt", - "docstrings": [ - "`indexOfOpt(str, searchValue)`. Like `indexOf`, but return an `option`.\n\n## Examples\n\n```rescript\nString.indexOfOpt(\"bookseller\", \"ok\") == Some(2)\nString.indexOfOpt(\"bookseller\", \"xyz\") == None\n```" - ], - "signature": "let indexOfOpt: (string, string) => option" + "name": "getWithDefault", + "docstrings": [], + "signature": "let getWithDefault: (option<'a>, 'a) => 'a", + "deprecated": "Use getOr instead" }, { - "id": "Core.String.indexOfFrom", + "id": "Stdlib.Option.orElse", "kind": "value", - "name": "indexOfFrom", + "name": "orElse", "docstrings": [ - "`indexOfFrom(str, searchValue, start)` returns the position at which\n`searchValue` was found within `str` starting at character position `start`, or\n`-1` if `searchValue` is not found in that portion of `str`. The return value is\nrelative to the beginning of the string, no matter where the search started\nfrom.\nSee [`String.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf) on MDN.\n\n## Examples\n\n```rescript\nString.indexOfFrom(\"bookseller\", \"ok\", 1) == 2\nString.indexOfFrom(\"bookseller\", \"sell\", 2) == 4\nString.indexOfFrom(\"bookseller\", \"sell\", 5) == -1\n```" + "`orElse(opt1, opt2)` returns `opt2` if `opt1` is `None`, otherwise `opt1`.\n\n## Examples\n\n```rescript\nOption.orElse(Some(1812), Some(1066)) == Some(1812)\nOption.orElse(None, Some(1066)) == Some(1066)\nOption.orElse(None, None) == None\n```" ], - "signature": "let indexOfFrom: (string, string, int) => int" + "signature": "let orElse: (option<'a>, option<'a>) => option<'a>" }, { - "id": "Core.String.lastIndexOf", + "id": "Stdlib.Option.isSome", "kind": "value", - "name": "lastIndexOf", + "name": "isSome", "docstrings": [ - "`lastIndexOf(str, searchValue)` returns the position of the last occurrence of\n`searchValue` within `str`, searching backwards from the end of the string.\nReturns `-1` if `searchValue` is not in `str`. The return value is always\nrelative to the beginning of the string.\nSee [`String.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/lastIndexOf) on MDN.\n\n## Examples\n\n```rescript\nString.lastIndexOf(\"bookseller\", \"ok\") == 2\nString.lastIndexOf(\"beekeeper\", \"ee\") == 4\nString.lastIndexOf(\"abcdefg\", \"xyz\") == -1\n```" + "`isSome(opt)` returns `true` if `opt` is `Some(value)`, otherwise returns `false`.\n\n## Examples\n\n```rescript\nOption.isSome(None) // false\nOption.isSome(Some(1)) // true\n```" ], - "signature": "let lastIndexOf: (string, string) => int" + "signature": "let isSome: option<'a> => bool" }, { - "id": "Core.String.lastIndexOfOpt", + "id": "Stdlib.Option.isNone", "kind": "value", - "name": "lastIndexOfOpt", + "name": "isNone", "docstrings": [ - "`lastIndexOfOpt(str, searchValue)`. Like `lastIndexOfOpt`, but return an\n`option`.\n\n## Examples\n\n```rescript\nString.lastIndexOfOpt(\"bookseller\", \"ok\") == Some(2)\nString.lastIndexOfOpt(\"beekeeper\", \"ee\") == Some(4)\nString.lastIndexOfOpt(\"abcdefg\", \"xyz\") == None\n```" + "`isNone(opt)` returns `true` if `opt` is `None`, false otherwise.\n\n## Examples\n\n```rescript\nOption.isNone(None) // true\nOption.isNone(Some(1)) // false\n```" ], - "signature": "let lastIndexOfOpt: (string, string) => option" + "signature": "let isNone: option<'a> => bool" }, { - "id": "Core.String.lastIndexOfFrom", + "id": "Stdlib.Option.equal", "kind": "value", - "name": "lastIndexOfFrom", + "name": "equal", "docstrings": [ - "`lastIndexOfFrom(str, searchValue, start)` returns the position of the last\noccurrence of `searchValue` within `str`, searching backwards from the given\nstart position. Returns `-1` if `searchValue` is not in `str`. The return value\nis always relative to the beginning of the string.\nSee [`String.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/lastIndexOf) on MDN.\n\n## Examples\n\n```rescript\nString.lastIndexOfFrom(\"bookseller\", \"ok\", 6) == 2\nString.lastIndexOfFrom(\"beekeeper\", \"ee\", 8) == 4\nString.lastIndexOfFrom(\"beekeeper\", \"ee\", 3) == 1\nString.lastIndexOfFrom(\"abcdefg\", \"xyz\", 4) == -1\n```" + "`equal(opt1, opt2, f)` evaluates two optional values for equality with respect to a predicate function `f`. If both `opt1` and `opt2` are `None`, returns `true`.\nIf one of the arguments is `Some(value)` and the other is `None`, returns\n`false`.\nIf arguments are `Some(value1)` and `Some(value2)`, returns the result of\n`f(value1, value2)`, the predicate function `f` must return a bool.\n\n## Examples\n\n```rescript\nlet clockEqual = (a, b) => mod(a, 12) == mod(b, 12)\n\nopen Option\n\nequal(Some(3), Some(15), clockEqual) // true\nequal(Some(3), None, clockEqual) // false\nequal(None, Some(3), clockEqual) // false\nequal(None, None, clockEqual) // true\n```" ], - "signature": "let lastIndexOfFrom: (string, string, int) => int" + "signature": "let equal: (option<'a>, option<'b>, ('a, 'b) => bool) => bool" }, { - "id": "Core.String.match", + "id": "Stdlib.Option.compare", "kind": "value", - "name": "match", + "name": "compare", "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\nthere 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.\nSee [`String.match`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/match) on MDN.\n\n## Examples\n\n```rescript\nString.match(\"The better bats\", %re(\"/b[aeiou]t/\")) == Some([Some(\"bet\")])\nString.match(\"The better bats\", %re(\"/b[aeiou]t/g\")) == Some([Some(\"bet\"), Some(\"bat\")])\nString.match(\"Today is 2018-04-05.\", %re(\"/(\\d+)-(\\d+)-(\\d+)/\")) ==\n Some([Some(\"2018-04-05\"), Some(\"2018\"), Some(\"04\"), Some(\"05\")])\nString.match(\"The optional example\", %re(\"/(foo)?(example)/\")) == Some([Some(\"example\"), None, Some(\"example\")])\nString.match(\"The large container.\", %re(\"/b[aeiou]g/\")) == None\n```" + "`compare(opt1, opt2, f)` compares two optional values with respect to given `f`.\n\nIf both `opt1` and `opt2` are `None`, it returns `0.`. If the first argument is `Some(value1)` and the second is `None`, returns `1.` (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`f(value1, value2)`, `f` takes two arguments and returns `-1.` if the first\nargument is less than the second, `0.` if the arguments are equal, and `1.` if\nthe first argument is greater than the second.\n\n## Examples\n\n```rescript\nlet clockCompare = (a, b) => Int.compare(mod(a, 12), mod(b, 12))\n\nOption.compare(Some(3), Some(15), clockCompare) // 0.\nOption.compare(Some(3), Some(14), clockCompare) // 1.\nOption.compare(Some(2), Some(15), clockCompare) // (-1.)\nOption.compare(None, Some(15), clockCompare) // (-1.)\nOption.compare(Some(14), None, clockCompare) // 1.\nOption.compare(None, None, clockCompare) // 0.\n```" ], - "signature": "let match: (string, Core__RegExp.t) => option" + "signature": "let compare: (\n option<'a>,\n option<'b>,\n ('a, 'b) => Ordering.t,\n) => Ordering.t" }, { - "id": "Core.String.normalize", + "id": "Stdlib.Option.all", "kind": "value", - "name": "normalize", + "name": "all", "docstrings": [ - "`normalize(str)` returns the normalized Unicode string using Normalization Form\nCanonical (NFC) Composition. Consider the character ã, which can be represented\nas the single codepoint \\u00e3 or the combination of a lower case letter A\n\\u0061 and a combining tilde \\u0303. Normalization ensures that both can be\nstored in an equivalent binary representation.\nSee [`String.normalize`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize) on MDN.\nSee also [Unicode technical report #15](https://unicode.org/reports/tr15/) for details.\n\n## Examples\n\n```rescript\nlet string1 = \"\\uFB00\"\nlet string2 = \"\\u0066\\u0066\"\nConsole.log(string1 === string2) // false\n\nlet normalizeString1 = String.normalize(string1)\nlet normalizeString2 = String.normalize(string2)\nassert(normalizeString1 === normalizeString2)\n```" + "`all(options)` returns an option of array if all options are Some, otherwise returns None.\n\n## Examples\n\n```rescript\nOption.all([Some(1), Some(2), Some(3)]) // Some([1, 2, 3])\nOption.all([Some(1), None]) // None\n```" ], - "signature": "let normalize: string => string" + "signature": "let all: array> => option>" }, { - "id": "Core.String.normalizeForm", - "kind": "type", - "name": "normalizeForm", + "id": "Stdlib.Option.all2", + "kind": "value", + "name": "all2", "docstrings": [ - "`normalizeByForm(str, form)` returns the normalized Unicode string using the\nspecified form of normalization, which may be one of:\n- \"NFC\" — Normalization Form Canonical Composition.\n- \"NFD\" — Normalization Form Canonical Decomposition.\n- \"NFKC\" — Normalization Form Compatibility Composition.\n- \"NFKD\" — Normalization Form Compatibility Decomposition.\nSee [`String.normalize`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize) on MDN.\nSee also [Unicode technical report #15](https://unicode.org/reports/tr15/) for\ndetails.\n\n## Examples\n\n```rescript\nlet string1 = \"\\uFB00\"\nlet string2 = \"\\u0066\\u0066\"\nConsole.log(string1 == string2) // false\n\nlet normalizeString1 = String.normalizeByForm(string1, #NFKD)\nlet normalizeString2 = String.normalizeByForm(string2, #NFKD)\nConsole.log(normalizeString1 == normalizeString2) // true\n```" + "`all2((o1, o2))`. Like `all()`, but with a fixed size tuple of 2" ], - "signature": "type normalizeForm = [#NFC | #NFD | #NFKC | #NFKD]" + "signature": "let all2: ((option<'a>, option<'b>)) => option<('a, 'b)>" }, { - "id": "Core.String.normalizeByForm", + "id": "Stdlib.Option.all3", "kind": "value", - "name": "normalizeByForm", - "docstrings": [], - "signature": "let normalizeByForm: (string, normalizeForm) => string" + "name": "all3", + "docstrings": [ + "`all3((o1, o2, o3))`. Like `all()`, but with a fixed size tuple of 3" + ], + "signature": "let all3: (\n (option<'a>, option<'b>, option<'c>),\n) => option<('a, 'b, 'c)>" }, { - "id": "Core.String.repeat", + "id": "Stdlib.Option.all4", "kind": "value", - "name": "repeat", + "name": "all4", "docstrings": [ - "`repeat(str, n)` returns a `string` that consists of `n` repetitions of `str`.\nSee [`String.repeat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/repeat) on MDN.\n\n## Examples\n\n```rescript\nString.repeat(\"ha\", 3) == \"hahaha\"\nString.repeat(\"empty\", 0) == \"\"\n```\n\n## Exceptions\n\n- `RangeError`: if `n` is negative." + "`all4((o1, o2, o3, o4))`. Like `all()`, but with a fixed size tuple of 4" ], - "signature": "let repeat: (string, int) => string" + "signature": "let all4: (\n (option<'a>, option<'b>, option<'c>, option<'d>),\n) => option<('a, 'b, 'c, 'd)>" }, { - "id": "Core.String.replace", + "id": "Stdlib.Option.all5", "kind": "value", - "name": "replace", + "name": "all5", "docstrings": [ - "`replace(str, substr, newSubstr)` returns a new `string` which is\nidentical to `str` except with the first matching instance of `substr` replaced\nby `newSubstr`. `substr` is treated as a verbatim string to match, not a\nregular expression.\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) on MDN.\n\n## Examples\n\n```rescript\nString.replace(\"old string\", \"old\", \"new\") == \"new string\"\nString.replace(\"the cat and the dog\", \"the\", \"this\") == \"this cat and the dog\"\n```" + "`all5((o1, o2, o3, o4, o5))`. Like `all()`, but with a fixed size tuple of 5" ], - "signature": "let replace: (string, string, string) => string" + "signature": "let all5: (\n (\n option<'a>,\n option<'b>,\n option<'c>,\n option<'d>,\n option<'e>,\n ),\n) => option<('a, 'b, 'c, 'd, 'e)>" }, { - "id": "Core.String.replaceRegExp", + "id": "Stdlib.Option.all6", "kind": "value", - "name": "replaceRegExp", + "name": "all6", "docstrings": [ - "`replaceRegExp(str, regex, replacement)` returns a new `string` where\noccurrences matching regex have been replaced by `replacement`.\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) on MDN.\n\n## Examples\n\n```rescript\nString.replaceRegExp(\"vowels be gone\", %re(\"/[aeiou]/g\"), \"x\") == \"vxwxls bx gxnx\"\nString.replaceRegExp(\"Juan Fulano\", %re(\"/(\\w+) (\\w+)/\"), \"$2, $1\") == \"Fulano, Juan\"\n```" + "`all6((o1, o2, o3, o4, o5, o6))`. Like `all()`, but with a fixed size tuple of 6" ], - "signature": "let replaceRegExp: (string, Core__RegExp.t, string) => string" + "signature": "let all6: (\n (\n option<'a>,\n option<'b>,\n option<'c>,\n option<'d>,\n option<'e>,\n option<'f>,\n ),\n) => option<('a, 'b, 'c, 'd, 'e, 'f)>" }, { - "id": "Core.String.replaceAll", + "id": "Stdlib.Option.ignore", "kind": "value", - "name": "replaceAll", + "name": "ignore", "docstrings": [ - "`replaceAll(str, substr, newSubstr)` returns a new `string` which is\nidentical to `str` except with all matching instances of `substr` replaced\nby `newSubstr`. `substr` is treated as a verbatim string to match, not a\nregular expression.\nSee [`String.replaceAll`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replaceAll) on MDN.\n\n## Examples\n\n```rescript\nString.replaceAll(\"old old string\", \"old\", \"new\") == \"new new string\"\nString.replaceAll(\"the cat and the dog\", \"the\", \"this\") == \"this cat and this dog\"\n```" + "`ignore(option)` ignores the provided option and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." ], - "signature": "let replaceAll: (string, string, string) => string" - }, + "signature": "let ignore: option<'a> => unit" + } + ] + }, + "stdlib/object": { + "id": "Stdlib.Object", + "name": "Object", + "docstrings": [], + "items": [ { - "id": "Core.String.replaceAllRegExp", + "id": "Stdlib.Object.make", "kind": "value", - "name": "replaceAllRegExp", + "name": "make", "docstrings": [ - "`replaceAllRegExp(str, regex, replacement)` returns a new `string` where\nall occurrences matching regex have been replaced by `replacement`.\nThe pattern must include the global (`g`) flag or a runtime TypeError will be thrown.\nSee [`String.replaceAll`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replaceAll) on MDN.\n\n## Examples\n\n```rescript\nString.replaceAllRegExp(\"vowels be gone\", %re(\"/[aeiou]/g\"), \"x\") == \"vxwxls bx gxnx\"\nString.replaceAllRegExp(\"aabbcc\", %re(\"/b/g\"), \".\") == \"aa..cc\"\n```" + "`make` create a new object that inherits the properties and methods from the standard built-in Object, such as `toString`. See [Object on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)\n\n## Examples\n\n```rescript\nlet x = Object.make()\nx->Object.keysToArray->Array.length // 0\nx->Object.get(\"toString\")->Option.isSome // true\n```" ], - "signature": "let replaceAllRegExp: (string, Core__RegExp.t, string) => string" + "signature": "let make: unit => {..}" }, { - "id": "Core.String.unsafeReplaceRegExpBy0", + "id": "Stdlib.Object.is", "kind": "value", - "name": "unsafeReplaceRegExpBy0", + "name": "is", "docstrings": [ - "`unsafeReplaceRegExpBy0(str, regex, f)` returns a new `string` with some or all\nmatches of a pattern with no capturing parentheses replaced by the value\nreturned from the given function. The function receives as its parameters the\nmatched string, the offset at which the match begins, and the whole string being\nmatched.\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) on MDN.\n\n## Examples\n\n```rescript\nlet str = \"beautiful vowels\"\nlet re = %re(\"/[aeiou]/g\")\nlet matchFn = (~match, ~offset as _, ~input as _) => String.toUpperCase(match)\nString.unsafeReplaceRegExpBy0(str, re, matchFn) == \"bEAUtIfUl vOwEls\"\n```" + "`is` determines if two objects are identical in all contexts. Objects, arrays, records, and other non-primitives are only identical if they reference the **exact** same object in memory. Primitives like ints, floats, and strings are identical if they have the same value. `+0` and `-0` are distinct. NaN is equal to itself. See [Object.is on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is)\n\nIn most scenarios use `==` or `===` or the custom `equals` function (if provided) for the type.\n\n## Examples\n\n```rescript\nObject.is(25, 13) // false\nObject.is(\"abc\", \"abc\") // true\nObject.is(undefined, undefined) // true\nObject.is(undefined, null) // false\nObject.is(-0.0, 0.0) // false\nObject.is(list{1, 2}, list{1, 2}) // false\n\nObject.is([1, 2, 3], [1, 2, 3]) // false\n[1, 2, 3] == [1, 2, 3] // true\n[1, 2, 3] === [1, 2, 3] // false\n\nlet fruit = {\"name\": \"Apple\" }\nObject.is(fruit, fruit) // true\nObject.is(fruit, {\"name\": \"Apple\" }) // false\nfruit == {\"name\": \"Apple\" } // true\nfruit === {\"name\": \"Apple\" } // false\n```" ], - "signature": "let unsafeReplaceRegExpBy0: (\n string,\n Core__RegExp.t,\n (~match: string, ~offset: int, ~input: string) => string,\n) => string" + "signature": "let is: ('a, 'a) => bool" }, { - "id": "Core.String.unsafeReplaceRegExpBy1", + "id": "Stdlib.Object.create", "kind": "value", - "name": "unsafeReplaceRegExpBy1", + "name": "create", "docstrings": [ - "`unsafeReplaceRegExpBy1(str, regexp, f)`. Like `unsafeReplaceRegExpBy0`, but `f`\nhas `group1` parameter.\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) on MDN.\n\n## Examples\n\n```rescript\nlet str = \"Jony is 40\"\nlet re = %re(\"/(Jony is )\\d+/g\")\nlet matchFn = (~match as _, ~group1, ~offset as _, ~input as _) => {\n group1 ++ \"41\"\n}\nString.unsafeReplaceRegExpBy1(str, re, matchFn) == \"Jony is 41\"\n```" + "`create` creates a new object, using an existing object as the prototype of the new object. See [Object.create on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/create)\n\n**Note:** ReScript provides [first-class support for immutable objects](https://rescript-lang.org/docs/manual/latest/object) and [records](https://rescript-lang.org/docs/manual/latest/record). This is often safer and more convenient than using `create` and other functions in this module.\n\n## Examples\n\n```rescript\nlet x = {\"fruit\": \"banana\"}\nlet y = Object.create(x)\ny->Object.get(\"fruit\") // Some(\"banana\")\n```" ], - "signature": "let unsafeReplaceRegExpBy1: (\n string,\n Core__RegExp.t,\n (\n ~match: string,\n ~group1: string,\n ~offset: int,\n ~input: string,\n ) => string,\n) => string" + "signature": "let create: {..} => {..}" }, { - "id": "Core.String.unsafeReplaceRegExpBy2", + "id": "Stdlib.Object.createWithProperties", "kind": "value", - "name": "unsafeReplaceRegExpBy2", - "docstrings": [ - "`unsafeReplaceRegExpBy2(str, regexp, f)`. Like `unsafeReplaceRegExpBy1`, but `f`\nhas two group parameters.\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) on MDN.\n\n## Examples\n\n```rescript\nlet str = \"7 times 6\"\nlet re = %re(\"/(\\d+) times (\\d+)/\")\nlet matchFn = (~match as _, ~group1, ~group2, ~offset as _, ~input as _) => {\n switch (Int.fromString(group1), Int.fromString(group2)) {\n | (Some(x), Some(y)) => Int.toString(x * y)\n | _ => \"???\"\n }\n}\nString.unsafeReplaceRegExpBy2(str, re, matchFn) == \"42\"\n```" - ], - "signature": "let unsafeReplaceRegExpBy2: (\n string,\n Core__RegExp.t,\n (\n ~match: string,\n ~group1: string,\n ~group2: string,\n ~offset: int,\n ~input: string,\n ) => string,\n) => string" + "name": "createWithProperties", + "docstrings": [], + "signature": "let createWithProperties: ({..}, {..}) => {..}" }, { - "id": "Core.String.unsafeReplaceRegExpBy3", + "id": "Stdlib.Object.createWithNull", "kind": "value", - "name": "unsafeReplaceRegExpBy3", - "docstrings": [ - "`unsafeReplaceRegExpBy3(str, regexp, f)`. Like `unsafeReplaceRegExpBy1`, but `f`\nhas three group parameters.\nSee [`String.replace`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) on MDN." - ], - "signature": "let unsafeReplaceRegExpBy3: (\n string,\n Core__RegExp.t,\n (\n ~match: string,\n ~group1: string,\n ~group2: string,\n ~group3: string,\n ~offset: int,\n ~input: string,\n ) => string,\n) => string" + "name": "createWithNull", + "docstrings": [], + "signature": "let createWithNull: unit => {..}" }, { - "id": "Core.String.search", + "id": "Stdlib.Object.createWithNullAndProperties", "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.\nSee [`String.search`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/search) on MDN.\n\n## Examples\n\n```rescript\nString.search(\"testing 1 2 3\", %re(\"/\\d+/\")) == 8\nString.search(\"no numbers\", %re(\"/\\d+/\")) == -1\n```" - ], - "signature": "let search: (string, Core__RegExp.t) => int" + "name": "createWithNullAndProperties", + "docstrings": [], + "signature": "let createWithNullAndProperties: {..} => {..}" }, { - "id": "Core.String.searchOpt", + "id": "Stdlib.Object.assign", "kind": "value", - "name": "searchOpt", + "name": "assign", "docstrings": [ - "`searchOpt(str, regexp)`. Like `search`, but return an `option`.\n\n## Examples\n\n```rescript\nString.searchOpt(\"testing 1 2 3\", %re(\"/\\d+/\")) == Some(8)\nString.searchOpt(\"no numbers\", %re(\"/\\d+/\")) == None\n```" + "`assign(target, source)` copies enumerable own properties from the source to the target, overwriting properties with the same name. It returns the modified target object. A deep clone is not created; properties are copied by reference.\n\n**Warning:** ReScript provides compile-time support for type-safe access to JavaScript objects. This eliminates common errors such as accessing properties that do not exist, or using a property of type x as if it were a y. Using `assign` can bypass these safety checks and lead to run-time errors (if you are not careful). ReScript provides [first-class support for immutable objects](https://rescript-lang.org/docs/manual/latest/object) and [records](https://rescript-lang.org/docs/manual/latest/record). This is often safer and more convenient than using `assign` and other functions in this module.\n\nSee [Object.assign on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign) or [ECMAScript Language Specification](https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.assign).\n\n## Examples\n\n```rescript\nObject.assign({\"a\": 1}, {\"a\": 2}) // {\"a\": 2}\nObject.assign({\"a\": 1, \"b\": 2}, {\"a\": 0}) // {\"a\": 0, \"b\": 2}\nObject.assign({\"a\": 1}, {\"a\": null}) // {\"a\": null}\n```" ], - "signature": "let searchOpt: (string, Core__RegExp.t) => option" + "signature": "let assign: ({..}, {..}) => {..}" }, { - "id": "Core.String.slice", + "id": "Stdlib.Object.assignMany", "kind": "value", - "name": "slice", + "name": "assignMany", "docstrings": [ - "`slice(str, ~start, ~end)` returns the substring of `str` starting at\ncharacter `start` up to but not including `end`.\n- If either `start` or `end` is negative, then it is evaluated as\n`length(str - start)` or `length(str - end)`.\n- If `end` is greater than the length of `str`, then it is treated as\n`length(str)`.\n- If `start` is greater than `end`, slice returns the empty string.\nSee [`String.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) on MDN.\n\n## Examples\n\n```rescript\nString.slice(\"abcdefg\", ~start=2, ~end=5) == \"cde\"\nString.slice(\"abcdefg\", ~start=2, ~end=9) == \"cdefg\"\nString.slice(\"abcdefg\", ~start=-4, ~end=-2) == \"de\"\nString.slice(\"abcdefg\", ~start=5, ~end=1) == \"\"\n```" + "`assignMany(target, sources)` copies enumerable own properties from each source to the target, overwriting properties with the same name. Later sources' properties overwrite earlier ones. It returns the modified target object. A deep clone is not created; properties are copied by reference.\n\n**Note:** ReScript provides [first-class support for immutable objects](https://rescript-lang.org/docs/manual/latest/object), including spreading one object into another. This is often more convenient than using `assign` or `assignMany`. \n\nSee [Object.assign on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign) or [ECMAScript Language Specification](https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.assign)." ], - "signature": "let slice: (string, ~start: int, ~end: int) => string" + "signature": "let assignMany: ({..}, array<{..}>) => {..}" }, { - "id": "Core.String.sliceToEnd", + "id": "Stdlib.Object.copy", "kind": "value", - "name": "sliceToEnd", - "docstrings": [ - "`sliceToEnd(str, ~start)` returns the substring of `str` starting at character\n`start` to the end of the string.\n- If `start` is negative, then it is evaluated as `length(str - start)`.\n- If `start` is greater than the length of `str`, then sliceToEnd returns the empty string.\nSee [`String.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) on MDN.\n\n## Examples\n\n```rescript\nString.sliceToEnd(\"abcdefg\", ~start=4) == \"efg\"\nString.sliceToEnd(\"abcdefg\", ~start=-2) == \"fg\"\nString.sliceToEnd(\"abcdefg\", ~start=7) == \"\"\n```" - ], - "signature": "let sliceToEnd: (string, ~start: int) => string" + "name": "copy", + "docstrings": [], + "signature": "let copy: ({..} as 'a) => 'a" }, { - "id": "Core.String.split", + "id": "Stdlib.Object.get", "kind": "value", - "name": "split", + "name": "get", "docstrings": [ - "`split(str, delimiter)` splits the given `str` at every occurrence of\n`delimiter` and returns an array of the resulting substrings.\nSee [`String.split`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split) on MDN.\n\n## Examples\n\n```rescript\nString.split(\"2018-01-02\", \"-\") == [\"2018\", \"01\", \"02\"]\nString.split(\"a,b,,c\", \",\") == [\"a\", \"b\", \"\", \"c\"]\nString.split(\"good::bad as great::awful\", \"::\") == [\"good\", \"bad as great\", \"awful\"]\nString.split(\"has-no-delimiter\", \";\") == [\"has-no-delimiter\"]\n```" + "`get` gets the value of a property by name. Returns `None` if the property does not exist or has the value `undefined`. Otherwise returns `Some`, including if the value is `null`.\n\n## Examples\n\n```rescript\n{\"a\": 1}->Object.get(\"a\") // Some(1)\n{\"a\": 1}->Object.get(\"b\") // None\n{\"a\": undefined}->Object.get(\"a\") // None\n{\"a\": null}->Object.get(\"a\") // Some(null)\n{\"a\": 1}->Object.get(\"toString\")->Option.isSome // true\n```" ], - "signature": "let split: (string, string) => array" + "signature": "let get: ({..}, string) => option<'a>" }, { - "id": "Core.String.splitAtMost", + "id": "Stdlib.Object.getSymbol", "kind": "value", - "name": "splitAtMost", + "name": "getSymbol", "docstrings": [ - "`splitAtMost(str, delimiter, ~limit)` splits the given `str` at every\noccurrence of `delimiter` and returns an array of the first `limit` resulting\nsubstrings. If `limit` is negative or greater than the number of substrings,\nthe array will contain all the substrings.\n\n## Examples\n\n```rescript\nString.splitAtMost(\"ant/bee/cat/dog/elk\", \"/\", ~limit=3) == [\"ant\", \"bee\", \"cat\"]\nString.splitAtMost(\"ant/bee/cat/dog/elk\", \"/\", ~limit=0) == []\nString.splitAtMost(\"ant/bee/cat/dog/elk\", \"/\", ~limit=9) == [\"ant\", \"bee\", \"cat\", \"dog\", \"elk\"]\n```" + "`getSymbol` gets the value of a property by symbol. Returns `None` if the property does not exist or has the value `undefined`. Otherwise returns `Some`, including if the value is `null`.\n\n## Examples\n\n```rescript\nlet fruit = Symbol.make(\"fruit\")\nlet x = Object.make()\nx->Object.setSymbol(fruit, \"banana\")\nx->Object.getSymbol(fruit) // Some(\"banana\")\n```" ], - "signature": "let splitAtMost: (string, string, ~limit: int) => array" + "signature": "let getSymbol: ({..}, Symbol.t) => option<'a>" }, { - "id": "Core.String.splitByRegExp", + "id": "Stdlib.Object.getSymbolUnsafe", "kind": "value", - "name": "splitByRegExp", - "docstrings": [ - "`splitByRegExp(str, regexp)` splits the given `str` at every occurrence of\n`regexp` and returns an array of the resulting substrings.\nSee [`String.split`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split) on MDN.\n\n## Examples\n\n```rescript\nString.splitByRegExp(\"Jan,Feb,Mar\", %re(\"/,/\")) == [Some(\"Jan\"), Some(\"Feb\"), Some(\"Mar\")]\n```" - ], - "signature": "let splitByRegExp: (string, Core__RegExp.t) => array>" + "name": "getSymbolUnsafe", + "docstrings": [], + "signature": "let getSymbolUnsafe: ({..}, Symbol.t) => 'a" }, { - "id": "Core.String.splitByRegExpAtMost", + "id": "Stdlib.Object.set", "kind": "value", - "name": "splitByRegExpAtMost", + "name": "set", "docstrings": [ - "`splitByRegExpAtMost(str, regexp, ~limit)` splits the given `str` at every\noccurrence of `regexp` and returns an array of the first `limit` resulting\nsubstrings. If `limit` is negative or greater than the number of substrings, the\narray will contain all the substrings.\nSee [`String.split`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split) on MDN.\n\n## Examples\n\n```rescript\nString.splitByRegExpAtMost(\"Hello World. How are you doing?\", %re(\"/ /\"), ~limit=3) == [\n Some(\"Hello\"),\n Some(\"World.\"),\n Some(\"How\"),\n]\n```" + "`set(name, value)` assigns a value to the named object property, overwriting the previous value if any. See [Working with Objects on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Working_with_Objects#objects_and_properties)\n\n## Examples\n\n```rescript\n{\"a\": 1}->Object.set(\"a\", 2) // {\"a\": 2}\n{\"a\": 1}->Object.set(\"a\", None) // {\"a\": None}\n{\"a\": 1}->Object.set(\"b\", 2) // {\"a\": 1, \"b\": 2}\n```" ], - "signature": "let splitByRegExpAtMost: (\n string,\n Core__RegExp.t,\n ~limit: int,\n) => array>" + "signature": "let set: ({..}, string, 'a) => unit" }, { - "id": "Core.String.startsWith", + "id": "Stdlib.Object.setSymbol", "kind": "value", - "name": "startsWith", - "docstrings": [ - "`startsWith(str, substr)` returns `true` if the `str` starts with `substr`,\n`false` otherwise.\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith) on MDN.\n\n## Examples\n\n```rescript\nString.startsWith(\"BuckleScript\", \"Buckle\") == true\nString.startsWith(\"BuckleScript\", \"\") == true\nString.startsWith(\"JavaScript\", \"Buckle\") == false\n```" - ], - "signature": "let startsWith: (string, string) => bool" + "name": "setSymbol", + "docstrings": [], + "signature": "let setSymbol: ({..}, Symbol.t, 'a) => unit" }, { - "id": "Core.String.startsWithFrom", + "id": "Stdlib.Object.keysToArray", "kind": "value", - "name": "startsWithFrom", + "name": "keysToArray", "docstrings": [ - "`startsWithFrom(str, substr, n)` returns `true` if the `str` starts\nwith `substr` starting at position `n`, `false` otherwise. If `n` is negative,\nthe search starts at the beginning of `str`.\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith) on MDN.\n\n## Examples\n\n```rescript\nString.startsWithFrom(\"BuckleScript\", \"kle\", 3) == true\nString.startsWithFrom(\"BuckleScript\", \"\", 3) == true\nString.startsWithFrom(\"JavaScript\", \"Buckle\", 2) == false\n```" + "`keysToArray` returns an array of an object's own enumerable string-keyed property names. See [ECMAScript Language Specification](https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.keys) \nor [Object.keys on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys).\n\n## Examples\n\n```rescript\n{\"a\": 1, \"b\": 2}->Object.keysToArray // [\"a\", \"b\"]\n{\"a\": None}->Object.keysToArray // [\"a\"]\nObject.make()->Object.keysToArray // []\n```" ], - "signature": "let startsWithFrom: (string, string, int) => bool" + "signature": "let keysToArray: {..} => array" }, { - "id": "Core.String.substring", + "id": "Stdlib.Object.hasOwnProperty", "kind": "value", - "name": "substring", + "name": "hasOwnProperty", "docstrings": [ - "`substring(str, ~start, ~end)` returns characters `start` up to but not\nincluding end from `str`.\n- If `start` is less than zero, it is treated as zero.\n- If `end` is zero or negative, the empty string is returned.\n- If `start` is greater than `end`, the `start` and `end` points are swapped.\nSee [`String.substring`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substring) on MDN.\n\n## Examples\n\n```rescript\nString.substring(\"playground\", ~start=3, ~end=6) == \"ygr\"\nString.substring(\"playground\", ~start=6, ~end=3) == \"ygr\"\nString.substring(\"playground\", ~start=4, ~end=12) == \"ground\"\n```" + "`hasOwnProperty` determines whether the object has the specified property as its **own** property, as opposed to inheriting it. See [hasOwnProperty on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty)\n\n## Examples\n\n```rescript\nlet point = {\"x\": 1, \"y\": 2}\n{\"a\": 1}->Object.hasOwnProperty(\"a\") // true\n{\"a\": 1}->Object.hasOwnProperty(\"b\") // false\n{\"a\": 1}->Object.hasOwnProperty(\"toString\") // false\n```" ], - "signature": "let substring: (string, ~start: int, ~end: int) => string" + "signature": "let hasOwnProperty: ({..}, string) => bool" }, { - "id": "Core.String.substringToEnd", + "id": "Stdlib.Object.seal", "kind": "value", - "name": "substringToEnd", + "name": "seal", "docstrings": [ - "`substringToEnd(str, ~start)` returns the substring of `str` from position\n`start` to the end.\n- If `start` is less than or equal to zero, the entire string is returned.\n- If `start` is greater than or equal to the length of `str`, the empty string\nis returned.\nSee [`String.substring`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substring) on MDN.\n\n## Examples\n\n```rescript\nString.substringToEnd(\"playground\", ~start=4) == \"ground\"\nString.substringToEnd(\"playground\", ~start=-3) == \"playground\"\nString.substringToEnd(\"playground\", ~start=12) == \"\"\n```" + "`seal` seals an object. Sealing an object prevents extensions and makes existing properties non-configurable. A sealed object has a fixed set of properties. Unlike `freeze`, values of existing properties can still be changed as long as they are writable. \n\n**Note:** `seal` returns the same object that was passed in; it does not create a copy. Any attempt to delete or add properties to a sealed object will fail, either silently or by throwing an error. \n\nSee [ECMAScript Language Specification](https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.seal) and [Object.seal on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/seal)\n\n## Examples\n\n```rescript\nlet point = {\"x\": 1, \"y\": 2}\npoint->Object.set(\"x\", -7) // succeeds\npoint->Object.seal->ignore\n\ntry {\n point->Object.set(\"z\", 9) // fails\n} catch {\n| JsExn(_) => assert(true)\n| _ => assert(false)\n}\n\npoint->Object.set(\"x\", 13) // succeeds\n```" ], - "signature": "let substringToEnd: (string, ~start: int) => string" + "signature": "let seal: ({..} as 'a) => 'a" }, { - "id": "Core.String.toLowerCase", + "id": "Stdlib.Object.preventExtensions", "kind": "value", - "name": "toLowerCase", + "name": "preventExtensions", "docstrings": [ - "`toLowerCase(str)` converts `str` to lower case using the locale-insensitive\ncase mappings in the Unicode Character Database. Notice that the conversion can\ngive different results depending upon context, for example with the Greek\nletter sigma, which has two different lower case forms, one when it is the last\ncharacter in a string and another when it is not.\nSee [`String.toLowerCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLowerCase) on MDN.\n\n## Examples\n\n```rescript\nString.toLowerCase(\"ABC\") == \"abc\"\nString.toLowerCase(`ΣΠ`) == `σπ`\nString.toLowerCase(`ΠΣ`) == `πς`\n```" + "`preventExtensions` prevents new properties from being added to the object. It modifies the object (rather than creating a copy) and returns it.\n\nSee [ECMAScript Language Specification](https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.preventextensions) and [Object.preventExtensions on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/preventExtensions)\n\n## Examples\n\n```rescript\nlet obj = {\"a\": 1}\nobj->Object.set(\"b\", 2) // succeeds\nobj->Object.preventExtensions->ignore\ntry {\n obj->Object.set(\"c\", 3) // fails\n} catch {\n| JsExn(_) => assert(true)\n| _ => assert(false)\n}\n```" ], - "signature": "let toLowerCase: string => string" + "signature": "let preventExtensions: ({..} as 'a) => 'a" }, { - "id": "Core.String.toLocaleLowerCase", + "id": "Stdlib.Object.freeze", "kind": "value", - "name": "toLocaleLowerCase", + "name": "freeze", "docstrings": [ - "`toLocaleLowerCase(str)` converts `str` to lower case using the current locale.\nSee [`String.toLocaleLowerCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLocaleLowerCase) on MDN." + "`freeze` freezes an object. Freezing an object makes existing properties non-writable and prevents extensions. Once an object is frozen, new properties cannot be be added, existing properties cannot be removed, and their values cannot be changed.\n\n**Note:** `freeze` returns the same object that was passed in; it does not create a frozen copy. Any attempt to change a frozen object will fail, either silently or by throwing an exception.\n\nSee [ECMAScript Language Specification](https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.isfrozen) and [Object.isFrozen on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/isFrozen).\n\n## Examples\n\n```rescript\nlet obj = {\"a\": 1}\nobj->Object.set(\"a\", 2) // succeeds\nobj->Object.freeze->ignore\n\ntry {\n obj->Object.set(\"a\", 3) // fails\n} catch {\n| JsExn(_) => assert(true)\n| _ => assert(false)\n}\n```" ], - "signature": "let toLocaleLowerCase: string => string" + "signature": "let freeze: ({..} as 'a) => 'a" }, { - "id": "Core.String.toUpperCase", + "id": "Stdlib.Object.isSealed", "kind": "value", - "name": "toUpperCase", + "name": "isSealed", "docstrings": [ - "`toUpperCase(str)` converts `str` to upper case using the locale-insensitive\ncase mappings in the Unicode Character Database. Notice that the conversion can\nexpand the number of letters in the result, for example the German ß\ncapitalizes to two Ses in a row.\nSee [`String.toUpperCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toUpperCase) on MDN.\n\n## Examples\n\n```rescript\nString.toUpperCase(\"abc\") == \"ABC\"\nString.toUpperCase(`Straße`) == `STRASSE`\nString.toUpperCase(`πς`) == `ΠΣ`\n```" + "`isSealed` determines if an object is sealed. A sealed object has a fixed set of properties.\n\nSee [ECMAScript Language Specification](https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.issealed) and [Object.isSealed on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/isSealed)\n\n## Examples\n\n```rescript\nlet point = {\"x\": 1, \"y\": 3}->Object.seal\nlet pointIsSealed = point->Object.isSealed // true\nlet fruit = {\"name\": \"Apple\" }\nlet fruitIsSealed = fruit->Object.isSealed // false\n ```" ], - "signature": "let toUpperCase: string => string" + "signature": "let isSealed: 'a => bool" }, { - "id": "Core.String.toLocaleUpperCase", + "id": "Stdlib.Object.isFrozen", "kind": "value", - "name": "toLocaleUpperCase", + "name": "isFrozen", "docstrings": [ - "`toLocaleUpperCase(str)` converts `str` to upper case using the current locale.\nSee [`String.toLocaleUpperCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLocaleUpperCase) on MDN." + "`isFrozen` determines if an object is frozen. An object is frozen if an only if it is not extensible, all its properties are non-configurable, and all its data properties are non-writable.\n\nSee [ECMAScript Language Specification](https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.isfrozen) and [Object.isFrozen on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/isFrozen).\n\n## Examples\n\n```rescript\nlet point = {\"x\": 1, \"y\": 3}->Object.freeze\nlet pointIsFrozen = point->Object.isFrozen // true\nlet fruit = {\"name\": \"Apple\" }\nlet fruitIsFrozen = fruit->Object.isFrozen // false\n ```" ], - "signature": "let toLocaleUpperCase: string => string" + "signature": "let isFrozen: 'a => bool" }, { - "id": "Core.String.trim", + "id": "Stdlib.Object.isExtensible", "kind": "value", - "name": "trim", + "name": "isExtensible", "docstrings": [ - "`trim(str)` returns a string that is `str` with whitespace stripped from both\nends. Internal whitespace is not removed.\nSee [`String.trim`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/trim) on MDN.\n\n## Examples\n\n```rescript\nString.trim(\" abc def \") == \"abc def\"\nString.trim(\"\\n\\r\\t abc def \\n\\n\\t\\r \") == \"abc def\"\n```" + "`isExtensible` determines if an object is extensible (whether it can have new properties added to it).\n\nSee [ECMAScript Language Specification](https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.isextensible) and [Object.isExtensible on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/isExtensible)\n\n## Examples\n\n```rescript\nlet obj = {\"a\": 1}\nobj->Object.isExtensible // true\nobj->Object.preventExtensions->ignore\nobj->Object.isExtensible // false\n```" ], - "signature": "let trim: string => string" + "signature": "let isExtensible: 'a => bool" }, { - "id": "Core.String.trimStart", + "id": "Stdlib.Object.ignore", "kind": "value", - "name": "trimStart", + "name": "ignore", "docstrings": [ - "`trimStart(str)` returns a string that is `str` with whitespace stripped from\nthe beginning of a string. Internal whitespace is not removed.\nSee [`String.trimStart`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/trimStart) on MDN.\n\n## Examples\n\n```rescript\nString.trimStart(\" Hello world! \") == \"Hello world! \"\nString.trimStart(\" Hello world! \") == \"Hello world! \"\n```" + "`ignore(object)` ignores the provided object and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." ], - "signature": "let trimStart: string => string" - }, + "signature": "let ignore: {..} => unit" + } + ] + }, + "stdlib/nullable": { + "id": "Stdlib.Nullable", + "name": "Nullable", + "docstrings": [ + "Functions for handling nullable values.\n\nPrimarily useful when interoping with JavaScript when you don't know whether you'll get a value, `null` or `undefined`." + ], + "items": [ { - "id": "Core.String.trimEnd", - "kind": "value", - "name": "trimEnd", + "id": "Stdlib.Nullable.t", + "kind": "type", + "name": "t", "docstrings": [ - "`trinEnd(str)` returns a string that is `str` with whitespace stripped from the\nend of a string. Internal whitespace is not removed.\nSee [`String.trimEnd`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/trimEnd) on MDN.\n\n## Examples\n\n```rescript\nString.trimEnd(\" Hello world! \") == \" Hello world!\"\nString.trimEnd(\" Hello world! \") == \" Hello world!\"\n```" + "Type representing a nullable value.\nA nullable value can be the value `'a`, `null` or `undefined`." ], - "signature": "let trimEnd: string => string" + "signature": "@unboxed\ntype t<'a> = nullable<'a> =\n | Value('a)\n | @as(null) Null\n | @as(undefined) Undefined" }, { - "id": "Core.String.padStart", + "id": "Stdlib.Nullable.null", "kind": "value", - "name": "padStart", + "name": "null", "docstrings": [ - "`padStart(str, n, padStr)` returns a string that has been padded with `padStr`\n(multiple times, if needed) until the resulting string reaches the given `n`\nlength. The padding is applied from the start of the current string.\nSee [`String.padStart`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/padStart) on MDN.\n\n## Examples\n\n```rescript\nString.padStart(\"abc\", 5, \" \") == \" abc\"\nString.padStart(\"abc\", 6, \"123465\") == \"123abc\"\n```" + "The value `null`.\n\nSee [`null`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/null) on MDN.\n\n## Examples\n```rescript\nConsole.log(Nullable.null) // Logs `null` to the console.\n```" ], - "signature": "let padStart: (string, int, string) => string" + "signature": "let null: t<'a>" }, { - "id": "Core.String.padEnd", + "id": "Stdlib.Nullable.undefined", "kind": "value", - "name": "padEnd", + "name": "undefined", "docstrings": [ - "`padEnd(str, n, padStr)` returns a string that has been padded with `padStr`\n(multiple times, if needed) until the resulting string reaches the given `n`\nlength. The padding is applied from the end of the current string.\nSee [`String.padEnd`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/padEnd) on MDN.\n\n## Examples\n\n```rescript\nString.padEnd(\"Hello\", 10, \".\") == \"Hello.....\"\nString.padEnd(\"abc\", 1, \"\") == \"abc\"\n```" + "The value `undefined`.\n\nSee [`undefined`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/undefined) on MDN.\n\n## Examples\n```rescript\nConsole.log(undefined) // Logs `undefined` to the console.\n```" ], - "signature": "let padEnd: (string, int, string) => string" + "signature": "let undefined: t<'a>" }, { - "id": "Core.String.getSymbol", + "id": "Stdlib.Nullable.isNullable", "kind": "value", - "name": "getSymbol", - "docstrings": [], - "signature": "let getSymbol: (string, Core__Symbol.t) => option<'a>" + "name": "isNullable", + "docstrings": [ + "`isNullable(a)` returns `true` if `a` is null or undefined, `false` otherwise.\n\n## Examples\n\n```rescript\nlet myStr = \"Hello\"\nlet asNullable = myStr->Nullable.make\n\n// Can't do the below because we're now forced to check for nullability\n// myStr == asNullable\n\n// Check if asNullable is not null or undefined\nswitch asNullable->Nullable.isNullable {\n| true => assert(false)\n| false => assert(true)\n}\n```" + ], + "signature": "let isNullable: t<'a> => bool" }, { - "id": "Core.String.getSymbolUnsafe", + "id": "Stdlib.Nullable.make", "kind": "value", - "name": "getSymbolUnsafe", - "docstrings": [], - "signature": "let getSymbolUnsafe: (string, Core__Symbol.t) => 'a" + "name": "make", + "docstrings": [ + "Creates a new nullable value from the provided value.\nThis means the compiler will enforce null checks for the new value.\n\n## Examples\n```rescript\nlet myStr = \"Hello\"\nlet asNullable = myStr->Nullable.make\n\n// Can't do the below because we're now forced to check for nullability\n// myStr == asNullable\n\n// Need to do this\nswitch asNullable->Nullable.toOption {\n| Some(value) if value == myStr => Console.log(\"Yay, values matched!\")\n| _ => Console.log(\"Values did not match.\")\n}\n```" + ], + "signature": "let make: 'a => t<'a>" }, { - "id": "Core.String.setSymbol", + "id": "Stdlib.Nullable.equal", "kind": "value", - "name": "setSymbol", + "name": "equal", "docstrings": [], - "signature": "let setSymbol: (string, Core__Symbol.t, 'a) => unit" + "signature": "let equal: (t<'a>, t<'b>, ('a, 'b) => bool) => bool" }, { - "id": "Core.String.localeCompare", + "id": "Stdlib.Nullable.compare", "kind": "value", - "name": "localeCompare", - "docstrings": [ - "`localeCompare(referenceStr, compareStr)` returns a float than indicatings\nwhether a reference string comes before or after, or is the same as the given\nstring in sort order. If `referenceStr` occurs before `compareStr` positive if\nthe `referenceStr` occurs after `compareStr`, `0` if they are equivalent.\nDo not rely on exact return values of `-1` or `1`\nSee [`String.localeCompare`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/localeCompare) on MDN.\n\n## Examples\n\n```rescript\nString.localeCompare(\"a\", \"c\") < 0.0 == true\nString.localeCompare(\"a\", \"a\") == 0.0\n```" - ], - "signature": "let localeCompare: (string, string) => float" - } - ] - }, - "core/regexp": { - "id": "Core.RegExp", - "name": "RegExp", - "docstrings": [ - "Functions for handling RegExp's in ReScript.\n\nSee [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp) on MDN." - ], - "items": [ - { - "id": "Core.RegExp.t", - "kind": "type", - "name": "t", - "docstrings": [ - "Type representing an instantiated `RegExp`." - ], - "signature": "type t = Js.Re.t" + "name": "compare", + "docstrings": [], + "signature": "let compare: (\n t<'a>,\n t<'b>,\n ('a, 'b) => Ordering.t,\n) => Ordering.t" }, { - "id": "Core.RegExp.fromString", + "id": "Stdlib.Nullable.toOption", "kind": "value", - "name": "fromString", + "name": "toOption", "docstrings": [ - "`fromString(string)` creates a `RegExp.t` from the provided string. This can then be used to match on strings using `RegExp.exec`.\n\nSee [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/RegExp) on MDN.\n\n## Examples\n```rescript\n// Match the first word in a sentence\nlet regexp = RegExp.fromString(\"\\\\w+\")\n\nswitch regexp->RegExp.exec(\"ReScript is pretty cool, right?\") {\n| None => Console.log(\"Nope, no match...\")\n| Some(result) => Console.log(result->RegExp.Result.fullMatch) // Prints \"ReScript\"\n}\n```" + "Converts a nullable value into an option, so it can be pattern matched on.\nWill convert both `null` and `undefined` to `None`, and a present value to `Some(value)`.\n\n## Examples\n```rescript\nlet nullableString = Nullable.make(\"Hello\")\n\nswitch nullableString->Nullable.toOption {\n| Some(str) => Console.log2(\"Got string:\", str)\n| None => Console.log(\"Didn't have a value.\")\n}\n```" ], - "signature": "let fromString: string => t" + "signature": "let toOption: t<'a> => option<'a>" }, { - "id": "Core.RegExp.fromStringWithFlags", + "id": "Stdlib.Nullable.fromOption", "kind": "value", - "name": "fromStringWithFlags", + "name": "fromOption", "docstrings": [ - "`fromStringWithFlags(string)` creates a `RegExp.t` from the provided string, using the provided `flags`. This can then be used to match on strings using `RegExp.exec`.\n\nSee [`RegExp parameters`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/RegExp#parameters) on MDN.\n\n## Examples\n```rescript\n// Match the first word in a sentence\nlet regexp = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"g\")\n\nswitch regexp->RegExp.exec(\"ReScript is pretty cool, right?\") {\n| None => Console.log(\"Nope, no match...\")\n| Some(result) => Console.log(result->RegExp.Result.fullMatch) // Prints \"ReScript\"\n}\n```" + "Turns an `option` into a `Nullable.t`.\n\n## Examples\n```rescript\nlet optString = Some(\"Hello\")\nlet asNullable = optString->Nullable.fromOption // Nullable.t\n```" ], - "signature": "let fromStringWithFlags: (string, ~flags: string) => t" + "signature": "let fromOption: option<'a> => t<'a>" }, { - "id": "Core.RegExp.test", + "id": "Stdlib.Nullable.getOr", "kind": "value", - "name": "test", + "name": "getOr", "docstrings": [ - "`test(regexp, string)` tests whether the provided `regexp` matches on the provided string.\n\nSee [`RegExp.test`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/test) on MDN.\n\n## Examples\n```rescript\n// Match the first word in a sentence\nlet regexp = RegExp.fromString(\"\\\\w+\")\n\nif regexp->RegExp.test(\"ReScript is cool!\") {\n Console.log(\"Yay, there's a word in there.\")\n}\n```" + "`getOr(value, default)` returns `value` if not `null` or `undefined`,\notherwise return `default`.\n\n## Examples\n\n```rescript\nNullable.getOr(Nullable.null, \"Banana\") // Banana\nNullable.getOr(Nullable.make(\"Apple\"), \"Banana\") // Apple\n\nlet greet = (firstName: option) =>\n \"Greetings \" ++ firstName->Option.getOr(\"Anonymous\")\n\nNullable.make(\"Jane\")->Nullable.toOption->greet // \"Greetings Jane\"\nNullable.null->Nullable.toOption->greet // \"Greetings Anonymous\"\n```" ], - "signature": "let test: (t, string) => bool" + "signature": "let getOr: (t<'a>, 'a) => 'a" }, { - "id": "Core.RegExp.exec", + "id": "Stdlib.Nullable.getWithDefault", "kind": "value", - "name": "exec", - "docstrings": [ - "`exec(regexp, string)` executes the provided regexp on the provided string, optionally returning a `RegExp.Result.t` if the regexp matches on the string.\n\nSee [`RegExp.exec`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/exec) on MDN.\n\n## Examples\n```rescript\n// Match the first word in a sentence\nlet regexp = RegExp.fromString(\"\\\\w+\")\n\nswitch regexp->RegExp.exec(\"ReScript is pretty cool, right?\") {\n| None => Console.log(\"Nope, no match...\")\n| Some(result) => Console.log(result->RegExp.Result.fullMatch) // Prints \"ReScript\"\n}\n```" - ], - "signature": "let exec: (t, string) => option" + "name": "getWithDefault", + "docstrings": [], + "signature": "let getWithDefault: (t<'a>, 'a) => 'a", + "deprecated": "Use getOr instead" }, { - "id": "Core.RegExp.lastIndex", + "id": "Stdlib.Nullable.getExn", "kind": "value", - "name": "lastIndex", + "name": "getExn", "docstrings": [ - "`lastIndex(regexp)` returns the index the next match will start from.\n\nSee [`RegExp.lastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/lastIndex) on MDN.\n\n## Examples\n```rescript\n// Match the first word in a sentence\nlet regexp = RegExp.fromString(\"\\\\w+\")\nlet someStr = \"Many words here.\"\n\nConsole.log(regexp->RegExp.lastIndex) // Logs `0` to the console\n\nregexp->RegExp.exec(someStr)->ignore\n\nConsole.log(regexp->RegExp.lastIndex) // Logs `4` to the console\n```" + "`getExn(value)` raises an exception if `null` or `undefined`, otherwise returns the value.\n\n```rescript\nswitch Nullable.getExn(%raw(\"'Hello'\")) {\n| exception Invalid_argument(_) => assert(false)\n| value => assertEqual(value, \"Hello\")\n}\n\nswitch Nullable.getExn(%raw(\"null\")) {\n| exception Invalid_argument(_) => assert(true)\n| _ => assert(false)\n}\n\nswitch Nullable.getExn(%raw(\"undefined\")) {\n| exception Invalid_argument(_) => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Raises `Invalid_argument` if `value` is `null` or `undefined`" ], - "signature": "let lastIndex: t => int" + "signature": "let getExn: t<'a> => 'a" }, { - "id": "Core.RegExp.setLastIndex", + "id": "Stdlib.Nullable.getUnsafe", "kind": "value", - "name": "setLastIndex", + "name": "getUnsafe", "docstrings": [ - "`setLastIndex(regexp, index)` set the index the next match will start from.\n\nSee [`RegExp.lastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/lastIndex) on MDN.\n\n## Examples\n```rescript\n// Match the first word in a sentence\nlet regexp = RegExp.fromString(\"\\\\w+\")\nlet someStr = \"Many words here.\"\n\nregexp->RegExp.setLastIndex(4)\nregexp->RegExp.exec(someStr)->ignore\n\nConsole.log(regexp->RegExp.lastIndex) // Logs `10` to the console\n```" + "`getUnsafe(value)` returns `value`.\n\n## Examples\n\n```rescript\nNullable.getUnsafe(Nullable.make(3)) == 3\nNullable.getUnsafe(Nullable.null) // Raises an error\n```\n\n## Important\n\n- This is an unsafe operation, it assumes `value` is not `null` or `undefined`." ], - "signature": "let setLastIndex: (t, int) => unit" + "signature": "let getUnsafe: t<'a> => 'a" }, { - "id": "Core.RegExp.ignoreCase", + "id": "Stdlib.Nullable.forEach", "kind": "value", - "name": "ignoreCase", + "name": "forEach", "docstrings": [ - "`ignoreCase(regexp)` returns whether the ignore case (`i`) flag is set on this `RegExp`.\n\nSee [`RegExp.ignoreCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/ignoreCase) on MDN.\n\n## Examples\n```rescript\nlet regexp1 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"g\")\nConsole.log(regexp1->RegExp.ignoreCase) // Logs `false`, since `i` is not set\n\nlet regexp2 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"i\")\nConsole.log(regexp2->RegExp.ignoreCase) // Logs `true`, since `i` is set\n```" + "`forEach(value, f)` call `f` on `value`. if `value` is not `null` or `undefined`, \nthen if calls `f`, otherwise returns `unit`.\n\n## Examples\n\n```rescript\nNullable.forEach(Nullable.make(\"thing\"), x => Console.log(x)) // logs \"thing\"\nNullable.forEach(Nullable.null, x => Console.log(x)) // returns ()\nNullable.forEach(undefined, x => Console.log(x)) // returns ()\n```" ], - "signature": "let ignoreCase: t => bool" + "signature": "let forEach: (t<'a>, 'a => unit) => unit" }, { - "id": "Core.RegExp.global", + "id": "Stdlib.Nullable.map", "kind": "value", - "name": "global", + "name": "map", "docstrings": [ - "`global(regexp)` returns whether the global (`g`) flag is set on this `RegExp`.\n\nSee [`RegExp.global`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/global) on MDN.\n\n## Examples\n```rescript\nlet regexp1 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"g\")\nConsole.log(regexp1->RegExp.global) // Logs `true`, since `g` is set\n\nlet regexp2 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"i\")\nConsole.log(regexp2->RegExp.global) // Logs `false`, since `g` is not set\n```" + "`map(value, f)` returns `f(value)` if `value` is not `null` or `undefined`,\notherwise returns `value` unchanged.\n\n## Examples\n\n```rescript\nNullable.map(Nullable.make(3), x => x * x) // Nullable.make(9)\nNullable.map(undefined, x => x * x) // undefined\n```" ], - "signature": "let global: t => bool" + "signature": "let map: (t<'a>, 'a => 'b) => t<'b>" }, { - "id": "Core.RegExp.multiline", + "id": "Stdlib.Nullable.mapOr", "kind": "value", - "name": "multiline", + "name": "mapOr", "docstrings": [ - "`multiline(regexp)` returns whether the multiline (`m`) flag is set on this `RegExp`.\n\nSee [`RegExp.multiline`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/multiline) on MDN.\n\n## Examples\n```rescript\nlet regexp1 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"g\")\nConsole.log(regexp1->RegExp.multiline) // Logs `false`, since `m` is not set\n\nlet regexp2 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"mi\")\nConsole.log(regexp2->RegExp.multiline) // Logs `true`, since `m` is set\n```" + "`mapOr(value, default, f)` returns `f(value)` if `value` is not `null`\nor `undefined`, otherwise returns `default`.\n\n## Examples\n\n```rescript\nlet someValue = Nullable.make(3)\nsomeValue->Nullable.mapOr(0, x => x + 5) // 8\n\nlet noneValue = Nullable.null\nnoneValue->Nullable.mapOr(0, x => x + 5) // 0\n```" ], - "signature": "let multiline: t => bool" + "signature": "let mapOr: (t<'a>, 'b, 'a => 'b) => 'b" }, { - "id": "Core.RegExp.source", + "id": "Stdlib.Nullable.mapWithDefault", "kind": "value", - "name": "source", - "docstrings": [ - "`source(regexp)` returns the source text for this `RegExp`, without the two forward slashes (if present), and without any set flags.\n\nSee [`RegExp.source`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/source) on MDN.\n\n## Examples\n```rescript\nlet regexp = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"g\")\nConsole.log(regexp->RegExp.source) // Logs `\\w+`, the source text of the `RegExp`\n```" - ], - "signature": "let source: t => string" + "name": "mapWithDefault", + "docstrings": [], + "signature": "let mapWithDefault: (t<'a>, 'b, 'a => 'b) => 'b", + "deprecated": "Use mapOr instead" }, { - "id": "Core.RegExp.sticky", + "id": "Stdlib.Nullable.flatMap", "kind": "value", - "name": "sticky", + "name": "flatMap", "docstrings": [ - "`sticky(regexp)` returns whether the sticky (`y`) flag is set on this `RegExp`.\n\nSee [`RegExp.sticky`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/sticky) on MDN.\n\n## Examples\n```rescript\nlet regexp1 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"g\")\nConsole.log(regexp1->RegExp.unicode) // Logs `false`, since `y` is not set\n\nlet regexp2 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"my\")\nConsole.log(regexp2->RegExp.unicode) // Logs `true`, since `y` is set\n```" + "`flatMap(value, f)` returns `f(value)` if `value` is not `null` or `undefined`,\notherwise returns `value` unchanged.\n\n## Examples\n\n```rescript\nlet addIfAboveOne = value =>\n if (value > 1) {\n Nullable.make(value + 1)\n } else {\n Nullable.null\n }\n\nNullable.flatMap(Nullable.make(2), addIfAboveOne) // Nullable.make(3)\nNullable.flatMap(Nullable.make(-4), addIfAboveOne) // undefined\nNullable.flatMap(Nullable.null, addIfAboveOne) // undefined\n```" ], - "signature": "let sticky: t => bool" + "signature": "let flatMap: (t<'a>, 'a => t<'b>) => t<'b>" }, { - "id": "Core.RegExp.unicode", + "id": "Stdlib.Nullable.ignore", "kind": "value", - "name": "unicode", + "name": "ignore", "docstrings": [ - "`unicode(regexp)` returns whether the unicode (`y`) flag is set on this `RegExp`.\n\nSee [`RegExp.unicode`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/unicode) on MDN.\n\n## Examples\n```rescript\nlet regexp1 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"g\")\nConsole.log(regexp1->RegExp.unicode) // Logs `false`, since `u` is not set\n\nlet regexp2 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"mu\")\nConsole.log(regexp2->RegExp.unicode) // Logs `true`, since `u` is set\n```" + "`ignore(nullable)` ignores the provided nullable and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." ], - "signature": "let unicode: t => bool" + "signature": "let ignore: t<'a> => unit" } ] }, - "core/promise": { - "id": "Core.Promise", - "name": "Promise", + "stdlib/null": { + "id": "Stdlib.Null", + "name": "Null", "docstrings": [ - "Functions for interacting with JavaScript Promise.\nSee: [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)." + "Functions for handling values that could be `null`.\n\nIf you also need to cover `undefined`, check out `Nullable` instead." ], "items": [ { - "id": "Core.Promise.t", + "id": "Stdlib.Null.t", "kind": "type", "name": "t", - "docstrings": [], - "signature": "type t<'a> = promise<'a>" + "docstrings": [ + "A type representing a value that can be either `'a` or `null`." + ], + "signature": "@unboxed\ntype t<'a> = null<'a> =\n | Value('a)\n | @as(null) Null" }, { - "id": "Core.Promise.resolve", + "id": "Stdlib.Null.asNullable", "kind": "value", - "name": "resolve", + "name": "asNullable", "docstrings": [ - "`resolve(value)` creates a resolved Promise with a given `value`.\nSee [`Promise.resolve`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/resolve) on MDN.\n\n## Examples\n\n```rescript\nlet p = Promise.resolve(5) // promise\n```" + "Converts a `Null.t` into a `Nullable.t`.\n\n## Examples\n```rescript\nlet nullValue = Null.make(\"Hello\")\nlet asNullable = nullValue->Null.asNullable // Nullable.t\n```" ], - "signature": "let resolve: 'a => t<'a>" + "signature": "let asNullable: t<'a> => Nullable.t<'a>" }, { - "id": "Core.Promise.reject", + "id": "Stdlib.Null.null", "kind": "value", - "name": "reject", + "name": "null", "docstrings": [ - "`reject(exn)` reject a Promise.\nSee [`Promise.reject`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/reject) on MDN.\n\n## Examples\n\n```rescript\nexception TestError(string)\n\nlet p = Promise.reject(TestError(\"some rejected value\"))\n```" + "The value `null`.\n\nSee [`null`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/null) on MDN.\n\n## Examples\n```rescript\nConsole.log(null) // Logs `null` to the console.\n```" ], - "signature": "let reject: exn => t<'a>" + "signature": "let null: t<'a>" }, { - "id": "Core.Promise.make", + "id": "Stdlib.Null.make", "kind": "value", "name": "make", "docstrings": [ - "`make(callback)` creates a new Promise based on a `callback` that receives two\nuncurried functions `resolve` and `reject` for defining the Promise's result.\n\n## Examples\n\n```rescript\nopen Promise\n\nlet n = 4\nPromise.make((resolve, reject) => {\n if(n < 5) {\n resolve(. \"success\")\n }\n else {\n reject(. \"failed\")\n }\n})\n->then(str => {\n Console.log(str)->resolve\n})\n->catch(_ => {\n Console.log(\"Error occurred\")\n resolve()\n})\n->ignore\n```" + "Creates a new `Null.t` from the provided value.\nThis means the compiler will enforce null checks for the new value.\n\n## Examples\n```rescript\nlet myStr = \"Hello\"\nlet asNullValue = myStr->Null.make // The compiler now thinks this can be `string` or `null`.\n```" ], - "signature": "let make: (('a => unit, 'e => unit) => unit) => t<'a>" - }, - { - "id": "Core.Promise.promiseAndResolvers", - "kind": "type", - "name": "promiseAndResolvers", - "docstrings": [], - "signature": "type promiseAndResolvers<'a> = {\n promise: t<'a>,\n resolve: 'a => unit,\n reject: exn => unit,\n}" + "signature": "let make: 'a => t<'a>" }, { - "id": "Core.Promise.withResolvers", + "id": "Stdlib.Null.equal", "kind": "value", - "name": "withResolvers", - "docstrings": [ - "`withResolvers()` returns a object containing a new promise with functions to resolve or reject it. See [`Promise.withResolvers`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/withResolvers) on MDN.\n\n## Examples\n\n```rescript\nopen Promise\n\nlet {promise, resolve, _} = Promise.withResolvers()\n\nsetTimeout(() => {\n resolve(. \"success\")\n}, 1000)->ignore\n\npromise\n->thenResolve(str => {\n Console.log(str)\n})\n->ignore\n```" - ], - "signature": "let withResolvers: unit => promiseAndResolvers<'a>" + "name": "equal", + "docstrings": [], + "signature": "let equal: (t<'a>, t<'b>, ('a, 'b) => bool) => bool" }, { - "id": "Core.Promise.catch", + "id": "Stdlib.Null.compare", "kind": "value", - "name": "catch", - "docstrings": [ - "`catch(promise, errorCallback)` registers an exception handler in a promise chain.\nThe `errorCallback` receives an `exn` value that can later be refined into a JS\nerror or ReScript error. The `errorCallback` needs to return a promise with the\nsame type as the consumed promise. See [`Promise.catch`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/catch) on MDN.\n\n## Examples\n\n```rescript\nopen Promise\n\nexception SomeError(string)\n\nreject(SomeError(\"this is an error\"))\n->then(_ => {\n Ok(\"This result will never be returned\")->resolve\n})\n->catch(e => {\n let msg = switch(e) {\n | SomeError(msg) => \"ReScript error occurred: \" ++ msg\n | Exn.Error(obj) =>\n switch Exn.message(obj) {\n | Some(msg) => \"JS exception occurred: \" ++ msg\n | None => \"Some other JS value has been thrown\"\n }\n | _ => \"Unexpected error occurred\"\n }\n\n Error(msg)->resolve\n})\n->then(result => {\n switch result {\n | Ok(r) => Console.log2(\"Operation successful: \", r)\n | Error(msg) => Console.log2(\"Operation failed: \", msg)\n }->resolve\n})\n->ignore // Ignore needed for side-effects\n```\n\nIn case you want to return another promise in your `callback`, consider using\n`then` instead." - ], - "signature": "let catch: (t<'a>, exn => t<'a>) => t<'a>" + "name": "compare", + "docstrings": [], + "signature": "let compare: (\n t<'a>,\n t<'b>,\n ('a, 'b) => Ordering.t,\n) => Ordering.t" }, { - "id": "Core.Promise.then", + "id": "Stdlib.Null.toOption", "kind": "value", - "name": "then", + "name": "toOption", "docstrings": [ - "`then(promise, callback)` returns a new promise based on the result of `promise`'s \nvalue. The `callback` needs to explicitly return a new promise via `resolve`.\nIt is **not allowed** to resolve a nested promise (like `resolve(resolve(1))`).\nSee [`Promise.then`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/then) on MDN.\n## Examples\n\n```rescript\nopen Promise\nresolve(5)\n->then(num => {\n resolve(num + 5)\n})\n->then(num => {\n Console.log2(\"Your lucky number is: \", num)\n resolve()\n})\n->ignore\n```" + "Converts a nullable value into an option, so it can be pattern matched on.\nWill convert `null` to `None`, and a present value to `Some(value)`.\n\n## Examples\n```rescript\nlet nullStr = Null.make(\"Hello\")\n\nswitch nullStr->Null.toOption {\n| Some(str) => Console.log2(\"Got string:\", str)\n| None => Console.log(\"Didn't have a value.\")\n}\n```" ], - "signature": "let then: (t<'a>, 'a => t<'b>) => t<'b>" + "signature": "let toOption: t<'a> => option<'a>" }, { - "id": "Core.Promise.thenResolve", + "id": "Stdlib.Null.fromOption", "kind": "value", - "name": "thenResolve", + "name": "fromOption", "docstrings": [ - "`thenResolve(promise, callback)` converts an encapsulated value of a promise\ninto another promise wrapped value. It is **not allowed** to return a promise\nwithin the provided callback (e.g. `thenResolve(value => resolve(value))`).\n\n## Examples\n\n```rescript\nopen Promise\nresolve(\"Anna\")\n->thenResolve(str => {\n \"Hello \" ++ str\n})\n->thenResolve(str => {\n Console.log(str)\n})\n->ignore // Ignore needed for side-effects\n```\n\nIn case you want to return another promise in your `callback`, consider using\n`then` instead." + "Turns an `option` into a `Null.t`. `None` will be converted to `null`.\n\n## Examples\n```rescript\nlet optString: option = None\nlet asNull = optString->Null.fromOption // Null.t\nConsole.log(asNull == Null.null) // Logs `true` to the console.\n```" ], - "signature": "let thenResolve: (t<'a>, 'a => 'b) => t<'b>" + "signature": "let fromOption: option<'a> => t<'a>" }, { - "id": "Core.Promise.finally", + "id": "Stdlib.Null.getOr", "kind": "value", - "name": "finally", + "name": "getOr", "docstrings": [ - "`finally(promise, callback)` is used to execute a function that is called no\nmatter if a promise was resolved or rejected. It will return the same `promise`\nit originally received. See [`Promise.finally`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/finally) on MDN.\n\n## Examples\n\n```rescript\nopen Promise\nexception SomeError(string)\nlet isDone = ref(false)\n\nresolve(5)\n->then(_ => {\n reject(SomeError(\"test\"))\n})\n->then(v => {\n Console.log2(\"final result\", v)\n resolve()\n})\n->catch(_ => {\n Console.log(\"Error handled\")\n resolve()\n})\n->finally(() => {\n Console.log(\"finally\")\n isDone := true\n})\n->then(() => {\n Console.log2(\"isDone:\", isDone.contents)\n resolve()\n})\n->ignore\n```" + "`getOr(value, default)` returns `value` if not `null`, otherwise return\n`default`.\n\n## Examples\n\n```rescript\nNull.getOr(Null.null, \"Banana\") // Banana\nNull.getOr(Null.make(\"Apple\"), \"Banana\") // Apple\n\nlet greet = (firstName: option) =>\n \"Greetings \" ++ firstName->Option.getOr(\"Anonymous\")\n\nNull.make(\"Jane\")->Null.toOption->greet // \"Greetings Jane\"\nNull.null->Null.toOption->greet // \"Greetings Anonymous\"\n```" ], - "signature": "let finally: (t<'a>, unit => unit) => t<'a>" + "signature": "let getOr: (t<'a>, 'a) => 'a" }, { - "id": "Core.Promise.race", + "id": "Stdlib.Null.getWithDefault", "kind": "value", - "name": "race", - "docstrings": [ - "`race(arr)` runs all promises concurrently and returns promise settles with the eventual state of the first promise that settles. See [`Promise.race`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/race) on MDN.\n\n## Examples\n\n```rescript\nopen Promise\nlet racer = (ms, name) => {\n Promise.make((resolve, _) => {\n setTimeout(() => {\n resolve(name)\n }, ms)->ignore\n })\n}\n\nlet promises = [racer(1000, \"Turtle\"), racer(500, \"Hare\"), racer(100, \"Eagle\")]\n\nrace(promises)->then(winner => {\n Console.log(\"The winner is \" ++ winner)\n resolve()\n})\n```" - ], - "signature": "let race: array> => t<'a>" + "name": "getWithDefault", + "docstrings": [], + "signature": "let getWithDefault: (t<'a>, 'a) => 'a", + "deprecated": "Use getOr instead" }, { - "id": "Core.Promise.any", + "id": "Stdlib.Null.getExn", "kind": "value", - "name": "any", + "name": "getExn", "docstrings": [ - "`any(arr)` runs all promises concurrently and returns promise fulfills when any of the input's promises fulfills, with this first fulfillment value. See [`Promise.any`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/any) on MDN.\n\n## Examples\n\n```rescript\nopen Promise\nlet racer = (ms, name) => {\n Promise.make((resolve, _) => {\n setTimeout(() => {\n resolve(name)\n }, ms)->ignore\n })\n}\n\nlet promises = [racer(1000, \"Turtle\"), racer(500, \"Hare\"), racer(100, \"Eagle\")]\n\nany(promises)->then(winner => {\n Console.log(\"The winner is \" ++ winner)\n resolve()\n})\n```" + "`getExn(value)` raises an exception if `null`, otherwise returns the value.\n\n```rescript\nNull.getExn(Null.make(3))->assertEqual(3)\n\nswitch Null.getExn(%raw(\"'ReScript'\")) {\n| exception Invalid_argument(_) => assert(false)\n| value => assertEqual(value, \"ReScript\")\n}\n\nswitch Null.getExn(%raw(\"null\")) {\n| exception Invalid_argument(_) => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Raises `Invalid_argument` if `value` is `null`," ], - "signature": "let any: array> => t<'a>" + "signature": "let getExn: t<'a> => 'a" }, { - "id": "Core.Promise.all", + "id": "Stdlib.Null.getUnsafe", "kind": "value", - "name": "all", + "name": "getUnsafe", "docstrings": [ - "`all(promises)` runs all promises concurrently and returns a promise fulfills when all of the input's promises fulfill, with an array of the fulfillment values. See [`Promise.all`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/all) on MDN.\n\n```rescript\nopen Promise\nlet promises = [resolve(1), resolve(2), resolve(3)]\n\nall(promises)\n->then((results) => {\n results->Array.forEach(num => {\n Console.log2(\"Number: \", num)\n })\n\n resolve()\n})\n->ignore\n```" + "`getUnsafe(value)` returns `value`.\n\n## Examples\n\n```rescript\nNull.getUnsafe(Null.make(3)) == 3\nNull.getUnsafe(Null.null) // Raises an error\n```\n\n## Important\n\n- This is an unsafe operation, it assumes `value` is not `null`." ], - "signature": "let all: array> => t>" + "signature": "let getUnsafe: t<'a> => 'a" }, { - "id": "Core.Promise.all2", + "id": "Stdlib.Null.forEach", "kind": "value", - "name": "all2", + "name": "forEach", "docstrings": [ - "`all2((p1, p2))`. Like `all()`, but with a fixed size tuple of 2" + "`forEach(value, f)` call `f` on `value`. if `value` is not `null`, then if calls\n`f`, otherwise returns `unit`.\n\n## Examples\n\n```rescript\nNull.forEach(Null.make(\"thing\"), x => Console.log(x)) // logs \"thing\"\nNull.forEach(Null.null, x => Console.log(x)) // logs nothing\n```" ], - "signature": "let all2: ((t<'a>, t<'b>)) => t<('a, 'b)>" + "signature": "let forEach: (t<'a>, 'a => unit) => unit" }, { - "id": "Core.Promise.all3", + "id": "Stdlib.Null.map", "kind": "value", - "name": "all3", + "name": "map", "docstrings": [ - "`all3((p1, p2, p3))`. Like `all()`, but with a fixed size tuple of 3" + "`map(value, f)` returns `f(value)` if `value` is not `null`, otherwise returns\n`value` unchanged.\n\n## Examples\n\n```rescript\nNull.map(Null.make(3), x => x * x) // Null.make(9)\nNull.map(Null.null, x => x * x) // null\n```" ], - "signature": "let all3: ((t<'a>, t<'b>, t<'c>)) => t<('a, 'b, 'c)>" + "signature": "let map: (t<'a>, 'a => 'b) => t<'b>" }, { - "id": "Core.Promise.all4", + "id": "Stdlib.Null.mapOr", "kind": "value", - "name": "all4", + "name": "mapOr", "docstrings": [ - "`all4((p1, p2, p3, p4))`. Like `all()`, but with a fixed size tuple of 4" + "`mapOr(value, default, f)` returns `f(value)` if `value` is not `null`,\notherwise returns `default`.\n\n## Examples\n\n```rescript\nlet someValue = Null.make(3)\nsomeValue->Null.mapOr(0, x => x + 5) // 8\n\nlet noneValue = Null.null\nnoneValue->Null.mapOr(0, x => x + 5) // 0\n```" ], - "signature": "let all4: ((t<'a>, t<'b>, t<'c>, t<'d>)) => t<('a, 'b, 'c, 'd)>" + "signature": "let mapOr: (t<'a>, 'b, 'a => 'b) => 'b" }, { - "id": "Core.Promise.all5", + "id": "Stdlib.Null.mapWithDefault", "kind": "value", - "name": "all5", - "docstrings": [ - "`all5((p1, p2, p3, p4, p5))`. Like `all()`, but with a fixed size tuple of 5" - ], - "signature": "let all5: (\n (t<'a>, t<'b>, t<'c>, t<'d>, t<'e>),\n) => t<('a, 'b, 'c, 'd, 'e)>" + "name": "mapWithDefault", + "docstrings": [], + "signature": "let mapWithDefault: (t<'a>, 'b, 'a => 'b) => 'b", + "deprecated": "Use mapOr instead" }, { - "id": "Core.Promise.all6", + "id": "Stdlib.Null.flatMap", "kind": "value", - "name": "all6", + "name": "flatMap", "docstrings": [ - "`all6((p1, p2, p4, p5, p6))`. Like `all()`, but with a fixed size tuple of 6\n\")" + "`flatMap(value, f)` returns `f(value)` if `value` is not `null`, otherwise\nreturns `value` unchanged.\n\n## Examples\n\n```rescript\nlet addIfAboveOne = value =>\n if (value > 1) {\n Null.make(value + 1)\n } else {\n Null.null\n }\n\nNull.flatMap(Null.make(2), addIfAboveOne) // Null.make(3)\nNull.flatMap(Null.make(-4), addIfAboveOne) // null\nNull.flatMap(Null.null, addIfAboveOne) // null\n```" ], - "signature": "let all6: (\n (t<'a>, t<'b>, t<'c>, t<'d>, t<'e>, t<'f>),\n) => t<('a, 'b, 'c, 'd, 'e, 'f)>" - }, - { - "id": "Core.Promise.settledResult", - "kind": "type", - "name": "settledResult", - "docstrings": [], - "signature": "type settledResult<'a> =\n | Fulfilled({value: 'a})\n | Rejected({reason: exn})" + "signature": "let flatMap: (t<'a>, 'a => t<'b>) => t<'b>" }, { - "id": "Core.Promise.allSettled", + "id": "Stdlib.Null.ignore", "kind": "value", - "name": "allSettled", + "name": "ignore", "docstrings": [ - "`allSettled(promises)` runs all promises concurrently and returns promise fulfills when all of the input's promises settle with an array of objects that describe the outcome of each promise. See [`Promise.allSettled`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/allSettled) on MDN.\n\n```rescript\nopen Promise\n\nexception TestError(string)\n\nlet promises = [resolve(1), resolve(2), reject(TestError(\"some rejected promise\"))]\n\nallSettled(promises)\n->then((results) => {\n results->Array.forEach((result) => {\n switch result {\n | Fulfilled({value: num}) => \n Console.log2(\"Number: \", num)\n | Rejected({reason}) =>\n Console.log(reason)\n }\n })\n\n resolve()\n})\n->ignore\n```" + "`ignore(null)` ignores the provided null and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." ], - "signature": "let allSettled: array> => t>>" - }, + "signature": "let ignore: t<'a> => unit" + } + ] + }, + "stdlib/math": { + "id": "Stdlib.Math", + "name": "Math", + "docstrings": [ + "Functions for interacting with JavaScript Math.\nSee: [`Math`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math)." + ], + "items": [ { - "id": "Core.Promise.allSettled2", + "id": "Stdlib.Math.abs", "kind": "value", - "name": "allSettled2", + "name": "abs", "docstrings": [ - "`allSettled2((p1, p2))`. Like `allSettled()`, but with a fixed size tuple of 2" + "`abs(v)` returns absolute value of `v`.\nSee [`Math.abs`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/abs) on MDN.\n\n## Examples\n\n```rescript\nassertEqual(Math.abs(-2.0), 2.0)\nassertEqual(Math.abs(3.0), 3.0)\n```" ], - "signature": "let allSettled2: (\n (t<'a>, t<'b>),\n) => t<(settledResult<'a>, settledResult<'b>)>" + "signature": "let abs: float => float" }, { - "id": "Core.Promise.allSettled3", + "id": "Stdlib.Math.acos", "kind": "value", - "name": "allSettled3", + "name": "acos", "docstrings": [ - "`allSettled3((p1, p2, p3))`. Like `allSettled()`, but with a fixed size tuple of 3" + "`acos(v)` returns arccosine (in radians) of argument `v`, returns `NaN` if the\nargument is outside the range [-1.0, 1.0].\nSee [`Math.acos`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/acos) on MDN.\n\n## Examples\n\n```rescript\nassertEqual(Math.acos(-1.0), 3.141592653589793)\nassertEqual(Math.acos(-3.0)->Float.isNaN, true)\n```" ], - "signature": "let allSettled3: (\n (t<'a>, t<'b>, t<'c>),\n) => t<\n (settledResult<'a>, settledResult<'b>, settledResult<'c>),\n>" + "signature": "let acos: float => float" }, { - "id": "Core.Promise.allSettled4", + "id": "Stdlib.Math.acosh", "kind": "value", - "name": "allSettled4", + "name": "acosh", "docstrings": [ - "`allSettled4((p1, p2, p3, p4))`. Like `allSettled()`, but with a fixed size tuple of 4" + "`acosh(v)` returns the inverse hyperbolic arccosine (in radians) of argument `v`,\nreturns `NaN` if the argument is less than `1.0`.\nSee [`Math.acosh`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/acosh) on MDN.\n\n## Examples\n\n```rescript\nassertEqual(Math.acosh(1.0), 0.0)\nassertEqual(Math.acosh(0.5)->Float.isNaN, true)\n```" ], - "signature": "let allSettled4: (\n (t<'a>, t<'b>, t<'c>, t<'d>),\n) => t<\n (\n settledResult<'a>,\n settledResult<'b>,\n settledResult<'c>,\n settledResult<'d>,\n ),\n>" + "signature": "let acosh: float => float" }, { - "id": "Core.Promise.allSettled5", + "id": "Stdlib.Math.asin", "kind": "value", - "name": "allSettled5", + "name": "asin", "docstrings": [ - "`allSettled5((p1, p2, p3, p4, p5))`. Like `allSettled()`, but with a fixed size tuple of 5" + "`asin(v)` returns the inverse sine (in radians) of argument `v`, returns `NaN`\nif the argument `v` is outside the range [-1.0, 1.0].\nSee [`Math.asin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/asin) on MDN.\n\n## Examples\n\n```rescript\nassertEqual(Math.asin(-1.0), -1.5707963267948966)\nassertEqual(Math.asin(-2.0)->Float.isNaN, true)\n```" ], - "signature": "let allSettled5: (\n (t<'a>, t<'b>, t<'c>, t<'d>, t<'e>),\n) => t<\n (\n settledResult<'a>,\n settledResult<'b>,\n settledResult<'c>,\n settledResult<'d>,\n settledResult<'e>,\n ),\n>" + "signature": "let asin: float => float" }, { - "id": "Core.Promise.allSettled6", + "id": "Stdlib.Math.asinh", "kind": "value", - "name": "allSettled6", + "name": "asinh", "docstrings": [ - "`allSettled6((p1, p2, p4, p5, p6))`. Like `allSettled()`, but with a fixed size tuple of 6\n\")" + "`asinh(v)` returns the inverse hyperbolic sine of argument `v`.\nSee [`Math.asinh`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/asinh) on MDN.\n\n## Examples\n\n```rescript\nassertEqual(Math.asinh(-1.0), -0.881373587019543)\nassertEqual(Math.asinh(-0.0), -0.0)\n```" ], - "signature": "let allSettled6: (\n (t<'a>, t<'b>, t<'c>, t<'d>, t<'e>, t<'f>),\n) => t<\n (\n settledResult<'a>,\n settledResult<'b>,\n settledResult<'c>,\n settledResult<'d>,\n settledResult<'e>,\n settledResult<'f>,\n ),\n>" + "signature": "let asinh: float => float" }, { - "id": "Core.Promise.done", + "id": "Stdlib.Math.atan", "kind": "value", - "name": "done", + "name": "atan", "docstrings": [ - "`done(p)` is a safe way to ignore a promise. If a value is anything else than a\npromise, it will raise a type error." + "`atan(v)` returns the inverse tangent (in radians) of argument `v`.\nSee [`Math.atan`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/atan) on MDN.\n\n## Examples\n\n```rescript\nassertEqual(Math.atan(-0.0), -0.0)\nassertEqual(Math.atan(0.0), 0.0)\nassertEqual(Math.atan(1.0), 0.7853981633974483)\n```" ], - "signature": "let done: promise<'a> => unit" - } - ] - }, - "core/ordering": { - "id": "Core.Ordering", - "name": "Ordering", - "docstrings": [], - "items": [ - { - "id": "Core.Ordering.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = float" + "signature": "let atan: float => float" }, { - "id": "Core.Ordering.less", + "id": "Stdlib.Math.atanh", "kind": "value", - "name": "less", - "docstrings": [], - "signature": "let less: float" + "name": "atanh", + "docstrings": [ + "`atanh(v)` returns the invert hyperbolic tangent of argument `v`. Returns `NaN`\nif the argument `v` is is outside the range [-1.0, 1.0] and `Infinity` if `v`\nis `-1.0` or `1.0`.\nSee [`Math.atanh`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/atanh) on MDN.\n\n## Examples\n\n```rescript\nassertEqual(Math.atanh(-2.0)->Float.isNaN, true)\nassertEqual(Math.atanh(-1.0)->Float.isFinite, false)\nassertEqual(Math.atanh(-0.0), -0.0)\nassertEqual(Math.atanh(0.0), 0.0)\nassertEqual(Math.atanh(0.5), 0.5493061443340548)\n```" + ], + "signature": "let atanh: float => float" }, { - "id": "Core.Ordering.equal", + "id": "Stdlib.Math.atan2", "kind": "value", - "name": "equal", - "docstrings": [], - "signature": "let equal: float" + "name": "atan2", + "docstrings": [ + "`atan2(~y, ~x)` returns the angle (in radians) of the quotient `y /. x`. It is\nalso the angle between the *x*-axis and point (*x*, *y*).\nSee [`Math.atan2`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/atan2) on MDN.\n\n## Examples\n\n```rescript\nassertEqual(Math.atan2(~y=0.0, ~x=10.0), 0.0)\nassertEqual(Math.atan2(~x=5.0, ~y=5.0), Math.Constants.pi /. 4.0)\nassertEqual(Math.atan2(~x=90.0, ~y=15.0),0.16514867741462683)\nassertEqual(Math.atan2(~x=15.0, ~y=90.0), 1.4056476493802699)\n```" + ], + "signature": "let atan2: (~y: float, ~x: float) => float" }, { - "id": "Core.Ordering.greater", + "id": "Stdlib.Math.cbrt", "kind": "value", - "name": "greater", - "docstrings": [], - "signature": "let greater: float" + "name": "cbrt", + "docstrings": [ + "`cbrt(v)` returns the cube root of argument `v`.\nSee [`Math.cbrt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/cbrt) on MDN.\n\n## Examples\n\n```rescript\nassertEqual(Math.cbrt(-1.0), -1.0)\nassertEqual(Math.cbrt(-0.0), -0.0)\nassertEqual(Math.cbrt(0.0), 0.0)\n```" + ], + "signature": "let cbrt: float => float" }, { - "id": "Core.Ordering.isLess", + "id": "Stdlib.Math.ceil", "kind": "value", - "name": "isLess", - "docstrings": [], - "signature": "let isLess: float => bool" + "name": "ceil", + "docstrings": [ + "`ceil(v)` returns the smallest integral value greater than or equal to the\nargument `v`. The result is a `float` and is not restricted to the `int` data\ntype range.\nSee [`Math.ceil`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/ceil) on MDN.\n\n## Examples\n\n```rescript\nassertEqual(Math.ceil(3.1), 4.0)\nassertEqual(Math.ceil(3.0), 3.0)\nassertEqual(Math.ceil(-3.1), -3.0)\nassertEqual(Math.ceil(2_150_000_000.3), 2_150_000_001.0)\n```" + ], + "signature": "let ceil: float => float" }, { - "id": "Core.Ordering.isEqual", + "id": "Stdlib.Math.cos", "kind": "value", - "name": "isEqual", - "docstrings": [], - "signature": "let isEqual: float => bool" + "name": "cos", + "docstrings": [ + "`cos(v)` returns the cosine of argument `v`, which must be specified in radians.\nSee [`Math.cos`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/cos) on MDN.\n\n## Examples\n\n```rescript\nassertEqual(Math.cos(-0.0), 1.0)\nassertEqual(Math.cos(0.0), 1.0)\nassertEqual(Math.cos(1.0), 0.5403023058681398)\n```" + ], + "signature": "let cos: float => float" }, { - "id": "Core.Ordering.isGreater", + "id": "Stdlib.Math.cosh", "kind": "value", - "name": "isGreater", - "docstrings": [], - "signature": "let isGreater: float => bool" + "name": "cosh", + "docstrings": [ + "`cosh(v)` returns the hyperbolic cosine of argument `v`, which must be specified\nin radians.\nSee [`Math.cosh`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/cosh) on MDN.\n\n## Examples\n\n```rescript\nassertEqual(Math.cosh(-1.0), 1.5430806348152437)\nassertEqual(Math.cosh(-0.0), 1.0)\nassertEqual(Math.cosh(0.0), 1.0)\n```" + ], + "signature": "let cosh: float => float" }, { - "id": "Core.Ordering.invert", + "id": "Stdlib.Math.exp", "kind": "value", - "name": "invert", - "docstrings": [], - "signature": "let invert: float => float" + "name": "exp", + "docstrings": [ + "`exp(v)` returns natural exponentional, returns *e* (the base of natural logarithms)\nto the power of the given argument `v`.\nSee [`Math.exp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/exp) on MDN.\n\n## Examples\n\n```rescript\nassertEqual(Math.exp(-1.0), 0.36787944117144233)\nassertEqual(Math.exp(0.0), 1.0)\n```" + ], + "signature": "let exp: float => float" }, { - "id": "Core.Ordering.fromInt", + "id": "Stdlib.Math.expm1", "kind": "value", - "name": "fromInt", - "docstrings": [], - "signature": "let fromInt: int => float" - } - ] - }, - "core/object": { - "id": "Core.Object", - "name": "Object", - "docstrings": [], - "items": [ + "name": "expm1", + "docstrings": [ + "`expm1(v)` returns *e* (the base of natural logarithms) to the power of the given\nargument `v` minus 1.\nSee [`Math.expm1`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/expm1) on MDN.\n\n## Examples\n\n```rescript\nassertEqual(Math.expm1(-1.0), -0.6321205588285577)\nassertEqual(Math.expm1(-0.0), -0.0)\n```" + ], + "signature": "let expm1: float => float" + }, { - "id": "Core.Object.make", + "id": "Stdlib.Math.floor", "kind": "value", - "name": "make", + "name": "floor", "docstrings": [ - "`make` create a new object that inherits the properties and methods from the standard built-in Object, such as `toString`. See [Object on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)\n\n## Examples\n\n```rescript\nlet x = Object.make()\nx->Object.keysToArray->Array.length // 0\nx->Object.get(\"toString\")->Option.isSome // true\n```" + "`floor(v)` returns the largest integral value less than or equal to the argument\n`v`. The result is a `float` and is not restricted to the `int` data type range.\nSee [`Math.floor`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/floor) on MDN.\n\n## Examples\n\n```rescript\nassertEqual(Math.floor(-45.95), -46.0)\nassertEqual(Math.floor(-45.05), -46.0)\nassertEqual(Math.floor(-0.0), -0.0)\n```" ], - "signature": "let make: unit => {..}" + "signature": "let floor: float => float" }, { - "id": "Core.Object.is", + "id": "Stdlib.Math.fround", "kind": "value", - "name": "is", + "name": "fround", "docstrings": [ - "`is` determines if two objects are identical in all contexts. Objects, arrays, records, and other non-primitives are only identical if they reference the **exact** same object in memory. Primitives like ints, floats, and strings are identical if they have the same value. `+0` and `-0` are distinct. NaN is equal to itself. See [Object.is on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is)\n\nIn most scenarios use `==` or `===` or the custom `equals` function (if provided) for the type.\n\n## Examples\n\n```rescript\nObject.is(25, 13) // false\nObject.is(\"abc\", \"abc\") // true\nObject.is(undefined, undefined) // true\nObject.is(undefined, null) // false\nObject.is(-0.0, 0.0) // false\nObject.is(list{1, 2}, list{1, 2}) // false\n\nObject.is([1, 2, 3], [1, 2, 3]) // false\n[1, 2, 3] == [1, 2, 3] // true\n[1, 2, 3] === [1, 2, 3] // false\n\nlet fruit = {\"name\": \"Apple\" }\nObject.is(fruit, fruit) // true\nObject.is(fruit, {\"name\": \"Apple\" }) // false\nfruit == {\"name\": \"Apple\" } // true\nfruit === {\"name\": \"Apple\" } // false\n```" + "`fround(v)` returns the nearest single precision float.\nSee [`Math.fround`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/fround) on MDN.\n\n## Examples\n\n```rescript\nassertEqual(Math.fround(5.5), 5.5)\nassertEqual(Math.fround(5.05), 5.050000190734863)\n```" ], - "signature": "let is: ('a, 'a) => bool" + "signature": "let fround: float => float" }, { - "id": "Core.Object.create", + "id": "Stdlib.Math.hypot", "kind": "value", - "name": "create", + "name": "hypot", "docstrings": [ - "`create` creates a new object, using an existing object as the prototype of the new object. See [Object.create on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/create)\n\n**Note:** ReScript provides [first-class support for immutable objects](https://rescript-lang.org/docs/manual/latest/object) and [records](https://rescript-lang.org/docs/manual/latest/record). This is often safer and more convenient than using `create` and other functions in this module.\n\n## Examples\n\n```rescript\nlet x = {\"fruit\": \"banana\"}\nlet y = Object.create(x)\ny->Object.get(\"fruit\") // Some(\"banana\")\n```" + "`hypot(a, b)` returns the square root of the sum of squares of its two arguments\n(the Pythagorean formula).\nSee [`Math.hypot`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/hypot) on MDN.\n\n## Examples\n\n```rescript\nassertEqual(Math.hypot(3.0, 4.0), 5.0)\nassertEqual(Math.hypot(3.0, 5.0), 5.8309518948453)\n```" ], - "signature": "let create: {..} => {..}" + "signature": "let hypot: (float, float) => float" }, { - "id": "Core.Object.createWithProperties", + "id": "Stdlib.Math.hypotMany", "kind": "value", - "name": "createWithProperties", - "docstrings": [], - "signature": "let createWithProperties: ({..}, {..}) => {..}" + "name": "hypotMany", + "docstrings": [ + "`hypotMany(arr)` returns the square root of the sum of squares of the numbers in\nthe array argument (generalized Pythagorean equation). Using an array allows you\nto have more than two items. If `arr` is an empty array then returns `0.0`.\nSee [`Math.hypot`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/hypot) on MDN.\n\n## Examples\n\n```rescript\nassertEqual(Math.hypotMany([3.0, 4.0, 5.0]), 7.0710678118654755)\nassertEqual(Math.hypotMany([]), 0.0)\n```" + ], + "signature": "let hypotMany: array => float" }, { - "id": "Core.Object.createWithNull", + "id": "Stdlib.Math.log", "kind": "value", - "name": "createWithNull", - "docstrings": [], - "signature": "let createWithNull: unit => {..}" + "name": "log", + "docstrings": [ + "`log(v)` returns the natural logarithm of argument `v`, this is the number *x*\nsuch that `e^x` equals the argument. Returns `NaN` for negative arguments and\n`Infinity` for `0.0` or `-0.0`.\nSee [`Math.log`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/log) on MDN.\n\n## Examples\n\n```rescript\nassertEqual(Math.log(-1.0)->Float.isNaN, true)\nassertEqual(Math.log(-0.0)->Float.isFinite, false)\nassertEqual(Math.log(0.0)->Float.isFinite, false)\nassertEqual(Math.log(1.0), 0.0)\n```" + ], + "signature": "let log: float => float" }, { - "id": "Core.Object.createWithNullAndProperties", + "id": "Stdlib.Math.log1p", "kind": "value", - "name": "createWithNullAndProperties", - "docstrings": [], - "signature": "let createWithNullAndProperties: {..} => {..}" + "name": "log1p", + "docstrings": [ + "`log1p(v)` returns the natural logarithm of one plus the argument `v`.\nReturns `NaN` for arguments less than `-1` and `Infinity` if `v` is `-1.0`.\nSee [`Math.log1p`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/log1p) on MDN.\n\n## Examples\n\n```rescript\nassertEqual(Math.log1p(-2.0)->Float.isNaN, true)\nassertEqual(Math.log1p(-1.0)->Float.isFinite, false)\nassertEqual(Math.log1p(-0.0), -0.0)\n```" + ], + "signature": "let log1p: float => float" }, { - "id": "Core.Object.assign", + "id": "Stdlib.Math.log10", "kind": "value", - "name": "assign", + "name": "log10", "docstrings": [ - "`assign(target, source)` copies enumerable own properties from the source to the target, overwriting properties with the same name. It returns the modified target object. A deep clone is not created; properties are copied by reference.\n\n**Warning:** ReScript provides compile-time support for type-safe access to JavaScript objects. This eliminates common errors such as accessing properties that do not exist, or using a property of type x as if it were a y. Using `assign` can bypass these safety checks and lead to run-time errors (if you are not careful). ReScript provides [first-class support for immutable objects](https://rescript-lang.org/docs/manual/latest/object) and [records](https://rescript-lang.org/docs/manual/latest/record). This is often safer and more convenient than using `assign` and other functions in this module.\n\nSee [Object.assign on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign) or [ECMAScript Language Specification](https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.assign).\n\n## Examples\n\n```rescript\nObject.assign({\"a\": 1}, {\"a\": 2}) // {\"a\": 2}\nObject.assign({\"a\": 1, \"b\": 2}, {\"a\": 0}) // {\"a\": 0, \"b\": 2}\nObject.assign({\"a\": 1}, {\"a\": null}) // {\"a\": null}\n```" + "`log10(v)` returns the base 10 logarithm of argument `v`. Returns `NaN` for\nnegative `v`. If `v` is `-0.0` or `0.0` returns `Infinity`.\nSee [`Math.log10`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/log10) on MDN.\n\n## Examples\n\n```rescript\nassertEqual(Math.log10(-2.0)->Float.isNaN, true)\nassertEqual(Math.log10(-0.0)->Float.isFinite, false)\nassertEqual(Math.log10(0.0)->Float.isFinite, false)\nassertEqual(Math.log10(1.0), 0.0)\n```" ], - "signature": "let assign: ({..}, {..}) => {..}" + "signature": "let log10: float => float" }, { - "id": "Core.Object.assignMany", + "id": "Stdlib.Math.log2", "kind": "value", - "name": "assignMany", + "name": "log2", "docstrings": [ - "`assignMany(target, sources)` copies enumerable own properties from each source to the target, overwriting properties with the same name. Later sources' properties overwrite earlier ones. It returns the modified target object. A deep clone is not created; properties are copied by reference.\n\n**Note:** ReScript provides [first-class support for immutable objects](https://rescript-lang.org/docs/manual/latest/object), including spreading one object into another. This is often more convenient than using `assign` or `assignMany`. \n\nSee [Object.assign on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign) or [ECMAScript Language Specification](https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.assign)." + "`log2(v)` returns the base 2 logarithm of argument `v`. Returns `NaN` for\nnegative `v` and `Infinity` if `v` is `-0.0` or `0.0`.\nSee [`Math.log2`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/log2) on MDN.\n\n## Examples\n\n```rescript\nassertEqual(Math.log2(-2.0)->Float.isNaN, true)\nassertEqual(Math.log2(-0.0)->Float.isFinite, false)\nassertEqual(Math.log2(0.0)->Float.isFinite, false)\nassertEqual(Math.log2(1.0), 0.0)\n```" ], - "signature": "let assignMany: ({..}, array<{..}>) => {..}" + "signature": "let log2: float => float" }, { - "id": "Core.Object.copy", + "id": "Stdlib.Math.min", "kind": "value", - "name": "copy", - "docstrings": [], - "signature": "let copy: ({..} as 'a) => 'a" + "name": "min", + "docstrings": [ + "`min(a, b)` returns the minimum of its two float arguments.\nSee [`Math.min`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/min) on MDN.\n\n## Examples\n\n```rescript\nassertEqual(Math.min(1.0, 2.0), 1.0)\nassertEqual(Math.min(-1.0, -2.0), -2.0)\n```" + ], + "signature": "let min: (float, float) => float" }, { - "id": "Core.Object.get", + "id": "Stdlib.Math.minMany", "kind": "value", - "name": "get", + "name": "minMany", "docstrings": [ - "`get` gets the value of a property by name. Returns `None` if the property does not exist or has the value `undefined`. Otherwise returns `Some`, including if the value is `null`.\n\n## Examples\n\n```rescript\n{\"a\": 1}->Object.get(\"a\") // Some(1)\n{\"a\": 1}->Object.get(\"b\") // None\n{\"a\": undefined}->Object.get(\"a\") // None\n{\"a\": null}->Object.get(\"a\") // Some(null)\n{\"a\": 1}->Object.get(\"toString\")->Option.isSome // true\n```" + "`minMany(arr)` returns the minimum of the float in the given array `arr`.\nReturns `Infinity` if `arr` is empty.\nSee [`Math.min`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/min) on MDN.\n\n## Examples\n\n```rescript\nassertEqual(Math.minMany([1.0, 2.0]), 1.0)\nassertEqual(Math.minMany([-1.0, -2.0]), -2.0)\nassertEqual(Math.minMany([])->Float.isFinite, false)\n```" ], - "signature": "let get: ({..}, string) => option<'a>" + "signature": "let minMany: array => float" }, { - "id": "Core.Object.getSymbol", + "id": "Stdlib.Math.max", "kind": "value", - "name": "getSymbol", + "name": "max", "docstrings": [ - "`getSymbol` gets the value of a property by symbol. Returns `None` if the property does not exist or has the value `undefined`. Otherwise returns `Some`, including if the value is `null`.\n\n## Examples\n\n```rescript\nlet fruit = Symbol.make(\"fruit\")\nlet x = Object.make()\nx->Object.setSymbol(fruit, \"banana\")\nx->Object.getSymbol(fruit) // Some(\"banana\")\n```" + "`max(a, b)` returns the maximum of its two float arguments.\nSee [`Math.max`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/max) on MDN.\n\n## Examples\n\n```rescript\nassertEqual(Math.max(1.0, 2.0), 2.0)\nassertEqual(Math.max(-1.0, -2.0), -1.0)\n```" ], - "signature": "let getSymbol: ({..}, Core__Symbol.t) => option<'a>" + "signature": "let max: (float, float) => float" }, { - "id": "Core.Object.getSymbolUnsafe", + "id": "Stdlib.Math.maxMany", "kind": "value", - "name": "getSymbolUnsafe", - "docstrings": [], - "signature": "let getSymbolUnsafe: ({..}, Core__Symbol.t) => 'a" + "name": "maxMany", + "docstrings": [ + "`maxMany(arr)` returns the maximum of the float in the given array `arr`.\nReturns `Infinity` if `arr` is empty.\nSee [`Math.max`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/max) on MDN.\n\n## Examples\n\n```rescript\nassertEqual(Math.maxMany([1.0, 2.0]), 2.0)\nassertEqual(Math.maxMany([-1.0, -2.0]), -1.0)\nassertEqual(Math.maxMany([])->Float.isFinite, false)\n```" + ], + "signature": "let maxMany: array => float" }, { - "id": "Core.Object.set", + "id": "Stdlib.Math.pow", "kind": "value", - "name": "set", + "name": "pow", "docstrings": [ - "`set(name, value)` assigns a value to the named object property, overwriting the previous value if any. See [Working with Objects on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Working_with_Objects#objects_and_properties)\n\n## Examples\n\n```rescript\n{\"a\": 1}->Object.set(\"a\", 2) // {\"a\": 2}\n{\"a\": 1}->Object.set(\"a\", None) // {\"a\": None}\n{\"a\": 1}->Object.set(\"b\", 2) // {\"a\": 1, \"b\": 2}\n```" + "`pow(a, ~exp)` raises the given base `a` to the given exponent `exp`.\nSee [`Math.pow`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/pow) on MDN.\n\n## Examples\n\n```rescript\nassertEqual(Math.pow(2.0, ~exp=4.0), 16.0)\nassertEqual(Math.pow(3.0, ~exp=4.0), 81.0)\n```" ], - "signature": "let set: ({..}, string, 'a) => unit" + "signature": "let pow: (float, ~exp: float) => float" }, { - "id": "Core.Object.setSymbol", + "id": "Stdlib.Math.random", "kind": "value", - "name": "setSymbol", - "docstrings": [], - "signature": "let setSymbol: ({..}, Core__Symbol.t, 'a) => unit" + "name": "random", + "docstrings": [ + "`random()` returns a random number in the half-closed interval [0,1].\nSee [`Math.random`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random) on MDN.\n\n## Examples\n\n```rescript\nMath.random()\n```" + ], + "signature": "let random: unit => float" }, { - "id": "Core.Object.keysToArray", + "id": "Stdlib.Math.round", "kind": "value", - "name": "keysToArray", + "name": "round", "docstrings": [ - "`keysToArray` returns an array of an object's own enumerable string-keyed property names. See [ECMAScript Language Specification](https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.keys) \nor [Object.keys on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys).\n\n## Examples\n\n```rescript\n{\"a\": 1, \"b\": 2}->Object.keysToArray // [\"a\", \"b\"]\n{\"a\": None}->Object.keysToArray // [\"a\"]\nObject.make()->Object.keysToArray // []\n```" + "`round(v)` returns then value of `v` rounded to nearest integral value\n(expressed as a float). If the fractional portion of the argument `v` is greater\nthan `0.5`, the argument `v` is rounded to the float with the next higher\nabsolute value.\nSee [`Math.round`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/round) on MDN.\n\n## Examples\n\n```rescript\nassertEqual(Math.round(-20.5), -20.0)\nassertEqual(Math.round(-0.1), -0.0)\nassertEqual(Math.round(0.0), 0.0)\nassertEqual(Math.round(-0.0), -0.0)\n```" ], - "signature": "let keysToArray: {..} => array" + "signature": "let round: float => float" }, { - "id": "Core.Object.hasOwnProperty", + "id": "Stdlib.Math.sign", "kind": "value", - "name": "hasOwnProperty", + "name": "sign", "docstrings": [ - "`hasOwnProperty` determines whether the object has the specified property as its **own** property, as opposed to inheriting it. See [hasOwnProperty on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty)\n\n## Examples\n\n```rescript\nlet point = {\"x\": 1, \"y\": 2}\n{\"a\": 1}->Object.hasOwnProperty(\"a\") // true\n{\"a\": 1}->Object.hasOwnProperty(\"b\") // false\n{\"a\": 1}->Object.hasOwnProperty(\"toString\") // false\n```" + "`sign(v)` returns the sign of its foat argument: `-1` if negative, `0` if\nzero, `1` if positive.\nSee [`Math.sign`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sign) on MDN.\n\n## Examples\n\n```rescript\nassertEqual(Math.sign(3.0), 1.0)\nassertEqual(Math.sign(-3.0), -1.0)\nassertEqual(Math.sign(0.0), 0.0)\n```" ], - "signature": "let hasOwnProperty: ({..}, string) => bool" + "signature": "let sign: float => float" }, { - "id": "Core.Object.seal", + "id": "Stdlib.Math.sin", "kind": "value", - "name": "seal", + "name": "sin", "docstrings": [ - "`seal` seals an object. Sealing an object prevents extensions and makes existing properties non-configurable. A sealed object has a fixed set of properties. Unlike `freeze`, values of existing properties can still be changed as long as they are writable. \n\n**Note:** `seal` returns the same object that was passed in; it does not create a copy. Any attempt to delete or add properties to a sealed object will fail, either silently or by throwing an error. \n\nSee [ECMAScript Language Specification](https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.seal) and [Object.seal on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/seal)\n\n## Examples\n\n```rescript\nlet point = {\"x\": 1, \"y\": 2}\npoint->Object.set(\"x\", -7) // succeeds\npoint->Object.seal->ignore\npoint->Object.set(\"z\", 9) // fails\npoint->Object.set(\"x\", 13) // succeeds\n```" + "`sin(v)` returns the sine of argument `v`, which must be specified in radians.\nSee [`Math.sin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sin) on MDN.\n\n## Examples\n\n```rescript\nassertEqual(Math.sin(-0.0), -0.0)\nassertEqual(Math.sin(0.0), 0.0)\nassertEqual(Math.sin(1.0), 0.8414709848078965)\n```" ], - "signature": "let seal: ({..} as 'a) => 'a" + "signature": "let sin: float => float" }, { - "id": "Core.Object.preventExtensions", + "id": "Stdlib.Math.sinh", "kind": "value", - "name": "preventExtensions", + "name": "sinh", "docstrings": [ - "`preventExtensions` prevents new properties from being added to the object. It modifies the object (rather than creating a copy) and returns it.\n\nSee [ECMAScript Language Specification](https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.preventextensions) and [Object.preventExtensions on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/preventExtensions)\n\n## Examples\n\n```rescript\nlet obj = {\"a\": 1}\nobj->Object.set(\"b\", 2) // succeeds\nobj->Object.preventExtensions->ignore\nobj->Object.set(\"c\", 3) // fails\n```" + "`sinh(v)` returns then hyperbolic sine of argument `v`, which must be specified\nin radians.\nSee [`Math.sinh`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sinh) on MDN.\n\n## Examples\n\n```rescript\nassertEqual(Math.sinh(-0.0), -0.0)\nassertEqual(Math.sinh(0.0), 0.0)\nassertEqual(Math.sinh(1.0), 1.1752011936438014)\n```" ], - "signature": "let preventExtensions: ({..} as 'a) => 'a" + "signature": "let sinh: float => float" }, { - "id": "Core.Object.freeze", + "id": "Stdlib.Math.sqrt", "kind": "value", - "name": "freeze", + "name": "sqrt", "docstrings": [ - "`freeze` freezes an object. Freezing an object makes existing properties non-writable and prevents extensions. Once an object is frozen, new properties cannot be be added, existing properties cannot be removed, and their values cannot be changed.\n\n**Note:** `freeze` returns the same object that was passed in; it does not create a frozen copy. Any attempt to change a frozen object will fail, either silently or by throwing an exception.\n\nSee [ECMAScript Language Specification](https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.isfrozen) and [Object.isFrozen on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/isFrozen).\n\n## Examples\n\n ```rescript\nlet obj = {\"a\": 1}\nobj->Object.set(\"a\", 2) // succeeds\nobj->Object.freeze->ignore\nobj->Object.set(\"a\", 3) // fails\n```" + "`sqrt(v)` returns the square root of `v`. If `v` is negative returns `NaN`.\nSee [`Math.sqrt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sqrt) on MDN.\n\n## Examples\n\n```rescript\nassertEqual(Math.sqrt(-1.0)->Float.isNaN, true)\nassertEqual(Math.sqrt(-0.0), -0.0)\nassertEqual(Math.sqrt(0.0), 0.0)\nassertEqual(Math.sqrt(1.0), 1.0)\nassertEqual(Math.sqrt(9.0), 3.0)\n```" ], - "signature": "let freeze: ({..} as 'a) => 'a" + "signature": "let sqrt: float => float" }, { - "id": "Core.Object.isSealed", + "id": "Stdlib.Math.tan", "kind": "value", - "name": "isSealed", + "name": "tan", "docstrings": [ - "`isSealed` determines if an object is sealed. A sealed object has a fixed set of properties.\n\nSee [ECMAScript Language Specification](https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.issealed) and [Object.isSealed on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/isSealed)\n\n## Examples\n\n```rescript\nlet point = {\"x\": 1, \"y\": 3}->Object.seal\nlet pointIsSealed = point->Object.isSealed // true\nlet fruit = {\"name\": \"Apple\" }\nlet fruitIsSealed = fruit->Object.isSealed // false\n ```" + "`tan(v)` returns the tangent of argument `v`, which must be specified in\nradians. Returns `NaN` if `v` is positive `Infinity` or negative `Infinity`.\nSee [`Math.tan`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/tan) on MDN.\n\n## Examples\n\n```rescript\nassertEqual(Math.tan(-0.0), -0.0)\nassertEqual(Math.tan(0.0), 0.0)\nassertEqual(Math.tan(1.0), 1.5574077246549023)\n```" ], - "signature": "let isSealed: 'a => bool" + "signature": "let tan: float => float" }, { - "id": "Core.Object.isFrozen", + "id": "Stdlib.Math.tanh", "kind": "value", - "name": "isFrozen", + "name": "tanh", "docstrings": [ - "`isFrozen` determines if an object is frozen. An object is frozen if an only if it is not extensible, all its properties are non-configurable, and all its data properties are non-writable.\n\nSee [ECMAScript Language Specification](https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.isfrozen) and [Object.isFrozen on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/isFrozen).\n\n## Examples\n\n```rescript\nlet point = {\"x\": 1, \"y\": 3}->Object.freeze\nlet pointIsFrozen = point->Object.isFrozen // true\nlet fruit = {\"name\": \"Apple\" }\nlet fruitIsFrozen = fruit->Object.isFrozen // false\n ```" + "`tanh(v)` returns the hyperbolic tangent of argument `v`, which must be\nspecified in radians.\nSee [`Math.tanh`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/tanh) on MDN.\n\n## Examples\n\n```rescript\nassertEqual(Math.tanh(-0.0), -0.0)\nassertEqual(Math.tanh(0.0), 0.0)\nassertEqual(Math.tanh(1.0), 0.7615941559557649)\n```" ], - "signature": "let isFrozen: 'a => bool" + "signature": "let tanh: float => float" }, { - "id": "Core.Object.isExtensible", + "id": "Stdlib.Math.trunc", "kind": "value", - "name": "isExtensible", + "name": "trunc", "docstrings": [ - "`isExtensible` determines if an object is extensible (whether it can have new properties added to it).\n\nSee [ECMAScript Language Specification](https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.isextensible) and [Object.isExtensible on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/isExtensible)\n\n## Examples\n\n```rescript\nlet obj = {\"a\": 1}\nobj->Object.isExtensible // true\nobj->Object.preventExtensions->ignore\nobj->Object.isExtensible // false\n```" + "`trunc(v)` truncates the argument `v`, i.e., removes fractional digits.\nSee [`Math.trunc`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/trunc) on MDN.\n\n## Examples\n\n```rescript\nassertEqual(Math.trunc(0.123), 0.0)\nassertEqual(Math.trunc(1.999), 1.0)\nassertEqual(Math.trunc(13.37), 13.0)\nassertEqual(Math.trunc(42.84), 42.0)\n```" ], - "signature": "let isExtensible: 'a => bool" + "signature": "let trunc: float => float" } ] }, - "core/nullable": { - "id": "Core.Nullable", - "name": "Nullable", - "docstrings": [ - "Functions for handling nullable values.\n\nPrimarily useful when interoping with JavaScript when you don't know whether you'll get a value, `null` or `undefined`." - ], + "stdlib/list": { + "id": "Stdlib.List", + "name": "List", + "docstrings": [], "items": [ { - "id": "Core.Nullable.t", + "id": "Stdlib.List.t", "kind": "type", "name": "t", "docstrings": [ - "Type representing a nullable value.\nA nullable value can be the value `'a`, `null` or `undefined`." + "Collection functions for manipulating the `list` data structures, a singly-linked list.\n\n**Prefer Array** if you need any of the following:\n\n- Random access of element\n- Better interop with JavaScript\n- Better memory usage & performance." ], - "signature": "type t<'a> = Js.Nullable.t<'a> =\n | Value('a)\n | Null\n | Undefined" + "signature": "type t<'a> = list<'a>" }, { - "id": "Core.Nullable.null", + "id": "Stdlib.List.length", "kind": "value", - "name": "null", + "name": "length", "docstrings": [ - "The value `null`.\n\nSee [`null`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/null) on MDN.\n\n## Examples\n```rescript\nConsole.log(Nullable.null) // Logs `null` to the console.\n```" + "`length(list)` returns the length of `list`.\n\n## Examples\n\n```rescript\nassertEqual(List.length(list{1, 2, 3}), 3)\n```" ], - "signature": "let null: t<'a>" + "signature": "let length: list<'a> => int" }, { - "id": "Core.Nullable.undefined", + "id": "Stdlib.List.size", "kind": "value", - "name": "undefined", + "name": "size", "docstrings": [ - "The value `undefined`.\n\nSee [`undefined`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/undefined) on MDN.\n\n## Examples\n```rescript\nConsole.log(undefined) // Logs `undefined` to the console.\n```" + "`size(list)`. See [`length`](#length)\n\n## Examples\n\n```rescript\nassertEqual(List.size(list{1, 2, 3}), 3)\n```" ], - "signature": "let undefined: t<'a>" + "signature": "let size: list<'a> => int" }, { - "id": "Core.Nullable.isNullable", + "id": "Stdlib.List.head", "kind": "value", - "name": "isNullable", + "name": "head", "docstrings": [ - "`isNullable(a)` returns `true` if `a` is null or undefined, `false` otherwise.\n\n## Examples\n\n```rescript\nlet myStr = \"Hello\"\nlet asNullable = myStr->Nullable.make\n\n// Can't do the below because we're now forced to check for nullability\n// myStr == asNullable\n\n// Check if asNullable is not null or undefined\nswitch asNullable->Nullable.isNullable {\n| true => assert(false)\n| false => assert(true)\n}\n```" + "`head(list)` returns `Some(value)` where `value` is the first element in the\nlist, or `None` if `list` is an empty list.\n\n## Examples\n\n```rescript\nassertEqual(List.head(list{}), None)\nassertEqual(List.head(list{1, 2, 3}), Some(1))\n```" ], - "signature": "let isNullable: t<'a> => bool" + "signature": "let head: list<'a> => option<'a>" }, { - "id": "Core.Nullable.make", + "id": "Stdlib.List.headExn", "kind": "value", - "name": "make", + "name": "headExn", "docstrings": [ - "Creates a new nullable value from the provided value.\nThis means the compiler will enforce null checks for the new value.\n\n## Examples\n```rescript\nlet myStr = \"Hello\"\nlet asNullable = myStr->Nullable.make\n\n// Can't do the below because we're now forced to check for nullability\n// myStr == asNullable\n\n// Need to do this\nswitch asNullable->Nullable.toOption {\n| Some(value) if value == myStr => Console.log(\"Yay, values matched!\")\n| _ => Console.log(\"Values did not match.\")\n}\n```" + "`headExn(list)` same as [`head`](#head).\n\n## Examples\n\n```rescript\nList.headExn(list{1, 2, 3})->assertEqual(1)\n\nswitch List.headExn(list{}) {\n| exception Not_found => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Raises an Error if list is empty." ], - "signature": "let make: 'a => t<'a>" + "signature": "let headExn: list<'a> => 'a" }, { - "id": "Core.Nullable.equal", + "id": "Stdlib.List.tail", "kind": "value", - "name": "equal", - "docstrings": [], - "signature": "let equal: (t<'a>, t<'b>, ('a, 'b) => bool) => bool" + "name": "tail", + "docstrings": [ + "`tail(list)` returns `None` if `list` is empty, otherwise it returns `Some(tail)`\nwhere `tail` is everything except the first element of `list`.\n\n## Examples\n\n```rescript\nassertEqual(List.tail(list{1, 2, 3}), Some(list{2, 3}))\n\nassertEqual(List.tail(list{}), None)\n```" + ], + "signature": "let tail: list<'a> => option>" }, { - "id": "Core.Nullable.compare", + "id": "Stdlib.List.tailExn", "kind": "value", - "name": "compare", - "docstrings": [], - "signature": "let compare: (\n t<'a>,\n t<'b>,\n ('a, 'b) => Core__Ordering.t,\n) => Core__Ordering.t" + "name": "tailExn", + "docstrings": [ + "`tailExn(list)` same as [`tail`](#tail).\n\n## Examples\n\n```rescript\nList.tailExn(list{1, 2, 3})->assertEqual(list{2, 3})\n\nswitch List.tailExn(list{}) {\n| exception Not_found => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Raises an Error if list is empty." + ], + "signature": "let tailExn: list<'a> => list<'a>" }, { - "id": "Core.Nullable.toOption", + "id": "Stdlib.List.add", "kind": "value", - "name": "toOption", + "name": "add", "docstrings": [ - "Converts a nullable value into an option, so it can be pattern matched on.\nWill convert both `null` and `undefined` to `None`, and a present value to `Some(value)`.\n\n## Examples\n```rescript\nlet nullableString = Nullable.make(\"Hello\")\n\nswitch nullableString->Nullable.toOption {\n| Some(str) => Console.log2(\"Got string:\", str)\n| None => Console.log(\"Didn't have a value.\")\n}\n```" + "`add(list, value)` adds a `value` to the beginning of list `list`.\n\n## Examples\n\n```rescript\nassertEqual(List.add(list{2, 3}, 1), list{1, 2, 3})\n\nassertEqual(List.add(list{\"World\", \"!\"}, \"Hello\"), list{\"Hello\", \"World\", \"!\"})\n```" ], - "signature": "let toOption: t<'a> => option<'a>" + "signature": "let add: (list<'a>, 'a) => list<'a>" }, { - "id": "Core.Nullable.fromOption", + "id": "Stdlib.List.get", "kind": "value", - "name": "fromOption", + "name": "get", "docstrings": [ - "Turns an `option` into a `Nullable.t`.\n\n## Examples\n```rescript\nlet optString = Some(\"Hello\")\nlet asNullable = optString->Nullable.fromOption // Nullable.t\n```" + "`get(list, index)` return the `index` element in `list`, or `None` if `index`\nis larger than the length of list `list`.\n\n## Examples\n\n```rescript\nlet abc = list{\"A\", \"B\", \"C\"}\n\nassertEqual(abc->List.get(1), Some(\"B\"))\n\nassertEqual(abc->List.get(4), None)\n```" ], - "signature": "let fromOption: option<'a> => t<'a>" + "signature": "let get: (list<'a>, int) => option<'a>" }, { - "id": "Core.Nullable.getOr", + "id": "Stdlib.List.getExn", "kind": "value", - "name": "getOr", + "name": "getExn", "docstrings": [ - "`getOr(value, default)` returns `value` if not `null` or `undefined`,\notherwise return `default`.\n\n## Examples\n\n```rescript\nNullable.getOr(Nullable.null, \"Banana\") // Banana\nNullable.getOr(Nullable.make(\"Apple\"), \"Banana\") // Apple\n\nlet greet = (firstName: option) =>\n \"Greetings \" ++ firstName->Option.getOr(\"Anonymous\")\n\nNullable.make(\"Jane\")->Nullable.toOption->greet // \"Greetings Jane\"\nNullable.null->Nullable.toOption->greet // \"Greetings Anonymous\"\n```" + "`getExn(list, index)` same as [`get`](#get).\n\n## Examples\n\n```rescript\nlet abc = list{\"A\", \"B\", \"C\"}\n\nabc\n->List.getExn(1)\n->assertEqual(\"B\")\n\nswitch abc->List.getExn(4) {\n| exception Not_found => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Raises an Error if `index` is larger than the length of list." ], - "signature": "let getOr: (t<'a>, 'a) => 'a" + "signature": "let getExn: (list<'a>, int) => 'a" }, { - "id": "Core.Nullable.getWithDefault", + "id": "Stdlib.List.make", "kind": "value", - "name": "getWithDefault", - "docstrings": [], - "signature": "let getWithDefault: (t<'a>, 'a) => 'a", - "deprecated": "Use getOr instead" + "name": "make", + "docstrings": [ + "`make(length, value)` returns a list of length `length` with each element filled\nwith `value`. Returns an empty list if `value` is negative.\n\n## Examples\n\n```rescript\nassertEqual(List.make(~length=3, 1), list{1, 1, 1})\n```" + ], + "signature": "let make: (~length: int, 'a) => list<'a>" }, { - "id": "Core.Nullable.getExn", + "id": "Stdlib.List.fromInitializer", "kind": "value", - "name": "getExn", + "name": "fromInitializer", "docstrings": [ - "`getExn(value)` raises an exception if `null` or `undefined`, otherwise returns the value.\n\n```rescript\nNullable.getExn(Nullable.make(3)) // 3\nNullable.getExn(Nullable.null) /* Raises an Error */\n```\n\n## Exceptions\n\n- Raises `Invalid_argument` if `value` is `null` or `undefined`" + "`fromInitializer(length, f)` return a list of length `length` with element initialized\nwith `f`. Returns an empty list if `length` is negative.\n\n## Examples\n\n```rescript\nassertEqual(List.fromInitializer(~length=5, i => i), list{0, 1, 2, 3, 4})\n\nassertEqual(List.fromInitializer(~length=5, i => i * i), list{0, 1, 4, 9, 16})\n```" ], - "signature": "let getExn: t<'a> => 'a" + "signature": "let fromInitializer: (~length: int, int => 'a) => list<'a>" }, { - "id": "Core.Nullable.getUnsafe", + "id": "Stdlib.List.shuffle", "kind": "value", - "name": "getUnsafe", + "name": "shuffle", "docstrings": [ - "`getUnsafe(value)` returns `value`.\n\n## Examples\n\n```rescript\nNullable.getUnsafe(Nullable.make(3)) == 3\nNullable.getUnsafe(Nullable.null) // Raises an error\n```\n\n## Important\n\n- This is an unsafe operation, it assumes `value` is not `null` or `undefined`." + "`shuffle(list)` returns a new list in random order.\n\n## Examples\n\n```rescript\nList.shuffle(list{1, 2, 3}) // list{2, 1, 3}\n```" ], - "signature": "let getUnsafe: t<'a> => 'a" + "signature": "let shuffle: list<'a> => list<'a>" }, { - "id": "Core.Nullable.forEach", + "id": "Stdlib.List.toShuffled", "kind": "value", - "name": "forEach", + "name": "toShuffled", "docstrings": [ - "`forEach(value, f)` call `f` on `value`. if `value` is not `null` or `undefined`, \nthen if calls `f`, otherwise returns `unit`.\n\n## Examples\n\n```rescript\nNullable.forEach(Nullable.make(\"thing\"), x => Console.log(x)) // logs \"thing\"\nNullable.forEach(Nullable.null, x => Console.log(x)) // returns ()\nNullable.forEach(undefined, x => Console.log(x)) // returns ()\n```" + "`toShuffled(list)` returns a new list in random order.\n\n## Examples\n\n```rescript\nList.toShuffled(list{1, 2, 3}) // list{2, 1, 3}\n```" ], - "signature": "let forEach: (t<'a>, 'a => unit) => unit" + "signature": "let toShuffled: list<'a> => list<'a>", + "deprecated": "Use `shuffle` instead" }, { - "id": "Core.Nullable.map", + "id": "Stdlib.List.drop", "kind": "value", - "name": "map", + "name": "drop", "docstrings": [ - "`map(value, f)` returns `f(value)` if `value` is not `null` or `undefined`,\notherwise returns `value` unchanged.\n\n## Examples\n\n```rescript\nNullable.map(Nullable.make(3), x => x * x) // Nullable.make(9)\nNullable.map(undefined, x => x * x) // undefined\n```" + "`drop(list, value)` return a new list, dropping the first `value` element.\nReturns `None` if `list` has fewer than `value` elements.\n\n## Examples\n\n```rescript\nassertEqual(list{1, 2, 3}->List.drop(2), Some(list{3}))\n\nassertEqual(list{1, 2, 3}->List.drop(3), Some(list{}))\n\nassertEqual(list{1, 2, 3}->List.drop(4), None)\n```" ], - "signature": "let map: (t<'a>, 'a => 'b) => t<'b>" + "signature": "let drop: (list<'a>, int) => option>" }, { - "id": "Core.Nullable.mapOr", + "id": "Stdlib.List.take", "kind": "value", - "name": "mapOr", + "name": "take", "docstrings": [ - "`mapOr(value, default, f)` returns `f(value)` if `value` is not `null`\nor `undefined`, otherwise returns `default`.\n\n## Examples\n\n```rescript\nlet someValue = Nullable.make(3)\nsomeValue->Nullable.mapOr(0, x => x + 5) // 8\n\nlet noneValue = Nullable.null\nnoneValue->Nullable.mapOr(0, x => x + 5) // 0\n```" + "`take(list, value)` returns a list with the first `value` elements from `list`,\nor `None` if `list` has fewer than `value` elements.\n\n## Examples\n\n```rescript\nassertEqual(list{1, 2, 3}->List.take(1), Some(list{1}))\n\nassertEqual(list{1, 2, 3}->List.take(2), Some(list{1, 2}))\n\nassertEqual(list{1, 2, 3}->List.take(4), None)\n```" ], - "signature": "let mapOr: (t<'a>, 'b, 'a => 'b) => 'b" + "signature": "let take: (list<'a>, int) => option>" }, { - "id": "Core.Nullable.mapWithDefault", + "id": "Stdlib.List.splitAt", "kind": "value", - "name": "mapWithDefault", - "docstrings": [], - "signature": "let mapWithDefault: (t<'a>, 'b, 'a => 'b) => 'b", - "deprecated": "Use mapOr instead" + "name": "splitAt", + "docstrings": [ + "`splitAt(list, n)` split the list `list` at `n`. Returns `None` when the length\nof `list` is less than `n`.\n\n## Examples\n\n```rescript\nassertEqual(list{\"Hello\", \"World\"}->List.splitAt(1), Some((list{\"Hello\"}, list{\"World\"})))\n\nassertEqual(list{0, 1, 2, 3, 4}->List.splitAt(2), Some((list{0, 1}, list{2, 3, 4})))\n```" + ], + "signature": "let splitAt: (list<'a>, int) => option<(list<'a>, list<'a>)>" }, { - "id": "Core.Nullable.flatMap", + "id": "Stdlib.List.concat", "kind": "value", - "name": "flatMap", + "name": "concat", "docstrings": [ - "`flatMap(value, f)` returns `f(value)` if `value` is not `null` or `undefined`,\notherwise returns `value` unchanged.\n\n## Examples\n\n```rescript\nlet addIfAboveOne = value =>\n if (value > 1) {\n Nullable.make(value + 1)\n } else {\n Nullable.null\n }\n\nNullable.flatMap(Nullable.make(2), addIfAboveOne) // Nullable.make(3)\nNullable.flatMap(Nullable.make(-4), addIfAboveOne) // undefined\nNullable.flatMap(Nullable.null, addIfAboveOne) // undefined\n```" + "`concat(list1, list2)` returns the list obtained by adding `list2` after `list1`.\n\n## Examples\n\n```rescript\nList.concat(list{1, 2, 3}, list{4, 5})->assertEqual(list{1, 2, 3, 4, 5})\n```" ], - "signature": "let flatMap: (t<'a>, 'a => t<'b>) => t<'b>" - } - ] - }, - "core/null": { - "id": "Core.Null", - "name": "Null", - "docstrings": [ - "Functions for handling values that could be `null`.\n\nIf you also need to cover `undefined`, check out `Nullable` instead." - ], - "items": [ + "signature": "let concat: (list<'a>, list<'a>) => list<'a>" + }, { - "id": "Core.Null.t", - "kind": "type", - "name": "t", + "id": "Stdlib.List.concatMany", + "kind": "value", + "name": "concatMany", "docstrings": [ - "A type representing a value that can be either `'a` or `null`." + "`concatMany(arr)` returns the list obtained by concatenating all the lists in\narray `arr`, in order.\n\n## Examples\n\n```rescript\nassertEqual(List.concatMany([list{1, 2, 3}, list{}, list{3}]), list{1, 2, 3, 3})\n```" ], - "signature": "type t<'a> = Js.Null.t<'a> = Value('a) | Null" + "signature": "let concatMany: array> => list<'a>" }, { - "id": "Core.Null.asNullable", + "id": "Stdlib.List.reverseConcat", "kind": "value", - "name": "asNullable", + "name": "reverseConcat", "docstrings": [ - "Converts a `Null.t` into a `Nullable.t`.\n\n## Examples\n```rescript\nlet nullValue = Null.make(\"Hello\")\nlet asNullable = nullValue->Null.asNullable // Nullable.t\n```" + "`reverseConcat(list1, list2)` is equivalent to writing: `concat(reverse(list1, list2)`\n\n## Examples\n\n```rescript\nassertEqual(List.reverseConcat(list{1, 2}, list{3, 4}), list{2, 1, 3, 4})\n```" ], - "signature": "let asNullable: t<'a> => Core__Nullable.t<'a>" + "signature": "let reverseConcat: (list<'a>, list<'a>) => list<'a>" }, { - "id": "Core.Null.null", + "id": "Stdlib.List.flat", "kind": "value", - "name": "null", + "name": "flat", "docstrings": [ - "The value `null`.\n\nSee [`null`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/null) on MDN.\n\n## Examples\n```rescript\nConsole.log(null) // Logs `null` to the console.\n```" + "`flat(list)` return the list obtained by concatenating all the lists in\n`list`, in order.\n\n## Examples\n\n```rescript\nassertEqual(List.flat(list{list{1, 2, 3}, list{}, list{3}}), list{1, 2, 3, 3})\n```" ], - "signature": "let null: t<'a>" + "signature": "let flat: list> => list<'a>" }, { - "id": "Core.Null.make", + "id": "Stdlib.List.map", "kind": "value", - "name": "make", + "name": "map", "docstrings": [ - "Creates a new `Null.t` from the provided value.\nThis means the compiler will enforce null checks for the new value.\n\n## Examples\n```rescript\nlet myStr = \"Hello\"\nlet asNullValue = myStr->Null.make // The compiler now thinks this can be `string` or `null`.\n```" + "`map(list, f)` returns a new list with `f` applied to each element of `list`.\n\n## Examples\n\n```rescript\nassertEqual(list{1, 2}->List.map(x => x + 1), list{2, 3})\n```" ], - "signature": "let make: 'a => t<'a>" + "signature": "let map: (list<'a>, 'a => 'b) => list<'b>" }, { - "id": "Core.Null.equal", + "id": "Stdlib.List.zip", "kind": "value", - "name": "equal", - "docstrings": [], - "signature": "let equal: (t<'a>, t<'b>, ('a, 'b) => bool) => bool" + "name": "zip", + "docstrings": [ + "`zip(list1, list2)` returns a list of pairs from the two lists with the length\nof the shorter list.\n\n## Examples\n\n```rescript\nassertEqual(List.zip(list{1, 2}, list{3, 4, 5}), list{(1, 3), (2, 4)})\n```" + ], + "signature": "let zip: (list<'a>, list<'b>) => list<('a, 'b)>" }, { - "id": "Core.Null.compare", + "id": "Stdlib.List.zipBy", "kind": "value", - "name": "compare", - "docstrings": [], - "signature": "let compare: (\n t<'a>,\n t<'b>,\n ('a, 'b) => Core__Ordering.t,\n) => Core__Ordering.t" + "name": "zipBy", + "docstrings": [ + "`zipBy(list1, list2, f)`. See [`zip`](#zip)\n\n## Examples\n\n```rescript\nassertEqual(List.zipBy(list{1, 2, 3}, list{4, 5}, (a, b) => 2 * a + b), list{6, 9})\n```" + ], + "signature": "let zipBy: (list<'a>, list<'b>, ('a, 'b) => 'c) => list<'c>" }, { - "id": "Core.Null.toOption", + "id": "Stdlib.List.mapWithIndex", "kind": "value", - "name": "toOption", + "name": "mapWithIndex", "docstrings": [ - "Converts a nullable value into an option, so it can be pattern matched on.\nWill convert `null` to `None`, and a present value to `Some(value)`.\n\n## Examples\n```rescript\nlet nullStr = Null.make(\"Hello\")\n\nswitch nullStr->Null.toOption {\n| Some(str) => Console.log2(\"Got string:\", str)\n| None => Console.log(\"Didn't have a value.\")\n}\n```" + "`mapWithIndex(list, f)` applies `f` to each element of `list`. Function `f`\ntakes two arguments: the index starting from 0 and the element from `list`, in\nthat order.\n\n## Examples\n\n```rescript\nassertEqual(list{1, 2, 3}->List.mapWithIndex((x, index) => index + x), list{1, 3, 5})\n```" ], - "signature": "let toOption: t<'a> => option<'a>" + "signature": "let mapWithIndex: (list<'a>, ('a, int) => 'b) => list<'b>" }, { - "id": "Core.Null.fromOption", + "id": "Stdlib.List.fromArray", "kind": "value", - "name": "fromOption", + "name": "fromArray", "docstrings": [ - "Turns an `option` into a `Null.t`. `None` will be converted to `null`.\n\n## Examples\n```rescript\nlet optString: option = None\nlet asNull = optString->Null.fromOption // Null.t\nConsole.log(asNull == Null.null) // Logs `true` to the console.\n```" + "`fromArray(arr)` converts the given array `arr` to a list.\n\n## Examples\n\n```rescript\nassertEqual(List.fromArray([1, 2, 3]), list{1, 2, 3})\n```" ], - "signature": "let fromOption: option<'a> => t<'a>" + "signature": "let fromArray: array<'a> => list<'a>" }, { - "id": "Core.Null.getOr", + "id": "Stdlib.List.toArray", "kind": "value", - "name": "getOr", + "name": "toArray", "docstrings": [ - "`getOr(value, default)` returns `value` if not `null`, otherwise return\n`default`.\n\n## Examples\n\n```rescript\nNull.getOr(Null.null, \"Banana\") // Banana\nNull.getOr(Null.make(\"Apple\"), \"Banana\") // Apple\n\nlet greet = (firstName: option) =>\n \"Greetings \" ++ firstName->Option.getOr(\"Anonymous\")\n\nNull.make(\"Jane\")->Null.toOption->greet // \"Greetings Jane\"\nNull.null->Null.toOption->greet // \"Greetings Anonymous\"\n```" + "`toArray(list)` converts the given list `list` to an array.\n\n## Examples\n\n```rescript\nassertEqual(List.toArray(list{1, 2, 3}), [1, 2, 3])\n```" ], - "signature": "let getOr: (t<'a>, 'a) => 'a" + "signature": "let toArray: list<'a> => array<'a>" }, { - "id": "Core.Null.getWithDefault", + "id": "Stdlib.List.reverse", "kind": "value", - "name": "getWithDefault", - "docstrings": [], - "signature": "let getWithDefault: (t<'a>, 'a) => 'a", - "deprecated": "Use getOr instead" + "name": "reverse", + "docstrings": [ + "`reverse(list)` returns a new list whose elements are those of `list` in\nreversed order.\n\n## Examples\n\n```rescript\nassertEqual(List.reverse(list{1, 2, 3}), list{3, 2, 1})\n```" + ], + "signature": "let reverse: list<'a> => list<'a>" }, { - "id": "Core.Null.getExn", + "id": "Stdlib.List.mapReverse", "kind": "value", - "name": "getExn", + "name": "mapReverse", "docstrings": [ - "`getExn(value)` raises an exception if `null`, otherwise returns the value.\n\n```rescript\nNull.getExn(Null.make(3)) // 3\nNull.getExn(Null.null) /* Raises an Error */\n```\n\n## Exceptions\n\n- Raises `Invalid_argument` if `value` is `null`," + "`mapReverse(list, f)` is equivalent to `map` function.\n\n## Examples\n\n```rescript\nlet f = x => x * x\nlet l = list{3, 4, 5}\n\nlet withMap = List.map(l, f)->List.reverse\nlet withMapReverse = l->List.mapReverse(f)\n\nConsole.log(withMap == withMapReverse) // true\n```" ], - "signature": "let getExn: t<'a> => 'a" + "signature": "let mapReverse: (list<'a>, 'a => 'b) => list<'b>" }, { - "id": "Core.Null.getUnsafe", + "id": "Stdlib.List.forEach", "kind": "value", - "name": "getUnsafe", + "name": "forEach", "docstrings": [ - "`getUnsafe(value)` returns `value`.\n\n## Examples\n\n```rescript\nNull.getUnsafe(Null.make(3)) == 3\nNull.getUnsafe(Null.null) // Raises an error\n```\n\n## Important\n\n- This is an unsafe operation, it assumes `value` is not `null`." + "`forEach(list, f)` call `f` on each element of `list` from the beginning to end.\n`f` returns `unit`, so no new array is created. Use `forEach` when you are primarily\nconcerned with repetitively creating side effects.\n\n## Examples\n\n```rescript\nList.forEach(list{\"a\", \"b\", \"c\"}, x => Console.log(\"Item: \" ++ x))\n/*\n prints:\n Item: a\n Item: b\n Item: c\n*/\n```" ], - "signature": "let getUnsafe: t<'a> => 'a" + "signature": "let forEach: (list<'a>, 'a => unit) => unit" }, { - "id": "Core.Null.forEach", + "id": "Stdlib.List.forEachWithIndex", "kind": "value", - "name": "forEach", + "name": "forEachWithIndex", "docstrings": [ - "`forEach(value, f)` call `f` on `value`. if `value` is not `null`, then if calls\n`f`, otherwise returns `unit`.\n\n## Examples\n\n```rescript\nNull.forEach(Null.make(\"thing\"), x => Console.log(x)) // logs \"thing\"\nNull.forEach(Null.null, x => Console.log(x)) // logs nothing\n```" + "`forEachWithIndex(list, f, index)` call `f` on each element of `list` from beginning\nto end. Function `f` takes two arguments: the `index` starting from 0 and the\nelement from `list`. `f` returns `unit`.\n\n## Examples\n\n```rescript\nList.forEachWithIndex(list{\"a\", \"b\", \"c\"}, (x, index) => {\n Console.log(\"Item \" ++ Int.toString(index) ++ \" is \" ++ x)\n})\n/*\n prints:\n Item 0 is a\n Item 1 is b\n Item 2 is cc\n*/\n```" ], - "signature": "let forEach: (t<'a>, 'a => unit) => unit" + "signature": "let forEachWithIndex: (list<'a>, ('a, int) => unit) => unit" }, { - "id": "Core.Null.map", + "id": "Stdlib.List.reduce", "kind": "value", - "name": "map", + "name": "reduce", "docstrings": [ - "`map(value, f)` returns `f(value)` if `value` is not `null`, otherwise returns\n`value` unchanged.\n\n## Examples\n\n```rescript\nNull.map(Null.make(3), x => x * x) // Null.make(9)\nNull.map(Null.null, x => x * x) // null\n```" + "`reduce(list, initialValue, f)` applies `f` to each element of `list` from\nbeginning to end. Function `f` has two parameters: the item from the list and\nan \"accumulator\", which starts with a value of `initialValue`. `reduce` returns\nthe final value of the accumulator.\n\n## Examples\n\n```rescript\nassertEqual(list{1, 2, 3, 4}->List.reduce(0, (a, b) => a + b), 10)\n\n// same as\n\nassertEqual(list{1, 2, 3, 4}->List.reduce(0, (acc, item) => acc + item), 10)\n```" ], - "signature": "let map: (t<'a>, 'a => 'b) => t<'b>" + "signature": "let reduce: (list<'a>, 'b, ('b, 'a) => 'b) => 'b" }, { - "id": "Core.Null.mapOr", + "id": "Stdlib.List.reduceWithIndex", "kind": "value", - "name": "mapOr", + "name": "reduceWithIndex", "docstrings": [ - "`mapOr(value, default, f)` returns `f(value)` if `value` is not `null`,\notherwise returns `default`.\n\n## Examples\n\n```rescript\nlet someValue = Null.make(3)\nsomeValue->Null.mapOr(0, x => x + 5) // 8\n\nlet noneValue = Null.null\nnoneValue->Null.mapOr(0, x => x + 5) // 0\n```" + "`reduceWithIndex(list, initialValue, f)` applies `f` to each element of `list`\nfrom beginning to end. Function `f` has three parameters: the item from the list\nand an \"accumulator\", which starts with a value of `initialValue` and the index\nof each element. `reduceWithIndex` returns the final value of the accumulator.\n\n## Examples\n\n```rescript\nassertEqual(list{1, 2, 3, 4}->List.reduceWithIndex(0, (acc, item, index) => acc + item + index), 16)\n```" ], - "signature": "let mapOr: (t<'a>, 'b, 'a => 'b) => 'b" + "signature": "let reduceWithIndex: (list<'a>, 'b, ('b, 'a, int) => 'b) => 'b" }, { - "id": "Core.Null.mapWithDefault", + "id": "Stdlib.List.reduceReverse", "kind": "value", - "name": "mapWithDefault", - "docstrings": [], - "signature": "let mapWithDefault: (t<'a>, 'b, 'a => 'b) => 'b", - "deprecated": "Use mapOr instead" + "name": "reduceReverse", + "docstrings": [ + "`reduceReverse(list, initialValue, f)` works like `reduce`, except that\nfunction `f` is applied to each item of `list` from the last back to the first.\n\n## Examples\n\n```rescript\nassertEqual(list{1, 2, 3, 4}->List.reduceReverse(0, (a, b) => a + b), 10)\n\nassertEqual(list{1, 2, 3, 4}->List.reduceReverse(10, (a, b) => a - b), 0)\n\nassertEqual(list{1, 2, 3, 4}->List.reduceReverse(list{}, List.add), list{1, 2, 3, 4})\n```" + ], + "signature": "let reduceReverse: (list<'a>, 'b, ('b, 'a) => 'b) => 'b" }, { - "id": "Core.Null.flatMap", + "id": "Stdlib.List.mapReverse2", "kind": "value", - "name": "flatMap", + "name": "mapReverse2", "docstrings": [ - "`flatMap(value, f)` returns `f(value)` if `value` is not `null`, otherwise\nreturns `value` unchanged.\n\n## Examples\n\n```rescript\nlet addIfAboveOne = value =>\n if (value > 1) {\n Null.make(value + 1)\n } else {\n Null.null\n }\n\nNull.flatMap(Null.make(2), addIfAboveOne) // Null.make(3)\nNull.flatMap(Null.make(-4), addIfAboveOne) // null\nNull.flatMap(Null.null, addIfAboveOne) // null\n```" + "`mapReverse2(list1, list2, f)` is equivalent to `List.zipBy(list1, list2, f)->List.reverse`.\n\n## Examples\n\n```rescript\nassertEqual(List.mapReverse2(list{1, 2, 3}, list{1, 2}, (a, b) => a + b), list{4, 2})\n```" ], - "signature": "let flatMap: (t<'a>, 'a => t<'b>) => t<'b>" - } - ] - }, - "core/math": { - "id": "Core.Math", - "name": "Math", - "docstrings": [ - "Functions for interacting with JavaScript Math.\nSee: [`Math`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math)." - ], - "items": [ + "signature": "let mapReverse2: (list<'a>, list<'b>, ('a, 'b) => 'c) => list<'c>" + }, + { + "id": "Stdlib.List.forEach2", + "kind": "value", + "name": "forEach2", + "docstrings": [ + "`forEach2(list1, list2, f)` is similar to `forEach`, but accepts two lists and\nstops at the length of the shorter list.\n\n## Examples\n\n```rescript\nList.forEach2(list{\"Z\", \"Y\"}, list{\"A\", \"B\", \"C\"}, (x, y) => Console.log2(x, y))\n\n/*\n prints:\n \"Z\" \"A\"\n \"Y\" \"B\"\n*/\n```" + ], + "signature": "let forEach2: (list<'a>, list<'b>, ('a, 'b) => 'c) => unit" + }, + { + "id": "Stdlib.List.reduce2", + "kind": "value", + "name": "reduce2", + "docstrings": [ + "`reduce2(list1, list2, initialValue, f)` applies `f` to each element of `list1`\nand `list2` from beginning to end. Stops with the shorter list. Function `f` has\nthree parameters: an accumulator which starts with a value of `initialValue`, an\nitem from `l1`, and an item from `l2`. `reduce2` returns the final value of the\naccumulator.\n\n## Examples\n\n```rescript\nassertEqual(\n 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: (list<'b>, list<'c>, 'a, ('a, 'b, 'c) => 'a) => 'a" + }, + { + "id": "Stdlib.List.reduceReverse2", + "kind": "value", + "name": "reduceReverse2", + "docstrings": [ + "`reduceReverse2(list1, list2, initialValue, f)` applies `f` to each element of\n`list1` and `list2`from end to beginning. Stops with the shorter list. Function\n`f` has three parameters: an accumulator which starts with a value of\n`initialValue`, an item from `l1`, and an item from `l2`. `reduce2` returns the\nfinal value of the accumulator.\n\n## Examples\n\n```rescript\nassertEqual(\n 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: (list<'a>, list<'b>, 'c, ('c, 'a, 'b) => 'c) => 'c" + }, + { + "id": "Stdlib.List.every", + "kind": "value", + "name": "every", + "docstrings": [ + "`every(list, f)` returns `true` if all elements in `list` satisfy `f`, where `f`\nis 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}->List.every(isBelow10), true)\n\nassertEqual(list{1, 99, 8, 2}->List.every(isBelow10), false)\n```" + ], + "signature": "let every: (list<'a>, 'a => bool) => bool" + }, { - "id": "Core.Math.abs", + "id": "Stdlib.List.some", "kind": "value", - "name": "abs", + "name": "some", "docstrings": [ - "`abs(v)` returns absolute value of `v`.\nSee [`Math.abs`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/abs) on MDN.\n\n## Examples\n\n```rescript\nMath.abs(-2.0) // 2.0\nMath.abs(3.0) // 3.0\n```" + "`some(list, f)` returns `true` if at least _one_ of the elements in `list`\nsatisfies `f`, where `f` 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}->List.some(isAbove100), true)\n\nassertEqual(list{1, 2, 3, 4}->List.some(isAbove100), false)\n```" ], - "signature": "let abs: float => float" + "signature": "let some: (list<'a>, 'a => bool) => bool" }, { - "id": "Core.Math.acos", + "id": "Stdlib.List.every2", "kind": "value", - "name": "acos", + "name": "every2", "docstrings": [ - "`acos(v)` returns arccosine (in radians) of argument `v`, returns `NaN` if the\nargument is outside the range [-1.0, 1.0].\nSee [`Math.acos`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/acos) on MDN.\n\n## Examples\n\n```rescript\nMath.acos(-1.0) // 3.141592653589793\nMath.acos(-3.0)->Float.isNaN // true\n```" + "`every2(list1, list2, f)` returns `true` if predicate `f` is `true` for all\npairs of elements up to the shorter length (i.e. `min(length(list1), length(list2))`)\n\n## Examples\n\n```rescript\nassertEqual(List.every2(list{1, 2, 3}, list{0, 1}, (a, b) => a > b), true)\n\nassertEqual(List.every2(list{}, list{1}, (a, b) => a > b), true)\n\nassertEqual(List.every2(list{2, 3}, list{1}, (a, b) => a > b), true)\n\nassertEqual(List.every2(list{0, 1}, list{5, 0}, (a, b) => a > b), false)\n```" ], - "signature": "let acos: float => float" + "signature": "let every2: (list<'a>, list<'b>, ('a, 'b) => bool) => bool" }, { - "id": "Core.Math.acosh", + "id": "Stdlib.List.some2", "kind": "value", - "name": "acosh", + "name": "some2", "docstrings": [ - "`acosh(v)` returns the inverse hyperbolic arccosine (in radians) of argument `v`,\nreturns `NaN` if the argument is less than `1.0`.\nSee [`Math.acosh`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/acosh) on MDN.\n\n## Examples\n\n```rescript\nMath.acosh(1.0) // 0.0\nMath.acosh(0.5)->Float.isNaN // true\n```" + "`some2(list1, list2, f)` returns `true` if predicate `f` is `true` for any pair\nof elements up to the shorter length (i.e. `min(length(list1), length(list2))`)\n\n## Examples\n\n```rescript\nassertEqual(List.some2(list{1, 2, 3}, list{0, 1}, (a, b) => a > b), true)\n\nassertEqual(List.some2(list{}, list{1}, (a, b) => a > b), false)\n\nassertEqual(List.some2(list{2, 3}, list{1}, (a, b) => a > b), true)\n\nassertEqual(List.some2(list{0, 1}, list{5, 0}, (a, b) => a > b), true)\n```" ], - "signature": "let acosh: float => float" + "signature": "let some2: (list<'a>, list<'b>, ('a, 'b) => bool) => bool" }, { - "id": "Core.Math.asin", + "id": "Stdlib.List.compareLength", "kind": "value", - "name": "asin", + "name": "compareLength", "docstrings": [ - "`asin(v)` returns the inverse sine (in radians) of argument `v`, returns `NaN`\nif the argument `v` is outside the range [-1.0, 1.0].\nSee [`Math.asin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/asin) on MDN.\n\n## Examples\n\n```rescript\nMath.asin(-1.0) // -1.5707963267948966\nMath.asin(-2.0)->Float.isNaN // true\n```" + "`compareLength(list1, list2)` compare two lists solely by length. Returns `-1.` if\n`length(list1)` is less than `length(list2)`, `0.` if `length(list1)` equals\n`length(list2)`, and `1.` if `length(list1)` is greater than `length(list2)`.\n\n## Examples\n\n```rescript\nassertEqual(List.compareLength(list{1, 2}, list{3, 4, 5, 6}), -1.)\n\nassertEqual(List.compareLength(list{1, 2, 3}, list{4, 5, 6}), 0.)\n\nassertEqual(List.compareLength(list{1, 2, 3, 4}, list{5, 6}), 1.)\n```" ], - "signature": "let asin: float => float" + "signature": "let compareLength: (list<'a>, list<'a>) => Ordering.t" }, { - "id": "Core.Math.asinh", + "id": "Stdlib.List.compare", "kind": "value", - "name": "asinh", + "name": "compare", "docstrings": [ - "`asinh(v)` returns the inverse hyperbolic sine of argument `v`.\nSee [`Math.asinh`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/asinh) on MDN.\n\n## Examples\n\n```rescript\nMath.asinh(-1.0) // -0.881373587019543\nMath.asinh(-0.0) // -0.0\n```" + "`compare(list1, list2, f)` compare elements one by one `f`. `f` returns a negative\nnumber if `list1` is \"less than\" `list2`, zero if `list1` is \"equal to\" `list2`,\na positive number if `list1` is \"greater than\" `list2`.\n\nThe comparison returns the first non-zero result of `f`, or zero if `f` returns\nzero for all `list1` and `list2`.\n\n- If all items have compared equal, but `list1` is exhausted first, return `-1.`. (`list1` is shorter).\n- If all items have compared equal, but `list2` is exhausted first, return `1.` (`list1` is longer).\n\n## Examples\n\n```rescript\nassertEqual(List.compare(list{3}, list{3, 7}, (a, b) => Int.compare(a, b)), -1.)\nassertEqual(List.compare(list{5, 3}, list{5}, (a, b) => Int.compare(a, b)), 1.)\nassertEqual(List.compare(list{1, 3, 5}, list{1, 4, 2}, (a, b) => Int.compare(a, b)), -1.)\nassertEqual(List.compare(list{1, 3, 5}, list{1, 2, 3}, (a, b) => Int.compare(a, b)), 1.)\nassertEqual(List.compare(list{1, 3, 5}, list{1, 3, 5}, (a, b) => Int.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 asinh: float => float" + "signature": "let compare: (\n list<'a>,\n list<'a>,\n ('a, 'a) => Ordering.t,\n) => Ordering.t" }, { - "id": "Core.Math.atan", + "id": "Stdlib.List.equal", "kind": "value", - "name": "atan", + "name": "equal", "docstrings": [ - "`atan(v)` returns the inverse tangent (in radians) of argument `v`.\nSee [`Math.atan`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/atan) on MDN.\n\n## Examples\n\n```rescript\nMath.atan(-0.0) // -0.0\nMath.atan(0.0) // 0.0\nMath.atan(1.0) // 0.7853981633974483\n```" + "`equal(list1, list2, f)` check equality of `list2` and `list2` using `f` for\nequality on elements, where `f` is a function that returns `true` if items `x` and\n`y` meet some criterion for equality, `false` otherwise. equal `false` if length\nof `list1` and `list2` are not the same.\n\n## Examples\n\n```rescript\nassertEqual(List.equal(list{1, 2, 3}, list{1, 2}, (a, b) => a == b), false)\n\nassertEqual(List.equal(list{1, 2}, list{1, 2}, (a, b) => a == b), true)\n\nassertEqual(List.equal(list{1, 2, 3}, list{(-1), (-2), (-3)}, (a, b) => abs(a) == abs(b)), true)\n```" ], - "signature": "let atan: float => float" + "signature": "let equal: (list<'a>, list<'a>, ('a, 'a) => bool) => bool" }, { - "id": "Core.Math.atanh", + "id": "Stdlib.List.has", "kind": "value", - "name": "atanh", + "name": "has", "docstrings": [ - "`atanh(v)` returns the invert hyperbolic tangent of argument `v`. Returns `NaN`\nif the argument `v` is is outside the range [-1.0, 1.0] and `Infinity` if `v`\nis `-1.0` or `1.0`.\nSee [`Math.atanh`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/atanh) on MDN.\n\n## Examples\n\n```rescript\nMath.atanh(-2.0)->Float.isNaN // true\nMath.atanh(-1.0)->Float.isFinite // false\nMath.atanh(-0.0) // -0.0\nMath.atanh(0.0) // 0.0\nMath.atanh(0.5) // 0.5493061443340548\n```" + "`has(list, element, f)` returns `true` if the list contains at least one\n`element` for which `f` returns `true'.\n\n## Examples\n\n```rescript\nassertEqual(list{1, 2, 3}->List.has(2, (a, b) => a == b), true)\n\nassertEqual(list{1, 2, 3}->List.has(4, (a, b) => a == b), false)\n\nassertEqual(list{(-1), (-2), (-3)}->List.has(2, (a, b) => abs(a) == abs(b)), true)\n```" ], - "signature": "let atanh: float => float" + "signature": "let has: (list<'a>, 'b, ('a, 'b) => bool) => bool" }, { - "id": "Core.Math.atan2", + "id": "Stdlib.List.find", "kind": "value", - "name": "atan2", + "name": "find", "docstrings": [ - "`atan2(~y, ~x)` returns the angle (in radians) of the quotient `y /. x`. It is\nalso the angle between the *x*-axis and point (*x*, *y*).\nSee [`Math.atan2`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/atan2) on MDN.\n\n## Examples\n\n```rescript\nMath.atan2(~y=0.0, ~x=10.0) == 0.0\nMath.atan2(~x=5.0, ~y=5.0) == Math.Constants.pi /. 4.0\nMath.atan2(~x=90.0, ~y=15.0) // 1.4056476493802699\nMath.atan2(~x=15.0, ~y=90.0) // 0.16514867741462683\n```" + "`find(list, f)` returns `Some(value)` for the first value in `list` that\nsatisfies the predicate function `f`. Returns `None` if no element satisfies\nthe function.\n\n## Examples\n\n```rescript\nassertEqual(List.find(list{1, 4, 3, 2}, x => x > 3), Some(4))\n\nassertEqual(List.find(list{1, 4, 3, 2}, x => x > 4), None)\n```" ], - "signature": "let atan2: (~y: float, ~x: float) => float" + "signature": "let find: (list<'a>, 'a => bool) => option<'a>" }, { - "id": "Core.Math.cbrt", + "id": "Stdlib.List.filter", "kind": "value", - "name": "cbrt", + "name": "filter", "docstrings": [ - "`cbrt(v)` returns the cube root of argument `v`.\nSee [`Math.cbrt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/cbrt) on MDN.\n\n## Examples\n\n```rescript\nMath.cbrt(-1.0) // -1.0\nMath.cbrt(-0.0) // -0.0\nMath.cbrt(0.0) // 0.0\n```" + "`filter(list, f)` returns a list of all elements in `list` which satisfy the\npredicate function `f`.\n\n## Examples\n\n```rescript\nlet isEven = x => mod(x, 2) == 0\n\nassertEqual(List.filter(list{1, 2, 3, 4}, isEven), list{2, 4})\n\nassertEqual(List.filter(list{None, Some(2), Some(3), None}, Option.isSome), list{Some(2), Some(3)})\n```" ], - "signature": "let cbrt: float => float" + "signature": "let filter: (list<'a>, 'a => bool) => list<'a>" }, { - "id": "Core.Math.ceil", + "id": "Stdlib.List.filterWithIndex", "kind": "value", - "name": "ceil", + "name": "filterWithIndex", "docstrings": [ - "`ceil(v)` returns the smallest integral value greater than or equal to the\nargument `v`. The result is a `float` and is not restricted to the `int` data\ntype range.\nSee [`Math.ceil`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/ceil) on MDN.\n\n## Examples\n\n```rescript\nMath.ceil(3.1) == 4.0\nMath.ceil(3.0) == 3.0\nMath.ceil(-3.1) == -3.0\nMath.ceil(2_150_000_000.3) == 2_150_000_001.0\n```" + "`filterWithIndex(list, f)` returns a list of all elements in `list` which\nsatisfy the predicate function `f`.\n\n## Examples\n\n```rescript\nlet isEven = x => mod(x, 2) == 0\n\nassertEqual(List.filterWithIndex(list{1, 2, 3, 4}, (_x, index) => isEven(index)), list{1, 3})\n```" ], - "signature": "let ceil: float => float" + "signature": "let filterWithIndex: (list<'a>, ('a, int) => bool) => list<'a>" }, { - "id": "Core.Math.cos", + "id": "Stdlib.List.filterMap", "kind": "value", - "name": "cos", + "name": "filterMap", "docstrings": [ - "`cos(v)` returns the cosine of argument `v`, which must be specified in radians.\nSee [`Math.cos`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/cos) on MDN.\n\n## Examples\n\n```rescript\nMath.cos(-0.0) // 1.0\nMath.cos(0.0) // 1.0\nMath.cos(1.0) // 0.5403023058681398\n```" + "`filterMap(list, f)` applies `f` to each element of `list`. If `f` returns\n`Some(value)`, then `value` is _kept_ in the resulting list. If `f` returns\n`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->List.filterMap(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}->List.filterMap(x => x), list{1, 2})\n```" ], - "signature": "let cos: float => float" + "signature": "let filterMap: (list<'a>, 'a => option<'b>) => list<'b>" }, { - "id": "Core.Math.cosh", + "id": "Stdlib.List.partition", "kind": "value", - "name": "cosh", + "name": "partition", "docstrings": [ - "`cosh(v)` returns the hyperbolic cosine of argument `v`, which must be specified\nin radians.\nSee [`Math.cosh`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/cosh) on MDN.\n\n## Examples\n\n```rescript\nMath.cosh(-1.0) // 1.5430806348152437\nMath.cosh(-0.0) // 1.0\nMath.cosh(0.0) // 1.0\n```" + "`partition(list, f)` creates a pair of lists; the first list consists of all\nelements of `list` that satisfy the predicate function `f`, the second list\nconsists of all elements of `list` that _do not_ satisfy `f`.\n\n## Examples\n\n```rescript\n// (elementsThatSatisfies, elementsThatDoesNotSatisfy)\n\nassertEqual(List.partition(list{1, 2, 3, 4}, x => x > 2), (list{3, 4}, list{1, 2}))\n```" ], - "signature": "let cosh: float => float" + "signature": "let partition: (list<'a>, 'a => bool) => (list<'a>, list<'a>)" }, { - "id": "Core.Math.exp", + "id": "Stdlib.List.unzip", "kind": "value", - "name": "exp", + "name": "unzip", "docstrings": [ - "`exp(v)` returns natural exponentional, returns *e* (the base of natural logarithms)\nto the power of the given argument `v`.\nSee [`Math.exp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/exp) on MDN.\n\n## Examples\n\n```rescript\nMath.exp(-1.0) // 0.36787944117144233\nMath.exp(0.0) // 1.0\n```" + "`unzip(list)` takes a list of pairs and creates a pair of lists. The first list\ncontains all the first items of the pairs, the second list contains all the\nsecond items.\n\n## Examples\n\n```rescript\nList.unzip(list{(1, 2), (3, 4)}) // (list{1, 3}, list{2, 4})\n\nassertEqual(\n 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 exp: float => float" + "signature": "let unzip: list<('a, 'b)> => (list<'a>, list<'b>)" }, { - "id": "Core.Math.expm1", + "id": "Stdlib.List.getAssoc", "kind": "value", - "name": "expm1", + "name": "getAssoc", "docstrings": [ - "`expm1(v)` returns *e* (the base of natural logarithms) to the power of the given\nargument `v` minus 1.\nSee [`Math.expm1`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/expm1) on MDN.\n\n## Examples\n\n```rescript\nMath.expm1(-1.0) // -0.6321205588285577\nMath.expm1(-0.0) // -0\n```" + "`getAssoc(list, k, f)` return the second element of a pair in `list` where\nthe first element equals `k` as per the predicate function `f`, or `None` if\nnot found.\n\n## Examples\n\n```rescript\nlist{(1, \"a\"), (2, \"b\"), (3, \"c\")}->List.getAssoc(3, (a, b) => a == b) // Some(\"c\")\n\nassertEqual(\n list{(9, \"morning\"), (15, \"afternoon\"), (22, \"night\")}\n ->List.getAssoc(15, (k, item) => k /* 15 */ == item /* 9, 5, 22 */),\n Some(\"afternoon\")\n)\n```" ], - "signature": "let expm1: float => float" + "signature": "let getAssoc: (list<('a, 'c)>, 'b, ('a, 'b) => bool) => option<'c>", + "deprecated": "Use a `Map` instead" }, { - "id": "Core.Math.floor", + "id": "Stdlib.List.hasAssoc", "kind": "value", - "name": "floor", + "name": "hasAssoc", "docstrings": [ - "`floor(v)` returns the largest integral value less than or equal to the argument\n`v`. The result is a `float` and is not restricted to the `int` data type range.\nSee [`Math.floor`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/floor) on MDN.\n\n## Examples\n\n```rescript\nMath.floor(-45.95) // -46.0\nMath.floor(-45.05) // -46.0\nMath.floor(-0.0) // -0.0\n```" + "`hasAssoc(list, k, f)` returns `true` if there is a pair in `list` where the\nfirst element equals `k` as per the predicate function `f`.\n\n## Examples\n\n```rescript\nlist{(1, \"a\"), (2, \"b\"), (3, \"c\")}->List.hasAssoc(1, (a, b) => a == b) // true\n\nassertEqual(\n list{(9, \"morning\"), (15, \"afternoon\"), (22, \"night\")}\n ->List.hasAssoc(25, (k, item) => k /* 25 */ == item /* 9, 5, 22 */),\n false\n)\n```" ], - "signature": "let floor: float => float" + "signature": "let hasAssoc: (list<('a, 'c)>, 'b, ('a, 'b) => bool) => bool", + "deprecated": "Use a `Map` instead" }, { - "id": "Core.Math.fround", + "id": "Stdlib.List.removeAssoc", "kind": "value", - "name": "fround", + "name": "removeAssoc", "docstrings": [ - "`fround(v)` returns the nearest single precision float.\nSee [`Math.fround`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/fround) on MDN.\n\n## Examples\n\n```rescript\nMath.fround(5.5) == 5.5\nMath.fround(5.05) == 5.050000190734863\n```" + "`removeAssoc(list, k, f)` return a list after removing the first pair whose\nfirst value is `k` per the equality predicate `f`, if not found, return a new\nlist identical to `list`.\n\n## Examples\n\n```rescript\nlist{(1, \"a\"), (2, \"b\"), (3, \"c\")}->List.removeAssoc(1, (a, b) => a == b) // list{(2, \"b\"), (3, \"c\")}\n\nassertEqual(\n list{(9, \"morning\"), (15, \"afternoon\"), (22, \"night\")}\n ->List.removeAssoc(9, (k, item) => k /* 9 */ == item /* 9, 5, 22 */),\n list{(15, \"afternoon\"), (22, \"night\")}\n)\n```" ], - "signature": "let fround: float => float" + "signature": "let removeAssoc: (list<('a, 'c)>, 'b, ('a, 'b) => bool) => list<('a, 'c)>", + "deprecated": "Use a `Map` instead" }, { - "id": "Core.Math.hypot", + "id": "Stdlib.List.setAssoc", "kind": "value", - "name": "hypot", + "name": "setAssoc", "docstrings": [ - "`hypot(a, b)` returns the square root of the sum of squares of its two arguments\n(the Pythagorean formula).\nSee [`Math.hypot`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/hypot) on MDN.\n\n## Examples\n\n```rescript\nMath.hypot(3.0, 4.0) // 5.0\nMath.hypot(3.0, 5.0) // 5.8309518948453\n```" + "`setAssoc(list, k, v, f)`. If `k` exists in `list` by satisfying the `f`\npredicate, return a new list with the key and value replaced by the new `k` and\n`v`, otherwise, return a new list with the pair `k`, `v` added to the head of\n`list`.\n\n## Examples\n\n```rescript\nassertEqual(\n list{(1, \"a\"), (2, \"b\"), (3, \"c\")}->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\")}->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 ->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**: In the last example, since: `15 mod 12` equals `3 mod 12`. Both\nthe key _and_ the value are replaced in the list." ], - "signature": "let hypot: (float, float) => float" + "signature": "let setAssoc: (list<('a, 'c)>, 'a, 'c, ('a, 'a) => bool) => list<('a, 'c)>", + "deprecated": "Use a `Map` instead" }, { - "id": "Core.Math.hypotMany", + "id": "Stdlib.List.sort", "kind": "value", - "name": "hypotMany", + "name": "sort", "docstrings": [ - "`hypotMany(arr)` returns the square root of the sum of squares of the numbers in\nthe array argument (generalized Pythagorean equation). Using an array allows you\nto have more than two items. If `arr` is an empty array then returns `0.0`.\nSee [`Math.hypot`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/hypot) on MDN.\n\n## Examples\n\n```rescript\nMath.hypotMany([3.0, 4.0, 5.0]) // 7.0710678118654755\nMath.hypotMany([]) // 0.0\n```" + "`sort(list, f)` returns a sorted list.\n\n## Examples\n\n```rescript\nassertEqual(\n List.sort(list{5, 4, 9, 3, 7}, Int.compare),\n list{3, 4, 5, 7, 9}\n)\n```" ], - "signature": "let hypotMany: array => float" + "signature": "let sort: (list<'a>, ('a, 'a) => Ordering.t) => list<'a>" }, { - "id": "Core.Math.log", + "id": "Stdlib.List.ignore", "kind": "value", - "name": "log", + "name": "ignore", "docstrings": [ - "`log(v)` returns the natural logarithm of argument `v`, this is the number *x*\nsuch that `e^x` equals the argument. Returns `NaN` for negative arguments and\n`Infinity` for `0.0` or `-0.0`.\nSee [`Math.log`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/log) on MDN.\n\n## Examples\n\n```rescript\nMath.log(-1.0)->Float.isNaN // true\nMath.log(-0.0)->Float.isFinite // false\nMath.log(0.0)->Float.isFinite // false\nMath.log(1.0) // 0\n```" + "`ignore(list)` ignores the provided list and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." ], - "signature": "let log: float => float" + "signature": "let ignore: list<'a> => unit" + } + ] + }, + "stdlib/lazy": { + "id": "Stdlib.Lazy", + "name": "Lazy", + "docstrings": [ + "This module provides a type `Lazy.t` and functions to create and\n manipulate lazy values. A lazy value is a value that is not\n computed until it is needed. This is useful for deferring\n computations that may be expensive or unnecessary." + ], + "items": [ + { + "id": "Stdlib.Lazy.t", + "kind": "type", + "name": "t", + "docstrings": [ + "The type of a lazy value. `Lazy.t<'a>` represents a lazy value\n that will eventually yield a value of type `'a` when accessed.\n The value is computed only once, and the result is cached for\n subsequent accesses. If the computation raises an exception,\n the same exception is raised again on subsequent accesses." + ], + "signature": "type t<+'a>" }, { - "id": "Core.Math.log1p", + "id": "Stdlib.Lazy.make", "kind": "value", - "name": "log1p", + "name": "make", "docstrings": [ - "`log1p(v)` returns the natural logarithm of one plus the argument `v`.\nReturns `NaN` for arguments less than `-1` and `Infinity` if `v` is `-1.0`.\nSee [`Math.log1p`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/log1p) on MDN.\n\n## Examples\n\n```rescript\nMath.log1p(-2.0)->Float.isNaN // true\nMath.log1p(-1.0)->Float.isFinite // false\nMath.log1p(-0.0) // -0\n```" + "`Lazy.make(f)` creates a lazy value from `f` which is the\n computation to be deferred of type `unit => 'a`. \n The function returns a lazy value of type `Lazy.t<'a>`. \n The computation is not executed until the lazy value is accessed.\n\n ## Examples \n ```rescript \n let lazyValue = Lazy.make(() => {\n // Some expensive computation\n Console.log(\"Computing...\")\n 42\n });\n lazyValue->Lazy.get->assertEqual(42)\n ```" ], - "signature": "let log1p: float => float" + "signature": "let make: (unit => 'a) => t<'a>" }, { - "id": "Core.Math.log10", + "id": "Stdlib.Lazy.get", "kind": "value", - "name": "log10", + "name": "get", "docstrings": [ - "`log10(v)` returns the base 10 logarithm of argument `v`. Returns `NaN` for\nnegative `v`. If `v` is `-0.0` or `0.0` returns `Infinity`.\nSee [`Math.log10`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/log10) on MDN.\n\n## Examples\n\n```rescript\nMath.log10(-2.0)->Float.isNaN // true\nMath.log10(-0.0)->Float.isFinite // false\nMath.log10(0.0)->Float.isFinite // false\nMath.log10(1.0) // 0\n```" + "`Lazy.get(x)` forces the suspension `x` and returns its result.\n If `x` has already been forced, `Lazy.get(x)` returns the\n same value again without recomputing it. If it raised an\n exception, the same exception is raised again.\n Raise `Undefined` if the forcing of `x` tries to force `x` itself\n recursively. This is a runtime error." ], - "signature": "let log10: float => float" + "signature": "let get: t<'a> => 'a" }, { - "id": "Core.Math.log2", + "id": "Stdlib.Lazy.isEvaluated", "kind": "value", - "name": "log2", + "name": "isEvaluated", "docstrings": [ - "`log2(v)` returns the base 2 logarithm of argument `v`. Returns `NaN` for\nnegative `v` and `Infinity` if `v` is `-0.0` or `0.0`.\nSee [`Math.log2`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/log2) on MDN.\n\n## Examples\n\n```rescript\nMath.log2(-2.0)->Float.isNaN // true\nMath.log2(-0.0)->Float.isFinite // false\nMath.log2(0.0)->Float.isFinite // false\nMath.log2(1.0) // 0.0\n```" + "`Lazy.isEvaluated(x)` returns `true` if the suspension `x` has\n already been forced and did not raise an exception. Otherwise, \n it returns `false`. This is useful for checking if a lazy value\n has been computed before accessing it.\n\n ## Examples\n ```rescript \n let lazyValue = Lazy.make(() => {\n // Some expensive computation\n Console.log(\"Computing...\")\n 42\n })\n Lazy.isEvaluated(lazyValue)->assertEqual(false)\n lazyValue->Lazy.get->assertEqual(42)\n lazyValue->Lazy.isEvaluated->assertEqual(true)\n ```" ], - "signature": "let log2: float => float" + "signature": "let isEvaluated: t<'a> => bool" }, { - "id": "Core.Math.min", + "id": "Stdlib.Lazy.force", "kind": "value", - "name": "min", + "name": "force", "docstrings": [ - "`min(a, b)` returns the minimum of its two float arguments.\nSee [`Math.min`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/min) on MDN.\n\n## Examples\n\n```rescript\nMath.min(1.0, 2.0) // 1.0\nMath.min(-1.0, -2.0) // -2.0\n```" + "`force(x)` forces the suspension `x` and returns its result.\n If `x` has already been forced, `Lazy.force(x)` returns the\n same value again without recomputing it. If it raised an exception,\n the same exception is raised again.\n Raise `Undefined` if the forcing of `x` tries to force `x` itself\n recursively." ], - "signature": "let min: (float, float) => float" + "signature": "let force: t<'a> => 'a", + "deprecated": "Use `Lazy.get` instead" }, { - "id": "Core.Math.minMany", + "id": "Stdlib.Lazy.force_val", "kind": "value", - "name": "minMany", + "name": "force_val", "docstrings": [ - "`minMany(arr)` returns the minimum of the float in the given array `arr`.\nReturns `Infinity` if `arr` is empty.\nSee [`Math.min`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/min) on MDN.\n\n## Examples\n\n```rescript\nMath.minMany([1.0, 2.0]) // 1.0\nMath.minMany([-1.0, -2.0]) // -2.0\nMath.minMany([])->Float.isFinite // false\n```" + "`force_val(x)` forces the suspension `x` and returns its\n result. If `x` has already been forced, `force_val(x)`\n returns the same value again without recomputing it.\n Raise `Undefined` if the forcing of `x` tries to force `x` itself\n recursively.\n If the computation of `x` raises an exception, it is unspecified\n whether `force_val(x)` raises the same exception or `Undefined`." ], - "signature": "let minMany: array => float" + "signature": "let force_val: t<'a> => 'a", + "deprecated": "Use `Lazy.get` instead" }, { - "id": "Core.Math.max", + "id": "Stdlib.Lazy.from_fun", "kind": "value", - "name": "max", + "name": "from_fun", "docstrings": [ - "`max(a, b)` returns the maximum of its two float arguments.\nSee [`Math.max`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/max) on MDN.\n\n## Examples\n\n```rescript\nMath.max(1.0, 2.0) // 2.0\nMath.max(-1.0, -2.0) // -1.0\n```" + "`Lazy.from_fun(f)` creates a lazy value from `f` which is the\n computation to be deferred of type `unit => 'a`. \n The function returns a lazy value of type `Lazy.t<'a>`. \n The computation is not executed until the lazy value is accessed." ], - "signature": "let max: (float, float) => float" + "signature": "let from_fun: (unit => 'a) => t<'a>", + "deprecated": "Use `Lazy.make` instead" }, { - "id": "Core.Math.maxMany", + "id": "Stdlib.Lazy.from_val", "kind": "value", - "name": "maxMany", + "name": "from_val", "docstrings": [ - "`maxMany(arr)` returns the maximum of the float in the given array `arr`.\nReturns `Infinity` if `arr` is empty.\nSee [`Math.max`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/max) on MDN.\n\n## Examples\n\n```rescript\nMath.maxMany([1.0, 2.0]) // 2.0\nMath.maxMany([-1.0, -2.0]) // -1.0\nMath.maxMany([])->Float.isFinite // false\n```" + "`from_val(v)` returns an already-forced suspension of `v`.\n This is for special purposes only." ], - "signature": "let maxMany: array => float" + "signature": "let from_val: 'a => t<'a>", + "deprecated": "Use `Lazy.make` instead" }, { - "id": "Core.Math.pow", + "id": "Stdlib.Lazy.is_val", "kind": "value", - "name": "pow", + "name": "is_val", "docstrings": [ - "`pow(a, ~exp)` raises the given base `a` to the given exponent `exp`.\nSee [`Math.pow`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/pow) on MDN.\n\n## Examples\n\n```rescript\nMath.pow(2.0, ~exp=4.0) // 16.0\nMath.pow(3.0, ~exp=4.0) // 81.0\n```" + "`is_val(x)` returns `true` if `x has already been forced and\n did not raise an exception." ], - "signature": "let pow: (float, ~exp: float) => float" + "signature": "let is_val: t<'a> => bool", + "deprecated": "Use `Lazy.isEvaluated` instead" + } + ] + }, + "stdlib/json": { + "id": "Stdlib.JSON", + "name": "JSON", + "docstrings": [ + "Functions for interacting with JSON." + ], + "items": [ + { + "id": "Stdlib.JSON.t", + "kind": "type", + "name": "t", + "docstrings": [ + "A type representing a JSON object." + ], + "signature": "@unboxed\ntype t =\n | Boolean(bool)\n | @as(null) Null\n | String(string)\n | Number(float)\n | Object(dict)\n | Array(array)" + }, + { + "id": "Stdlib.JSON.replacer", + "kind": "type", + "name": "replacer", + "docstrings": [], + "signature": "@unboxed\ntype replacer =\n | Keys(array)\n | Replacer((string, t) => t)" }, { - "id": "Core.Math.random", + "id": "Stdlib.JSON.parseOrThrow", "kind": "value", - "name": "random", + "name": "parseOrThrow", "docstrings": [ - "`random()` returns a random number in the half-closed interval [0,1].\nSee [`Math.random`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random) on MDN.\n\n## Examples\n\n```rescript\nMath.random()\n```" + "`parseOrThrow(string, ~reviver=?)` \n\nParses a JSON string or throws a JavaScript exception (SyntaxError), if the string isn't valid.\nThe reviver describes how the value should be transformed. It is a function which receives a key and a value.\nIt returns a JSON type.\n\n## Examples\n```rescript\ntry {\n let _ = JSON.parseOrThrow(`{\"foo\":\"bar\",\"hello\":\"world\"}`)\n // { foo: 'bar', hello: 'world' }\n\n let _ = JSON.parseOrThrow(\"\")\n // error\n} catch {\n| JsExn(_) => Console.log(\"error\")\n}\n\nlet reviver = (_, value: JSON.t) =>\n switch value {\n | String(string) => string->String.toUpperCase->JSON.Encode.string\n | Number(number) => (number *. 2.0)->JSON.Encode.float\n | _ => value\n }\n\nlet jsonString = `{\"hello\":\"world\",\"someNumber\":21}`\n\ntry {\n JSON.parseOrThrow(jsonString, ~reviver)->Console.log\n // { hello: 'WORLD', someNumber: 42 }\n\n JSON.parseOrThrow(\"\", ~reviver)->Console.log\n // error\n} catch {\n| JsExn(_) => Console.log(\"error\")\n}\n```\n\n## Exceptions \n\n- Raises a SyntaxError (Exn.t) if the string isn't valid JSON." ], - "signature": "let random: unit => float" + "signature": "let parseOrThrow: (string, ~reviver: (string, t) => t=?) => t" }, { - "id": "Core.Math.round", + "id": "Stdlib.JSON.parseExn", "kind": "value", - "name": "round", + "name": "parseExn", "docstrings": [ - "`round(v)` returns then value of `v` rounded to nearest integral value\n(expressed as a float). If the fractional portion of the argument `v` is greater\nthan `0.5`, the argument `v` is rounded to the float with the next higher\nabsolute value.\nSee [`Math.round`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/round) on MDN.\n\n## Examples\n\n```rescript\nMath.round(-20.5) // -20.0\nMath.round(-0.1) // -0.0\nMath.round(0.0) // 0.0\nMath.round(-0.0) // -0.0\n```" + "`parseExn(string, ~reviver=?)` \n\nParses a JSON string or throws a JavaScript exception (SyntaxError), if the string isn't valid.\nThe reviver describes how the value should be transformed. It is a function which receives a key and a value.\nIt returns a JSON type.\n\n## Examples\n```rescript\ntry {\n let _ = JSON.parseExn(`{\"foo\":\"bar\",\"hello\":\"world\"}`)\n // { foo: 'bar', hello: 'world' }\n\n let _ = JSON.parseExn(\"\")\n // error\n} catch {\n| JsExn(_) => Console.log(\"error\")\n}\n\nlet reviver = (_, value: JSON.t) =>\n switch value {\n | String(string) => string->String.toUpperCase->JSON.Encode.string\n | Number(number) => (number *. 2.0)->JSON.Encode.float\n | _ => value\n }\n\nlet jsonString = `{\"hello\":\"world\",\"someNumber\":21}`\n\ntry {\n JSON.parseExn(jsonString, ~reviver)->Console.log\n // { hello: 'WORLD', someNumber: 42 }\n\n JSON.parseExn(\"\", ~reviver)->Console.log\n // error\n} catch {\n| JsExn(_) => Console.log(\"error\")\n}\n```\n\n## Exceptions \n\n- Raises a SyntaxError (Exn.t) if the string isn't valid JSON." ], - "signature": "let round: float => float" + "signature": "let parseExn: (string, ~reviver: (string, t) => t=?) => t", + "deprecated": "Use `parseOrThrow` instead" }, { - "id": "Core.Math.sign", + "id": "Stdlib.JSON.parseExnWithReviver", "kind": "value", - "name": "sign", + "name": "parseExnWithReviver", "docstrings": [ - "`sign(v)` returns the sign of its foat argument: `-1` if negative, `0` if\nzero, `1` if positive.\nSee [`Math.sign`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sign) on MDN.\n\n## Examples\n\n```rescript\nMath.sign(3.0) // 1.0\nMath.sign(-3.0) // 1.0\nMath.sign(0.0) // 0.0\n```" + "`parseExnWithReviver(string, reviver)` \n\nParses a JSON string or throws a JavaScript exception (SyntaxError), if the string isn't valid.\nThe reviver describes how the value should be transformed. It is a function which receives a key and a value.\nIt returns a JSON type.\n\n## Examples\n```rescript\nlet reviver = (_, value: JSON.t) =>\n switch value {\n | String(string) => string->String.toUpperCase->JSON.Encode.string\n | Number(number) => (number *. 2.0)->JSON.Encode.float\n | _ => value\n }\n\nlet jsonString = `{\"hello\":\"world\",\"someNumber\":21}`\n\nJSON.parseExnWithReviver(jsonString, reviver)->Console.log\n// { hello: 'WORLD', someNumber: 42 }\n\ntry {\n JSON.parseExnWithReviver(\"\", reviver)->Console.log\n // error\n} catch {\n| JsExn(_) => Console.log(\"error\")\n}\n```\n\n## Exceptions \n\n- Raises a SyntaxError if the string is not a valid JSON." ], - "signature": "let sign: float => float" + "signature": "let parseExnWithReviver: (string, (string, t) => t) => t", + "deprecated": "Use `parseOrThrow` with optional parameter instead" }, { - "id": "Core.Math.sin", + "id": "Stdlib.JSON.stringify", "kind": "value", - "name": "sin", + "name": "stringify", "docstrings": [ - "`sin(v)` returns the sine of argument `v`, which must be specified in radians.\nSee [`Math.sin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sin) on MDN.\n\n## Examples\n\n```rescript\nMath.sin(-0.0) // -0.0\nMath.sin(0.0) // 0.0\nMath.sin(1.0) // 0.8414709848078965\n```" + "`stringify(json, ~replacer=?, ~space=?)` \n\nConverts a JSON object to a JSON string.\nThe replacer describes how the value should be transformed. It is a function which receives a key and a value,\nor an array of keys which should be included in the output.\nIf you want to stringify any type, use `JSON.stringifyAny` instead.\n\n## Examples\n```rescript\nlet json =\n Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n ])->JSON.Encode.object\n\nJSON.stringify(json)\n// {\"foo\":\"bar\",\"hello\":\"world\",\"someNumber\":42}\n\nJSON.stringify(json, ~space=2)\n// {\n// \"foo\": \"bar\",\n// \"hello\": \"world\",\n// \"someNumber\": 42\n// }\n\nJSON.stringify(json, ~replacer=Keys([\"foo\", \"someNumber\"]))\n// {\"foo\":\"bar\",\"someNumber\":42}\n\nlet replacer = JSON.Replacer((_, value) => {\n let decodedValue = value->JSON.Decode.string\n\n switch decodedValue {\n | Some(string) => string->String.toUpperCase->JSON.Encode.string\n | None => value\n }\n})\n\nJSON.stringify(json, ~replacer)\n// {\"foo\":\"BAR\",\"hello\":\"WORLD\",\"someNumber\":42}\n```" ], - "signature": "let sin: float => float" + "signature": "let stringify: (t, ~replacer: replacer=?, ~space: int=?) => string" }, { - "id": "Core.Math.sinh", + "id": "Stdlib.JSON.stringifyWithIndent", "kind": "value", - "name": "sinh", + "name": "stringifyWithIndent", "docstrings": [ - "`sinh(v)` returns then hyperbolic sine of argument `v`, which must be specified\nin radians.\nSee [`Math.sinh`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sinh) on MDN.\n\n## Examples\n\n```rescript\nMath.sinh(-0.0) // -0.0\nMath.sinh(0.0) // 0.0\nMath.sinh(1.0) // 1.1752011936438014\n```" + "`stringifyWithIndent(json, indentation)` \n\nConverts a JSON object to a JSON string. The output will be indented.\nIf you want to stringify any type, use `JSON.stringifyAnyWithIndent` instead.\n\n## Examples\n```rescript\nlet json =\n Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n ])->JSON.Encode.object\n\nJSON.stringifyWithIndent(json, 2)\n// {\n// \"foo\": \"bar\",\n// \"hello\": \"world\",\n// \"someNumber\": 42\n// }\n```" ], - "signature": "let sinh: float => float" + "signature": "let stringifyWithIndent: (t, int) => string", + "deprecated": "Use `stringify` with optional parameter instead" }, { - "id": "Core.Math.sqrt", + "id": "Stdlib.JSON.stringifyWithReplacer", "kind": "value", - "name": "sqrt", + "name": "stringifyWithReplacer", "docstrings": [ - "`sqrt(v)` returns the square root of `v`. If `v` is negative returns `NaN`.\nSee [`Math.sqrt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sqrt) on MDN.\n\n## Examples\n\n```rescript\nMath.sqrt(-1.0)->Float.isNaN // true\nMath.sqrt(-0.0) // -0.0\nMath.sqrt(0.0) // 0.0\nMath.sqrt(1.0) // 1.0\nMath.sqrt(9.0) // 3.0\n```" + "`stringifyWithReplacer(json, replacer)` \n\nConverts a JSON object to a JSON string.\nThe replacer describes how the value should be transformed. It is a function which receives a key and a value.\nIf you want to stringify any type, use `JSON.stringifyAnyWithReplacer` instead.\n\n## Examples\n```rescript\nlet json =\n Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n ])->JSON.Encode.object\n\nlet replacer = (_, value) => {\n let decodedValue = value->JSON.Decode.string\n\n switch decodedValue {\n | Some(string) => string->String.toUpperCase->JSON.Encode.string\n | None => value\n }\n}\n\nJSON.stringifyWithReplacer(json, replacer)\n// {\"foo\":\"BAR\",\"hello\":\"WORLD\",\"someNumber\":42}\n```" ], - "signature": "let sqrt: float => float" + "signature": "let stringifyWithReplacer: (t, (string, t) => t) => string", + "deprecated": "Use `stringify` with optional parameter instead" }, { - "id": "Core.Math.tan", + "id": "Stdlib.JSON.stringifyWithReplacerAndIndent", "kind": "value", - "name": "tan", + "name": "stringifyWithReplacerAndIndent", "docstrings": [ - "`tan(v)` returns the tangent of argument `v`, which must be specified in\nradians. Returns `NaN` if `v` is positive `Infinity` or negative `Infinity`.\nSee [`Math.tan`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/tan) on MDN.\n\n## Examples\n\n```rescript\nMath.tan(-0.0) // -0.0\nMath.tan(0.0) // 0.0\nMath.tan(1.0) // 1.5574077246549023\n```" + "`stringifyWithReplacerAndIndent(json, replacer, indentation)`\n\nConverts a JSON object to a JSON string. The output will be indented.\nThe replacer describes how the value should be transformed. It is a function which receives a key and a value.\nIf you want to stringify any type, use `JSON.stringifyAnyWithReplacerAndIndent` instead.\n\n## Examples\n```rescript\nlet json =\n Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n ])->JSON.Encode.object\n\nlet replacer = (_, value) => {\n let decodedValue = value->JSON.Decode.string\n\n switch decodedValue {\n | Some(string) => string->String.toUpperCase->JSON.Encode.string\n | None => value\n }\n}\n\nJSON.stringifyWithReplacerAndIndent(json, replacer, 2)\n// {\n// \"foo\": \"BAR\",\n// \"hello\": \"WORLD\",\n// \"someNumber\": 42\n// }\n```" ], - "signature": "let tan: float => float" + "signature": "let stringifyWithReplacerAndIndent: (t, (string, t) => t, int) => string", + "deprecated": "Use `stringify` with optional parameters instead" }, { - "id": "Core.Math.tanh", + "id": "Stdlib.JSON.stringifyWithFilter", "kind": "value", - "name": "tanh", + "name": "stringifyWithFilter", "docstrings": [ - "`tanh(v)` returns the hyperbolic tangent of argument `v`, which must be\nspecified in radians.\nSee [`Math.tanh`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/tanh) on MDN.\n\n## Examples\n\n```rescript\nMath.tanh(-0.0) // -0.0\nMath.tanh(0.0) // 0.0\nMath.tanh(1.0) // 0.7615941559557649\n```" + "`stringifyWithFilter(json, filter)` \n\nConverts a JSON object to a JSON string.\nThe filter is an array of keys, which should be included in the output.\nIf you want to stringify any type, use `JSON.stringifyAnyWithFilter` instead.\n\n## Examples\n```rescript\nlet json =\n Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n ])->JSON.Encode.object\n\nJSON.stringifyWithFilter(json, [\"foo\", \"someNumber\"])\n// {\"foo\":\"bar\",\"someNumber\":42}\n```" ], - "signature": "let tanh: float => float" + "signature": "let stringifyWithFilter: (t, array) => string", + "deprecated": "Use `stringify` with optional parameter instead" }, { - "id": "Core.Math.trunc", + "id": "Stdlib.JSON.stringifyWithFilterAndIndent", "kind": "value", - "name": "trunc", + "name": "stringifyWithFilterAndIndent", "docstrings": [ - "`trunc(v)` truncates the argument `v`, i.e., removes fractional digits.\nSee [`Math.trunc`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/trunc) on MDN.\n\n## Examples\n\n```rescript\nMath.trunc(0.123) // 0.0\nMath.trunc(1.999) // 1.0\nMath.trunc(13.37) // 13.0\nMath.trunc(42.84) // 42.0\n```" + "`stringifyWithFilterAndIndent(json, filter, indentation)` \n\nConverts a JSON object to a JSON string. The output will be indented.\nThe filter is an array of keys, which should be included in the output.\nIf you want to stringify any type, use `JSON.stringifyAnyWithFilterAndIndent` instead.\n\n## Examples\n```rescript\nlet json =\n Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n ])->JSON.Encode.object\n\nJSON.stringifyWithFilterAndIndent(json, [\"foo\", \"someNumber\"], 2)\n// {\n// \"foo\": \"bar\",\n// \"someNumber\": 42\n// }\n```" ], - "signature": "let trunc: float => float" - } - ] - }, - "core/bigint": { - "id": "Core.BigInt", - "name": "BigInt", - "docstrings": [], - "items": [ + "signature": "let stringifyWithFilterAndIndent: (t, array, int) => string", + "deprecated": "Use `stringify` with optional parameters instead" + }, { - "id": "Core.BigInt.asIntN", + "id": "Stdlib.JSON.stringifyAny", "kind": "value", - "name": "asIntN", - "docstrings": [], - "signature": "let asIntN: (~width: int, bigint) => bigint" + "name": "stringifyAny", + "docstrings": [ + "`stringifyAny(any, ~replacer=?, ~space=?)`\n\nConverts any type to a JSON string.\nThe replacer describes how the value should be transformed. It is a function which receives a key and a value.\nStringifying a function or `undefined` will return `None`.\nIf the value contains circular references or `BigInt`s, the function will throw a JavaScript exception (TypeError).\nIf you want to stringify a JSON object, use `JSON.stringify` instead.\n\n## Examples\n\n```rescript\nlet dict = Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n])\n\ndict\n->JSON.stringifyAny\n->Option.getUnsafe\n->assertEqual(`{\"foo\":\"bar\",\"hello\":\"world\",\"someNumber\":42}`)\n\ndict\n->JSON.stringifyAny(~space=2)\n->Option.getUnsafe\n->assertEqual(`{\n \"foo\": \"bar\",\n \"hello\": \"world\",\n \"someNumber\": 42\n}`)\n\ndict\n->JSON.stringifyAny(~replacer=Keys([\"foo\", \"someNumber\"]))\n->Option.getUnsafe\n->assertEqual(`{\"foo\":\"bar\",\"someNumber\":42}`)\n\nlet replacer = JSON.Replacer((_, value) => {\n let decodedValue = value->JSON.Decode.string\n\n switch decodedValue {\n | Some(string) => string->String.toUpperCase->JSON.Encode.string\n | None => value\n }\n})\n\ndict\n->JSON.stringifyAny(~replacer)\n->Option.getUnsafe\n->assertEqual(`{\"foo\":\"BAR\",\"hello\":\"WORLD\",\"someNumber\":42}`)\n\nJSON.stringifyAny(() => \"hello world\")\n->assertEqual(None)\n\n// Raise a exception\nswitch BigInt.fromInt(0)->JSON.stringifyAny {\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Raises a TypeError if the value contains circular references.\n- Raises a TypeError if the value contains `BigInt`s." + ], + "signature": "let stringifyAny: ('a, ~replacer: replacer=?, ~space: int=?) => option" }, { - "id": "Core.BigInt.asUintN", + "id": "Stdlib.JSON.stringifyAnyWithIndent", "kind": "value", - "name": "asUintN", - "docstrings": [], - "signature": "let asUintN: (~width: int, bigint) => bigint" + "name": "stringifyAnyWithIndent", + "docstrings": [ + "`stringifyAnyWithIndent(any, indentation)`\n\nConverts any type to a JSON string. The output will be indented.\nStringifying a function or `undefined` will return `None`.\nIf the value contains circular references or `BigInt`s, the function will throw a JavaScript exception (TypeError).\nIf you want to stringify a JSON object, use `JSON.stringifyWithIndent` instead.\n\n## Examples\n\n```rescript\nlet dict = Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n])\n\ndict\n->JSON.stringifyAnyWithIndent(2)\n->Option.getUnsafe\n->assertEqual(`{\n \"foo\": \"bar\",\n \"hello\": \"world\",\n \"someNumber\": 42\n}`)\n\nJSON.stringifyAny(() => \"hello world\")->assertEqual(None)\n\nswitch BigInt.fromInt(0)->JSON.stringifyAny {\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions \n\n- Raises a TypeError if the value contains circular references.\n- Raises a TypeError if the value contains `BigInt`s." + ], + "signature": "let stringifyAnyWithIndent: ('a, int) => option", + "deprecated": "Use `stringifyAny` with optional parameter instead" }, { - "id": "Core.BigInt.fromString", + "id": "Stdlib.JSON.stringifyAnyWithReplacer", "kind": "value", - "name": "fromString", - "docstrings": [], - "signature": "let fromString: string => bigint" + "name": "stringifyAnyWithReplacer", + "docstrings": [ + "`stringifyAnyWithReplacer(json, replacer)`\n\nConverts any type to a JSON string.\nThe replacer describes how the value should be transformed. It is a function which receives a key and a value.\nStringifying a function or `undefined` will return `None`.\nIf the value contains circular references or `BigInt`s, the function will throw a JavaScript exception (TypeError).\nIf you want to stringify a JSON object, use `JSON.stringifyWithReplacer` instead.\n\n## Examples\n```rescript\nlet dict = Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n])\n\nlet replacer = (_, value) => {\n let decodedValue = value->JSON.Decode.string\n\n switch decodedValue {\n | Some(string) => string->String.toUpperCase->JSON.Encode.string\n | None => value\n }\n}\n\ndict\n->JSON.stringifyAnyWithReplacer(replacer)\n->Option.getUnsafe\n->assertEqual(`{\"foo\":\"BAR\",\"hello\":\"WORLD\",\"someNumber\":42}`)\n\nJSON.stringifyAny(() => \"hello world\")->assertEqual(None)\n\nswitch BigInt.fromInt(0)->JSON.stringifyAny {\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Raises a TypeError if the value contains circular references.\n- Raises a TypeError if the value contains `BigInt`s." + ], + "signature": "let stringifyAnyWithReplacer: ('a, (string, t) => t) => option", + "deprecated": "Use `stringifyAny` with optional parameter instead" }, { - "id": "Core.BigInt.fromStringExn", + "id": "Stdlib.JSON.stringifyAnyWithReplacerAndIndent", "kind": "value", - "name": "fromStringExn", + "name": "stringifyAnyWithReplacerAndIndent", "docstrings": [ - "Parses the given `string` into a `bigint` using JavaScript semantics. Return the\nnumber as a `bigint` if successfully parsed. Uncaught syntax exception otherwise.\n\n## Examples\n\n```rescript\n/* returns 123n */\nBigInt.fromStringExn(\"123\")\n\n/* returns 0n */\nBigInt.fromStringExn(\"\")\n\n/* returns 17n */\nBigInt.fromStringExn(\"0x11\")\n\n/* returns 3n */\nBigInt.fromStringExn(\"0b11\")\n\n/* returns 9n */\nBigInt.fromStringExn(\"0o11\")\n\n/* catch exception */\ntry {\n BigInt.fromStringExn(\"a\")\n} catch {\n| Exn.Error(_error) => 0n\n}\n```" + "`stringifyAnyWithReplacerAndIndent(json, replacer, indentation)`\n\nConverts any type to a JSON string. The output will be indented.\nThe replacer describes how the value should be transformed. It is a function which receives a key and a value.\nStringifying a function or `undefined` will return `None`.\nIf the value contains circular references or `BigInt`s, the function will throw a JavaScript exception (TypeError).\nIf you want to stringify a JSON object, use `JSON.stringifyWithReplacerAndIndent` instead.\n\n## Examples\n\n```rescript\nlet dict = Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n])\n\nlet replacer = (_, value) => {\n let decodedValue = value->JSON.Decode.string\n\n switch decodedValue {\n | Some(string) => string->String.toUpperCase->JSON.Encode.string\n | None => value\n }\n}\n\ndict\n->JSON.stringifyAnyWithReplacer(replacer)\n->Option.getUnsafe\n->assertEqual(`{\"foo\":\"BAR\",\"hello\":\"WORLD\",\"someNumber\":42}`)\n\nJSON.stringifyAny(() => \"hello world\")->assertEqual(None)\n\nswitch BigInt.fromInt(0)->JSON.stringifyAny {\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions \n\n- Raises a TypeError if the value contains circular references.\n- Raises a TypeError if the value contains `BigInt`s." ], - "signature": "let fromStringExn: string => bigint" + "signature": "let stringifyAnyWithReplacerAndIndent: ('a, (string, t) => t, int) => option", + "deprecated": "Use `stringifyAny` with optional parameters instead" }, { - "id": "Core.BigInt.fromInt", + "id": "Stdlib.JSON.stringifyAnyWithFilter", "kind": "value", - "name": "fromInt", - "docstrings": [], - "signature": "let fromInt: int => bigint" + "name": "stringifyAnyWithFilter", + "docstrings": [ + "`stringifyAnyWithFilter(json, filter)`\n\nConverts any type to a JSON string.\nThe filter is an array of keys, which should be included in the output.\nStringifying a function or `undefined` will return `None`.\nIf the value contains circular references or `BigInt`s, the function will throw a JavaScript exception (TypeError).\nIf you want to stringify a JSON object, use `JSON.stringifyWithFilter` instead.\n\n## Examples\n\n```rescript\nlet dict = Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n])\n\ndict\n->JSON.stringifyAnyWithFilter([\"foo\", \"someNumber\"])\n->assertEqual(`{\"foo\":\"bar\",\"someNumber\":42}`)\n\nJSON.stringifyAny(() => \"hello world\")->assertEqual(None)\n\nswitch BigInt.fromInt(0)->JSON.stringifyAny {\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Raises a TypeError if the value contains circular references.\n- Raises a TypeError if the value contains `BigInt`s." + ], + "signature": "let stringifyAnyWithFilter: ('a, array) => string", + "deprecated": "Use `stringifyAny` with optional parameter instead" }, { - "id": "Core.BigInt.fromFloat", + "id": "Stdlib.JSON.stringifyAnyWithFilterAndIndent", "kind": "value", - "name": "fromFloat", - "docstrings": [], - "signature": "let fromFloat: float => bigint" + "name": "stringifyAnyWithFilterAndIndent", + "docstrings": [ + "`stringifyAnyWithFilterAndIndent(json, filter, indentation)`\n\nConverts any type to a JSON string. The output will be indented.\nThe filter is an array of keys, which should be included in the output.\nStringifying a function or `undefined` will return `None`.\nIf the value contains circular references or `BigInt`s, the function will throw a JavaScript exception (TypeError).\nIf you want to stringify a JSON object, use `JSON.stringifyWithFilterAndIndent` instead.\n\n## Examples\n\n```rescript\nlet dict = Dict.fromArray([\n (\"foo\", JSON.Encode.string(\"bar\")),\n (\"hello\", JSON.Encode.string(\"world\")),\n (\"someNumber\", JSON.Encode.int(42)),\n])\n\ndict\n->JSON.stringifyAny\n->Option.getUnsafe\n->assertEqual(`{\"foo\":\"bar\",\"hello\":\"world\",\"someNumber\":42}`)\n\ndict\n->JSON.stringifyAny(~space=2)\n->Option.getUnsafe\n->assertEqual(`{\n \"foo\": \"bar\",\n \"hello\": \"world\",\n \"someNumber\": 42\n}`)\n\ndict\n->JSON.stringifyAny(~replacer=Keys([\"foo\", \"someNumber\"]))\n->Option.getUnsafe\n->assertEqual(`{\"foo\":\"bar\",\"someNumber\":42}`)\n\nJSON.stringifyAny(() => \"hello world\")->assertEqual(None)\n\nswitch BigInt.fromInt(0)->JSON.stringifyAny {\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions \n\n- Raises a TypeError if the value contains circular references.\n- Raises a TypeError if the value contains `BigInt`s." + ], + "signature": "let stringifyAnyWithFilterAndIndent: ('a, array, int) => string", + "deprecated": "Use `stringifyAny` with optional parameters instead" }, { - "id": "Core.BigInt.toString", + "id": "Stdlib.JSON.ignore", "kind": "value", - "name": "toString", + "name": "ignore", "docstrings": [ - "Formats a `bigint` as a string. Return a `string` representing the given value.\nSee [`toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString) on MDN.\n\n## Examples\n\n```rescript\n/* prints \"123\" */\nJs.BigInt.toString(123n)->Js.log\n```" + "`ignore(json)` ignores the provided json and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." ], - "signature": "let toString: (bigint, ~radix: int=?) => string" + "signature": "let ignore: t => unit" + } + ] + }, + "stdlib/jsexn": { + "id": "Stdlib.JsExn", + "name": "JsExn", + "docstrings": [ + "Provide utilities for dealing with JS exceptions.\n\nJS exceptions can be of any type, even though they *should* be of type `Error` of one of its subclasses.\n\nSee [`throw`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/throw) on MDN." + ], + "items": [ + { + "id": "Stdlib.JsExn.t", + "kind": "type", + "name": "t", + "docstrings": [ + "Represents a JS exception" + ], + "signature": "type t = unknown" }, { - "id": "Core.BigInt.toStringWithRadix", + "id": "Stdlib.JsExn.fromException", "kind": "value", - "name": "toStringWithRadix", + "name": "fromException", "docstrings": [], - "signature": "let toStringWithRadix: (bigint, ~radix: int) => string", - "deprecated": "Use `toString` with `~radix` instead" + "signature": "let fromException: exn => option" }, { - "id": "Core.BigInt.toLocaleString", + "id": "Stdlib.JsExn.anyToExnInternal", "kind": "value", - "name": "toLocaleString", + "name": "anyToExnInternal", "docstrings": [ - "Returns a string with a language-sensitive representation of this BigInt value.\n\n## Examples\n\n```rescript\n/* prints \"123\" */\nJs.BigInt.toString(123n)->Js.log\n```" + "`anyToExnInternal(obj)` will take any value `obj` and wrap it\nin a JsExn if given value is not an exn already. If\n`obj` is an exn, it will return `obj` without any changes.\n\nThis function is mostly useful for cases where you want to unify a type of a value\nthat potentially is either exn, a JS error, or any other JS value really (e.g. for\na value passed to a Promise.catch callback)\n\n**IMPORTANT**: This is an internal API and may be changed / removed any time in the future." ], - "signature": "let toLocaleString: bigint => string" + "signature": "let anyToExnInternal: 'a => exn" }, { - "id": "Core.BigInt.toFloat", + "id": "Stdlib.JsExn.stack", "kind": "value", - "name": "toFloat", - "docstrings": [], - "signature": "let toFloat: bigint => float" + "name": "stack", + "docstrings": [ + "`stack(jsExn)` retrieves the `stack` property of the exception, if it exists. The stack is a list of what functions were called, and what files they are defined in, prior to the error happening.\n\nSee [`Error.prototype.stack`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/Stack) on MDN.\n\n## Example\n```rescript\ntry {JsError.make(\"error\")->JsError.throw} catch {\n| JsExn(e) => Console.log(JsExn.stack(e)) // Logs `stack`\n| _ => assert(false)\n}\n```" + ], + "signature": "let stack: t => option" }, { - "id": "Core.BigInt.toInt", + "id": "Stdlib.JsExn.message", "kind": "value", - "name": "toInt", - "docstrings": [], - "signature": "let toInt: bigint => int" + "name": "message", + "docstrings": [ + "`message(error)` retrieves the `message` property of the error, if it exists.\n\nSee [`Error.prototype.message`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/message) on MDN.\n\n## Example\n```rescript\ntry {JsError.SyntaxError.throwWithMessage(\"Some message here\")} catch {\n| JsExn(e) => e->JsExn.message->Option.getExn->assertEqual(\"Some message here\")\n| _ => assert(false)\n}\n```" + ], + "signature": "let message: t => option" }, { - "id": "Core.BigInt.+", + "id": "Stdlib.JsExn.name", "kind": "value", - "name": "+", - "docstrings": [], - "signature": "let +: (bigint, bigint) => bigint" + "name": "name", + "docstrings": [ + "`name(error)` retrieves the `name` property of the error, if it exists.\n\nSee [`Error.prototype.name`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/name) on MDN.\n\n## Example\n```rescript\ntry {JsError.SyntaxError.throwWithMessage(\"Some message here\")} catch {\n| JsExn(e) => e->JsExn.name->Option.getExn->assertEqual(\"SyntaxError\")\n| _ => assert(false)\n}\n```" + ], + "signature": "let name: t => option" }, { - "id": "Core.BigInt.-", + "id": "Stdlib.JsExn.fileName", "kind": "value", - "name": "-", - "docstrings": [], - "signature": "let -: (bigint, bigint) => bigint" + "name": "fileName", + "docstrings": [ + "`fileName(error)` retrieves the `fileName` property of the error, if it exists.\n\nSee [`Error.prototype.fileName`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/fileName) on MDN." + ], + "signature": "let fileName: t => option" }, { - "id": "Core.BigInt.*", + "id": "Stdlib.JsExn.throw", "kind": "value", - "name": "*", - "docstrings": [], - "signature": "let *: (bigint, bigint) => bigint" + "name": "throw", + "docstrings": [ + "Throws the given value, terminating execution unless caught by a surrounding try/catch block.\n\nThis is meant to be used when a JS API is based on throwing values that are not of type `Error` or its subclasses." + ], + "signature": "let throw: 'a => 'b" }, { - "id": "Core.BigInt./", + "id": "Stdlib.JsExn.ignore", "kind": "value", - "name": "/", - "docstrings": [], - "signature": "let /: (bigint, bigint) => bigint" - }, + "name": "ignore", + "docstrings": [ + "`ignore(jsExn)` ignores the provided JS exception and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." + ], + "signature": "let ignore: t => unit" + } + ] + }, + "stdlib/jserror": { + "id": "Stdlib.JsError", + "name": "JsError", + "docstrings": [ + "Functions for working with JavaScript errors.\n\nSee [`Error`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) on MDN." + ], + "items": [ { - "id": "Core.BigInt.~-", - "kind": "value", - "name": "~-", - "docstrings": [], - "signature": "let ~-: bigint => bigint" + "id": "Stdlib.JsError.t", + "kind": "type", + "name": "t", + "docstrings": [ + "Represents a JavaScript error." + ], + "signature": "type t" }, { - "id": "Core.BigInt.~+", + "id": "Stdlib.JsError.stack", "kind": "value", - "name": "~+", - "docstrings": [], - "signature": "let ~+: bigint => bigint" + "name": "stack", + "docstrings": [ + "`stack(error)` retrieves the `stack` property of the error, if it exists. The stack is a list of what functions were called, and what files they are defined in, prior to the error happening.\n\nSee [`Error.prototype.stack`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/Stack) on MDN.\n\n## Example\n```rescript\nlet error = JsError.make(\"error\")\nConsole.log(error->JsError.stack) // Logs `stack` if it exists on `someError`\n```" + ], + "signature": "let stack: t => option" }, { - "id": "Core.BigInt.**", + "id": "Stdlib.JsError.message", "kind": "value", - "name": "**", - "docstrings": [], - "signature": "let **: (bigint, bigint) => bigint" + "name": "message", + "docstrings": [ + "`message(error)` retrieves the `message` property of the error.\n\nSee [`Error.prototype.message`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/message) on MDN.\n\n## Example\n```rescript\nlet error = JsError.SyntaxError.make(\"Some message here\")\nerror->JsError.message->assertEqual(\"Some message here\") \n```" + ], + "signature": "let message: t => string" }, { - "id": "Core.BigInt.add", + "id": "Stdlib.JsError.name", "kind": "value", - "name": "add", - "docstrings": [], - "signature": "let add: (bigint, bigint) => bigint" + "name": "name", + "docstrings": [ + "`name(error)` retrieves the `name` property of the error.\n\nSee [`Error.prototype.name`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/name) on MDN.\n\n## Example\n```rescript\nlet error = JsError.SyntaxError.make(\"Some message here\")\nerror->JsError.name->assertEqual(\"SyntaxError\")\n```" + ], + "signature": "let name: t => string" }, { - "id": "Core.BigInt.sub", + "id": "Stdlib.JsError.fileName", "kind": "value", - "name": "sub", - "docstrings": [], - "signature": "let sub: (bigint, bigint) => bigint" + "name": "fileName", + "docstrings": [ + "`fileName(error)` retrieves the `fileName` property of the error, if it exists.\n\nSee [`Error.prototype.fileName`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/fileName) on MDN." + ], + "signature": "let fileName: t => option" }, { - "id": "Core.BigInt.mul", + "id": "Stdlib.JsError.make", "kind": "value", - "name": "mul", - "docstrings": [], - "signature": "let mul: (bigint, bigint) => bigint" + "name": "make", + "docstrings": [ + "`make(message)` creates a new error, setting its `message` to the provided value.\n\nSee [`Error`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/Error) on MDN.\n\n## Example\n```rescript\nlet error = JsError.make(\"Some message here\")\nerror->JsError.message->assertEqual(\"Some message here\") \nerror->JsError.name->assertEqual(\"Error\") \n````" + ], + "signature": "let make: string => t" }, { - "id": "Core.BigInt.div", + "id": "Stdlib.JsError.throw", "kind": "value", - "name": "div", - "docstrings": [], - "signature": "let div: (bigint, bigint) => bigint" + "name": "throw", + "docstrings": [ + "Throws the given error, terminating execution unless caught by a surrounding try/catch block.\n\n## Examples\n\n```rescript\nlet error = JsError.make(\"Everything is upside down.\")\n\nif 5 > 10 {\n JsError.throw(error)\n} else {\n Console.log(\"Phew, sanity still rules.\")\n}\n```" + ], + "signature": "let throw: t => 'a" }, { - "id": "Core.BigInt.mod", + "id": "Stdlib.JsError.throwWithMessage", "kind": "value", - "name": "mod", - "docstrings": [], - "signature": "let mod: (bigint, bigint) => bigint" + "name": "throwWithMessage", + "docstrings": [ + "Creates a new `Error` with the provided `message` and throws it.\n\n`JsError.throwWithMessage(\"message\")` is equivalent to `JsError.make(\"message\")->JsError.throw`." + ], + "signature": "let throwWithMessage: string => 'a" }, { - "id": "Core.BigInt.land", + "id": "Stdlib.JsError.panic", "kind": "value", - "name": "land", - "docstrings": [], - "signature": "let land: (bigint, bigint) => bigint" + "name": "panic", + "docstrings": [ + "Throws a panic exception with the given message.\n\nA panic exception is a native JavaScript exception that is not intended to be caught and\nhandled. Compared to a ReScript exception this will give a better stack trace and\ndebugging experience.\n\n## Examples\n\n```rescript\ntry {\n JsError.panic(\"Uh oh. This was unexpected!\")\n} catch {\n| JsExn(obj) =>\n switch JsExn.message(obj) {\n | Some(m) => assert(m == \"Panic! Uh oh. This was unexpected!\")\n | None => assert(false)\n }\n| _ => assert(false)\n}\n```" + ], + "signature": "let panic: string => 'a" }, { - "id": "Core.BigInt.lor", + "id": "Stdlib.JsError.toJsExn", "kind": "value", - "name": "lor", - "docstrings": [], - "signature": "let lor: (bigint, bigint) => bigint" + "name": "toJsExn", + "docstrings": [ + "Casts a `JsError.t` to a `JsExn.t`. \n\nThis is useful when you want to compare a JS exception and a JS error." + ], + "signature": "let toJsExn: t => JsExn.t" }, { - "id": "Core.BigInt.lxor", + "id": "Stdlib.JsError.ignore", "kind": "value", - "name": "lxor", - "docstrings": [], - "signature": "let lxor: (bigint, bigint) => bigint" - }, + "name": "ignore", + "docstrings": [ + "`ignore(error)` ignores the provided error and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." + ], + "signature": "let ignore: t => unit" + } + ] + }, + "stdlib/intl": { + "id": "Stdlib.Intl", + "name": "Intl", + "docstrings": [], + "items": [ { - "id": "Core.BigInt.lsl", + "id": "Stdlib.Intl.getCanonicalLocalesExn", "kind": "value", - "name": "lsl", - "docstrings": [], - "signature": "let lsl: (bigint, bigint) => bigint" + "name": "getCanonicalLocalesExn", + "docstrings": [ + "@throws RangeError" + ], + "signature": "let getCanonicalLocalesExn: string => array" }, { - "id": "Core.BigInt.asr", + "id": "Stdlib.Intl.getCanonicalLocalesManyExn", "kind": "value", - "name": "asr", - "docstrings": [], - "signature": "let asr: (bigint, bigint) => bigint" + "name": "getCanonicalLocalesManyExn", + "docstrings": [ + "@throws RangeError" + ], + "signature": "let getCanonicalLocalesManyExn: array => array" }, { - "id": "Core.BigInt.lnot", + "id": "Stdlib.Intl.supportedValuesOfExn", "kind": "value", - "name": "lnot", - "docstrings": [], - "signature": "let lnot: bigint => bigint" + "name": "supportedValuesOfExn", + "docstrings": [ + "@throws RangeError" + ], + "signature": "let supportedValuesOfExn: string => array" } ] }, - "core/int": { - "id": "Core.Int", + "stdlib/int": { + "id": "Stdlib.Int", "name": "Int", "docstrings": [ "Functions for interacting with JavaScript Number.\nSee: [`Number`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)." ], "items": [ { - "id": "Core.Int.equal", + "id": "Stdlib.Int.t", + "kind": "type", + "name": "t", + "docstrings": [ + "Type representing an int." + ], + "signature": "type t = int" + }, + { + "id": "Stdlib.Int.equal", "kind": "value", "name": "equal", "docstrings": [], "signature": "let equal: (int, int) => bool" }, { - "id": "Core.Int.compare", + "id": "Stdlib.Int.compare", "kind": "value", "name": "compare", "docstrings": [], - "signature": "let compare: (int, int) => Core__Ordering.t" + "signature": "let compare: (int, int) => Ordering.t" }, { - "id": "Core.Int.toExponential", + "id": "Stdlib.Int.toExponential", "kind": "value", "name": "toExponential", "docstrings": [ @@ -7232,7 +8398,7 @@ "signature": "let toExponential: (int, ~digits: int=?) => string" }, { - "id": "Core.Int.toExponentialWithPrecision", + "id": "Stdlib.Int.toExponentialWithPrecision", "kind": "value", "name": "toExponentialWithPrecision", "docstrings": [ @@ -7242,7 +8408,7 @@ "deprecated": "Use `toExponential` instead" }, { - "id": "Core.Int.toFixed", + "id": "Stdlib.Int.toFixed", "kind": "value", "name": "toFixed", "docstrings": [ @@ -7251,7 +8417,7 @@ "signature": "let toFixed: (int, ~digits: int=?) => string" }, { - "id": "Core.Int.toFixedWithPrecision", + "id": "Stdlib.Int.toFixedWithPrecision", "kind": "value", "name": "toFixedWithPrecision", "docstrings": [ @@ -7261,7 +8427,7 @@ "deprecated": "Use `toFixed` instead" }, { - "id": "Core.Int.toPrecision", + "id": "Stdlib.Int.toPrecision", "kind": "value", "name": "toPrecision", "docstrings": [ @@ -7270,7 +8436,7 @@ "signature": "let toPrecision: (int, ~digits: int=?) => string" }, { - "id": "Core.Int.toPrecisionWithPrecision", + "id": "Stdlib.Int.toPrecisionWithPrecision", "kind": "value", "name": "toPrecisionWithPrecision", "docstrings": [ @@ -7280,7 +8446,7 @@ "deprecated": "Use `toPrecision` instead" }, { - "id": "Core.Int.toString", + "id": "Stdlib.Int.toString", "kind": "value", "name": "toString", "docstrings": [ @@ -7289,7 +8455,7 @@ "signature": "let toString: (int, ~radix: int=?) => string" }, { - "id": "Core.Int.toStringWithRadix", + "id": "Stdlib.Int.toStringWithRadix", "kind": "value", "name": "toStringWithRadix", "docstrings": [ @@ -7299,7 +8465,7 @@ "deprecated": "Use `toString` instead" }, { - "id": "Core.Int.toLocaleString", + "id": "Stdlib.Int.toLocaleString", "kind": "value", "name": "toLocaleString", "docstrings": [ @@ -7308,7 +8474,7 @@ "signature": "let toLocaleString: int => string" }, { - "id": "Core.Int.toFloat", + "id": "Stdlib.Int.toFloat", "kind": "value", "name": "toFloat", "docstrings": [ @@ -7317,7 +8483,7 @@ "signature": "let toFloat: int => float" }, { - "id": "Core.Int.fromFloat", + "id": "Stdlib.Int.fromFloat", "kind": "value", "name": "fromFloat", "docstrings": [ @@ -7326,7 +8492,7 @@ "signature": "let fromFloat: float => int" }, { - "id": "Core.Int.fromString", + "id": "Stdlib.Int.fromString", "kind": "value", "name": "fromString", "docstrings": [ @@ -7335,7 +8501,7 @@ "signature": "let fromString: (string, ~radix: int=?) => option" }, { - "id": "Core.Int.mod", + "id": "Stdlib.Int.mod", "kind": "value", "name": "mod", "docstrings": [ @@ -7344,7 +8510,7 @@ "signature": "let mod: (int, int) => int" }, { - "id": "Core.Int.rangeOptions", + "id": "Stdlib.Int.rangeOptions", "kind": "type", "name": "rangeOptions", "docstrings": [ @@ -7353,7 +8519,7 @@ "signature": "type rangeOptions = {step?: int, inclusive?: bool}" }, { - "id": "Core.Int.range", + "id": "Stdlib.Int.range", "kind": "value", "name": "range", "docstrings": [ @@ -7362,7 +8528,7 @@ "signature": "let range: (int, int, ~options: rangeOptions=?) => array" }, { - "id": "Core.Int.rangeWithOptions", + "id": "Stdlib.Int.rangeWithOptions", "kind": "value", "name": "rangeWithOptions", "docstrings": [ @@ -7372,39 +8538,120 @@ "deprecated": "Use `range` instead" }, { - "id": "Core.Int.clamp", + "id": "Stdlib.Int.clamp", "kind": "value", "name": "clamp", "docstrings": [ "`clamp(~min=?, ~max=?, value)` returns `value`, optionally bounded by `min` and `max`.\n\nif `max` < `min` returns `min`.\n\n## Examples\n\n```rescript\nInt.clamp(42) == 42\nInt.clamp(42, ~min=50) == 50\nInt.clamp(42, ~max=40) == 40\nInt.clamp(42, ~min=50, ~max=40) == 50\n```" ], "signature": "let clamp: (~min: int=?, ~max: int=?, int) => int" + }, + { + "id": "Stdlib.Int.bitwiseAnd", + "kind": "value", + "name": "bitwiseAnd", + "docstrings": [ + "`bitwiseAnd(n1, n2)` calculates the bitwise AND of two integers.\n\n## Examples\n\n```rescript\nInt.bitwiseAnd(7, 4) == 4\n```" + ], + "signature": "let bitwiseAnd: (int, int) => int" + }, + { + "id": "Stdlib.Int.bitwiseOr", + "kind": "value", + "name": "bitwiseOr", + "docstrings": [ + "`bitwiseOr(n1, n2)` calculates the bitwise OR of two integers.\n\n## Examples\n\n```rescript\nInt.bitwiseOr(7, 4) == 7\n```" + ], + "signature": "let bitwiseOr: (int, int) => int" + }, + { + "id": "Stdlib.Int.bitwiseXor", + "kind": "value", + "name": "bitwiseXor", + "docstrings": [ + "`bigwiseXor(n1, n2)` calculates the bitwise XOR of two integers.\n\n## Examples\n\n```rescript\nInt.bitwiseXor(7, 4) == 3\n```" + ], + "signature": "let bitwiseXor: (int, int) => int" + }, + { + "id": "Stdlib.Int.bitwiseNot", + "kind": "value", + "name": "bitwiseNot", + "docstrings": [ + "`bitwiseNot(n)` calculates the bitwise NOT of an integer.\n\n## Examples\n\n```rescript\nInt.bitwiseNot(2) == -3\n```" + ], + "signature": "let bitwiseNot: int => int" + }, + { + "id": "Stdlib.Int.shiftLeft", + "kind": "value", + "name": "shiftLeft", + "docstrings": [ + "`shiftLeft(n, length)` calculates the shifted value of an integer `n` by `length` bits to the left.\n\n## Examples\n\n```rescript\nInt.shiftLeft(4, 1) == 8\n```" + ], + "signature": "let shiftLeft: (int, int) => int" + }, + { + "id": "Stdlib.Int.shiftRight", + "kind": "value", + "name": "shiftRight", + "docstrings": [ + "`shiftRight(n, length)` calculates the shifted value of an integer `n` by `length` bits to the right.\n\nAlso known as \"arithmetic right shift\" operation.\n\n## Examples\n\n```rescript\nInt.shiftRight(8, 1) == 4\n```" + ], + "signature": "let shiftRight: (int, int) => int" + }, + { + "id": "Stdlib.Int.shiftRightUnsigned", + "kind": "value", + "name": "shiftRightUnsigned", + "docstrings": [ + "`shiftRightUnsigned(n, length)` calculates the shifted value of an integer `n` by `length` bits to the right.\nExcess bits shifted off to the right are discarded, and zero bits are shifted in from the left.\n\nAlso known as \"zero-filling right shift\" operation.\n\n## Examples\n\n```rescript\nInt.shiftRightUnsigned(4, 1) == 2\n```" + ], + "signature": "let shiftRightUnsigned: (int, int) => int" + }, + { + "id": "Stdlib.Int.ignore", + "kind": "value", + "name": "ignore", + "docstrings": [ + "`ignore(int)` ignores the provided int and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." + ], + "signature": "let ignore: int => unit" } ] }, - "core/float": { - "id": "Core.Float", + "stdlib/float": { + "id": "Stdlib.Float", "name": "Float", "docstrings": [ "Functions for interacting with float." ], "items": [ { - "id": "Core.Float.equal", + "id": "Stdlib.Float.t", + "kind": "type", + "name": "t", + "docstrings": [ + "Type representing a float." + ], + "signature": "type t = float" + }, + { + "id": "Stdlib.Float.equal", "kind": "value", "name": "equal", "docstrings": [], "signature": "let equal: (float, float) => bool" }, { - "id": "Core.Float.compare", + "id": "Stdlib.Float.compare", "kind": "value", "name": "compare", "docstrings": [], - "signature": "let compare: (float, float) => Core__Ordering.t" + "signature": "let compare: (float, float) => Ordering.t" }, { - "id": "Core.Float.isNaN", + "id": "Stdlib.Float.isNaN", "kind": "value", "name": "isNaN", "docstrings": [ @@ -7413,7 +8660,7 @@ "signature": "let isNaN: float => bool" }, { - "id": "Core.Float.isFinite", + "id": "Stdlib.Float.isFinite", "kind": "value", "name": "isFinite", "docstrings": [ @@ -7422,7 +8669,7 @@ "signature": "let isFinite: float => bool" }, { - "id": "Core.Float.parseFloat", + "id": "Stdlib.Float.parseFloat", "kind": "value", "name": "parseFloat", "docstrings": [ @@ -7431,7 +8678,7 @@ "signature": "let parseFloat: string => float" }, { - "id": "Core.Float.parseInt", + "id": "Stdlib.Float.parseInt", "kind": "value", "name": "parseInt", "docstrings": [ @@ -7440,7 +8687,7 @@ "signature": "let parseInt: ('a, ~radix: int=?) => float" }, { - "id": "Core.Float.parseIntWithRadix", + "id": "Stdlib.Float.parseIntWithRadix", "kind": "value", "name": "parseIntWithRadix", "docstrings": [ @@ -7450,7 +8697,7 @@ "deprecated": "Use `parseInt` instead" }, { - "id": "Core.Float.toExponential", + "id": "Stdlib.Float.toExponential", "kind": "value", "name": "toExponential", "docstrings": [ @@ -7459,7 +8706,7 @@ "signature": "let toExponential: (float, ~digits: int=?) => string" }, { - "id": "Core.Float.toExponentialWithPrecision", + "id": "Stdlib.Float.toExponentialWithPrecision", "kind": "value", "name": "toExponentialWithPrecision", "docstrings": [ @@ -7469,7 +8716,7 @@ "deprecated": "Use `toExponential` instead" }, { - "id": "Core.Float.toFixed", + "id": "Stdlib.Float.toFixed", "kind": "value", "name": "toFixed", "docstrings": [ @@ -7478,7 +8725,7 @@ "signature": "let toFixed: (float, ~digits: int=?) => string" }, { - "id": "Core.Float.toFixedWithPrecision", + "id": "Stdlib.Float.toFixedWithPrecision", "kind": "value", "name": "toFixedWithPrecision", "docstrings": [ @@ -7488,7 +8735,7 @@ "deprecated": "Use `toFixed` instead" }, { - "id": "Core.Float.toPrecision", + "id": "Stdlib.Float.toPrecision", "kind": "value", "name": "toPrecision", "docstrings": [ @@ -7497,7 +8744,7 @@ "signature": "let toPrecision: (float, ~digits: int=?) => string" }, { - "id": "Core.Float.toPrecisionWithPrecision", + "id": "Stdlib.Float.toPrecisionWithPrecision", "kind": "value", "name": "toPrecisionWithPrecision", "docstrings": [ @@ -7507,7 +8754,7 @@ "deprecated": "Use `toPrecision` instead" }, { - "id": "Core.Float.toString", + "id": "Stdlib.Float.toString", "kind": "value", "name": "toString", "docstrings": [ @@ -7516,7 +8763,7 @@ "signature": "let toString: (float, ~radix: int=?) => string" }, { - "id": "Core.Float.toStringWithRadix", + "id": "Stdlib.Float.toStringWithRadix", "kind": "value", "name": "toStringWithRadix", "docstrings": [ @@ -7526,7 +8773,7 @@ "deprecated": "Use `toString` with `~radix` instead" }, { - "id": "Core.Float.toLocaleString", + "id": "Stdlib.Float.toLocaleString", "kind": "value", "name": "toLocaleString", "docstrings": [ @@ -7535,7 +8782,7 @@ "signature": "let toLocaleString: float => string" }, { - "id": "Core.Float.fromString", + "id": "Stdlib.Float.fromString", "kind": "value", "name": "fromString", "docstrings": [ @@ -7544,7 +8791,7 @@ "signature": "let fromString: string => option" }, { - "id": "Core.Float.toInt", + "id": "Stdlib.Float.toInt", "kind": "value", "name": "toInt", "docstrings": [ @@ -7553,7 +8800,7 @@ "signature": "let toInt: float => int" }, { - "id": "Core.Float.fromInt", + "id": "Stdlib.Float.fromInt", "kind": "value", "name": "fromInt", "docstrings": [ @@ -7562,7 +8809,7 @@ "signature": "let fromInt: int => float" }, { - "id": "Core.Float.mod", + "id": "Stdlib.Float.mod", "kind": "value", "name": "mod", "docstrings": [ @@ -7571,284 +8818,478 @@ "signature": "let mod: (float, float) => float" }, { - "id": "Core.Float.clamp", + "id": "Stdlib.Float.clamp", "kind": "value", "name": "clamp", "docstrings": [ "`clamp(~min=?, ~max=?, value)` returns `value`, optionally bounded by `min` and `max`.\n\nif `max` < `min` returns `min`.\n\n## Examples\n\n```rescript\nFloat.clamp(4.2) == 4.2\nFloat.clamp(4.2, ~min=4.3) == 4.3\nFloat.clamp(4.2, ~max=4.1) == 4.1\nFloat.clamp(4.2, ~min=4.3, ~max=4.1) == 4.3\n```" ], "signature": "let clamp: (~min: float=?, ~max: float=?, float) => float" + }, + { + "id": "Stdlib.Float.ignore", + "kind": "value", + "name": "ignore", + "docstrings": [ + "`ignore(float)` ignores the provided float and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." + ], + "signature": "let ignore: float => unit" } ] }, - "core/error": { - "id": "Core.Error", + "stdlib/error": { + "id": "Stdlib.Error", "name": "Error", "docstrings": [ "Functions for working with JavaScript exceptions.\n\nSee [`Error`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) on MDN." ], "items": [ { - "id": "Core.Error.t", + "id": "Stdlib.Error.t", "kind": "type", "name": "t", "docstrings": [ "Represents a JavaScript exception." ], - "signature": "type t = Js.Exn.t" + "signature": "type t = Exn.t", + "deprecated": "Use `JsError.t` instead" }, { - "id": "Core.Error.fromException", + "id": "Stdlib.Error.fromException", "kind": "value", "name": "fromException", "docstrings": [], - "signature": "let fromException: exn => option" + "signature": "let fromException: exn => option", + "deprecated": "Use `JsExn.fromException` instead" }, { - "id": "Core.Error.toException", + "id": "Stdlib.Error.toException", "kind": "value", "name": "toException", "docstrings": [ "Turns an `Error.t` into an `exn`.\n\n## Examples\n```rescript\nlet error = Error.make(\"Something went wrong.\")\n\nlet asExn = error->Error.toException // `asExn` is now type `exn`\n```" ], - "signature": "let toException: t => exn" + "signature": "let toException: t => exn", + "deprecated": "Use functions from `JsExn` instead" }, { - "id": "Core.Error.stack", + "id": "Stdlib.Error.stack", "kind": "value", "name": "stack", "docstrings": [ "`stack(error)` retrieves the `stack` property of the error, if it exists. The stack is a list of what functions were called, and what files they are defined in, prior to the error happening.\n\nSee [`Error.prototype.stack`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/Stack) on MDN.\n\n## Example\n```rescript\nlet error = Error.make(\"error\")\nConsole.log(error->Error.stack) // Logs `stack` if it exists on `someError`\n```" ], - "signature": "let stack: t => option" + "signature": "let stack: t => option", + "deprecated": "Use `JsError.stack` instead" }, { - "id": "Core.Error.message", + "id": "Stdlib.Error.message", "kind": "value", "name": "message", "docstrings": [ "`message(error)` retrieves the `message` property of the error, if it exists.\n\nSee [`Error.prototype.message`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/message) on MDN.\n\n## Example\n```rescript\nlet error = Error.SyntaxError.make(\"Some message here\")\nConsole.log(error->Error.message) // Logs \"Some message here\" to the console\n```" ], - "signature": "let message: t => option" + "signature": "let message: t => option", + "deprecated": "Use `JsError.message` instead" }, { - "id": "Core.Error.name", + "id": "Stdlib.Error.name", "kind": "value", "name": "name", "docstrings": [ "`name(error)` retrieves the `name` property of the error, if it exists.\n\nSee [`Error.prototype.name`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/name) on MDN.\n\n## Example\n```rescript\nlet error = Error.SyntaxError.make(\"Some message here\")\nConsole.log(error->Error.name) // Logs \"SyntaxError\" to the console\n```" ], - "signature": "let name: t => option" + "signature": "let name: t => option", + "deprecated": "Use `JsError.name` instead" }, { - "id": "Core.Error.fileName", + "id": "Stdlib.Error.fileName", "kind": "value", "name": "fileName", "docstrings": [ "`fileName(error)` retrieves the `fileName` property of the error, if it exists.\n\nSee [`Error.prototype.fileName`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/fileName) on MDN." ], - "signature": "let fileName: t => option" + "signature": "let fileName: t => option", + "deprecated": "Use `JsError.fileName` instead" }, { - "id": "Core.Error.make", + "id": "Stdlib.Error.make", "kind": "value", "name": "make", "docstrings": [ "`make(message)` creates a new error, setting its `message` to the provided value.\n\nSee [`Error`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/Error) on MDN.\n\n## Example\n```rescript\nlet error = Error.make(\"Some message here\")\nConsole.log(error->Error.message) // Logs \"Some message here\" to the console\nConsole.log(error->Error.name) // Logs \"Error\" to the console, because this is a regular error\n```" ], - "signature": "let make: string => t" + "signature": "let make: string => t", + "deprecated": "Use `JsError.make` instead" }, { - "id": "Core.Error.raise", + "id": "Stdlib.Error.raise", "kind": "value", "name": "raise", "docstrings": [ "Raises (throws in JavaScript language) the provided `Error.t`, which will stop execution.\n\n## Examples\n```rescript\nlet error = Error.make(\"Everything is upside down.\")\n\nif 5 > 10 {\n error->Error.raise\n} else {\n Console.log(\"Phew, sanity still rules.\")\n}\n```" ], - "signature": "let raise: t => 'a" + "signature": "let raise: t => 'a", + "deprecated": "`raise` has been renamed to `throw` to align with JavaScript vocabulary. Please use `JsError.throw` instead" + }, + { + "id": "Stdlib.Error.throw", + "kind": "value", + "name": "throw", + "docstrings": [ + "Raises the given exception, terminating execution unless caught by a surrounding try/catch block.\n\n## Examples\n\n```rescript\nlet error = Error.make(\"Everything is upside down.\")\n\nif 5 > 10 {\n Error.throw(error)\n} else {\n Console.log(\"Phew, sanity still rules.\")\n}\n```" + ], + "signature": "let throw: t => 'a", + "deprecated": "Use `JsError.throw` instead" }, { - "id": "Core.Error.panic", + "id": "Stdlib.Error.panic", "kind": "value", "name": "panic", "docstrings": [ - "Raises a panic exception with the given message.\n\nA panic exception is a native JavaScript exception that is not intended to be caught and\nhandled. Compared to a ReScript exception this will give a better stack trace and\ndebugging experience.\n\n## Examples\n```rescript\nError.panic(\"Uh oh. This was unexpected!\")\n```" + "Raises a panic exception with the given message.\n\nA panic exception is a native JavaScript exception that is not intended to be caught and\nhandled. Compared to a ReScript exception this will give a better stack trace and\ndebugging experience.\n\n## Examples\n\n```rescript\ntry {\n Error.panic(\"Uh oh. This was unexpected!\")\n} catch {\n| Exn.Error(obj) =>\n switch Exn.message(obj) {\n | Some(m) => assert(m == \"Panic! Uh oh. This was unexpected!\")\n | None => assert(false)\n }\n| _ => assert(false)\n}\n```" ], - "signature": "let panic: string => 'a" + "signature": "let panic: string => 'a", + "deprecated": "Use `JsError.panic` instead" + }, + { + "id": "Stdlib.Error.ignore", + "kind": "value", + "name": "ignore", + "docstrings": [ + "`ignore(error)` ignores the provided error and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." + ], + "signature": "let ignore: t => unit", + "deprecated": "Use `JsError.ignore` instead" + } + ] + }, + "stdlib/exn": { + "id": "Stdlib.Exn", + "name": "Exn", + "docstrings": [ + "Provide utilities for dealing with JS exceptions." + ], + "items": [ + { + "id": "Stdlib.Exn.t", + "kind": "type", + "name": "t", + "docstrings": [ + "Represents a JS exception" + ], + "signature": "type t", + "deprecated": "Use `JsExn.t` instead" + }, + { + "id": "Stdlib.Exn.asJsExn", + "kind": "value", + "name": "asJsExn", + "docstrings": [], + "signature": "let asJsExn: exn => option", + "deprecated": "Use `JsExn.fromException` instead" + }, + { + "id": "Stdlib.Exn.stack", + "kind": "value", + "name": "stack", + "docstrings": [], + "signature": "let stack: t => option", + "deprecated": "Use `JsExn.stack` instead" + }, + { + "id": "Stdlib.Exn.message", + "kind": "value", + "name": "message", + "docstrings": [], + "signature": "let message: t => option", + "deprecated": "Use `JsExn.message` instead" + }, + { + "id": "Stdlib.Exn.name", + "kind": "value", + "name": "name", + "docstrings": [], + "signature": "let name: t => option", + "deprecated": "Use `JsExn.name` instead" + }, + { + "id": "Stdlib.Exn.fileName", + "kind": "value", + "name": "fileName", + "docstrings": [], + "signature": "let fileName: t => option", + "deprecated": "Use `JsExn.fileName` instead" + }, + { + "id": "Stdlib.Exn.anyToExnInternal", + "kind": "value", + "name": "anyToExnInternal", + "docstrings": [ + "`anyToExnInternal(obj)` will take any value `obj` and wrap it\nin a Exn.Error if given value is not an exn already. If\n`obj` is an exn, it will return `obj` without any changes.\n\nThis function is mostly useful for cases where you want to unify a type of a value\nthat potentially is either exn, a JS error, or any other JS value really (e.g. for\na value passed to a Promise.catch callback)\n\n**IMPORTANT**: This is an internal API and may be changed / removed any time in the future." + ], + "signature": "let anyToExnInternal: 'a => exn", + "deprecated": "Use `JsExn.anyToExnInternal` instead" + }, + { + "id": "Stdlib.Exn.raiseError", + "kind": "value", + "name": "raiseError", + "docstrings": [ + "Raise Js exception Error object with stacktrace" + ], + "signature": "let raiseError: string => 'a", + "deprecated": "Use `JsError.throwWithMessage` instead" + }, + { + "id": "Stdlib.Exn.raiseEvalError", + "kind": "value", + "name": "raiseEvalError", + "docstrings": [], + "signature": "let raiseEvalError: string => 'a", + "deprecated": "Use `JsError.EvalError.throwWithMessage` instead" + }, + { + "id": "Stdlib.Exn.raiseRangeError", + "kind": "value", + "name": "raiseRangeError", + "docstrings": [], + "signature": "let raiseRangeError: string => 'a", + "deprecated": "Use `JsError.RangeError.throwWithMessage` instead" + }, + { + "id": "Stdlib.Exn.raiseReferenceError", + "kind": "value", + "name": "raiseReferenceError", + "docstrings": [], + "signature": "let raiseReferenceError: string => 'a", + "deprecated": "Use `JsError.ReferenceError.throwWithMessage` instead" + }, + { + "id": "Stdlib.Exn.raiseSyntaxError", + "kind": "value", + "name": "raiseSyntaxError", + "docstrings": [], + "signature": "let raiseSyntaxError: string => 'a", + "deprecated": "Use `JsError.SyntaxError.throwWithMessage` instead" + }, + { + "id": "Stdlib.Exn.raiseTypeError", + "kind": "value", + "name": "raiseTypeError", + "docstrings": [], + "signature": "let raiseTypeError: string => 'a", + "deprecated": "Use `JsError.TypeError.throwWithMessage` instead" + }, + { + "id": "Stdlib.Exn.raiseUriError", + "kind": "value", + "name": "raiseUriError", + "docstrings": [], + "signature": "let raiseUriError: string => 'a", + "deprecated": "Use `JsError.URIError.throwWithMessage` instead" + }, + { + "id": "Stdlib.Exn.ignore", + "kind": "value", + "name": "ignore", + "docstrings": [ + "`ignore(exn)` ignores the provided exn and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." + ], + "signature": "let ignore: t => unit", + "deprecated": "Use `JsExn.ignore` instead" } ] }, - "core/dict": { - "id": "Core.Dict", + "stdlib/dict": { + "id": "Stdlib.Dict", "name": "Dict", "docstrings": [ "A mutable dictionary with string keys.\n\nCompiles to a regular JavaScript object." ], "items": [ { - "id": "Core.Dict.t", + "id": "Stdlib.Dict.t", "kind": "type", "name": "t", "docstrings": [ "Type representing a dictionary of value `'a`." ], - "signature": "type t<'a> = Js.Dict.t<'a>" + "signature": "type t<'a> = dict<'a>" }, { - "id": "Core.Dict.getUnsafe", + "id": "Stdlib.Dict.getUnsafe", "kind": "value", "name": "getUnsafe", "docstrings": [ - "`getUnsafe(dict, key)` Returns the `value` at the provided `key`.\n\nThis is _unsafe_, meaning it will return `undefined` value if `key` does not exist in `dict`.\n\nUse `Dict.getUnsafe` only when you are sure the key exists (i.e. when iterating `Dict.keys` result).\n\n## Examples\n```rescript\nlet dict = Dict.fromArray([(\"key1\", \"value1\"), (\"key2\", \"value2\")])\nlet value = dict->Dict.getUnsafe(\"key1\")\nConsole.log(value) // value1\n```" + "`getUnsafe(dict, key)` Returns the `value` at the provided `key`.\n\nThis is _unsafe_, meaning it will return `undefined` value if `key` does not exist in `dict`.\n\nUse `Dict.getUnsafe` only when you are sure the key exists (i.e. when iterating `Dict.keys` result).\n\n## Examples\n```rescript\nlet dict = dict{\"key1\": \"value1\", \"key2\": \"value2\"}\nlet value = dict->Dict.getUnsafe(\"key1\")\nConsole.log(value) // value1\n```" ], - "signature": "let getUnsafe: (t<'a>, string) => 'a" + "signature": "let getUnsafe: (dict<'a>, string) => 'a" }, { - "id": "Core.Dict.get", + "id": "Stdlib.Dict.get", "kind": "value", "name": "get", "docstrings": [ - "Returns the value at the provided key, if it exists. Returns an option.\n\n## Examples\n```rescript\nlet dict = Dict.fromArray([(\"someKey\", \"someValue\")])\n\nswitch dict->Dict.get(\"someKey\") {\n| None => Console.log(\"Nope, didn't have the key.\")\n| Some(value) => Console.log(value)\n}\n```" + "Returns the value at the provided key, if it exists. Returns an option.\n\n## Examples\n```rescript\nlet dict = dict{\"someKey\": \"someValue\"}\n\nswitch dict->Dict.get(\"someKey\") {\n| None => Console.log(\"Nope, didn't have the key.\")\n| Some(value) => Console.log(value)\n}\n```" ], - "signature": "let get: (t<'a>, string) => option<'a>" + "signature": "let get: (dict<'a>, string) => option<'a>" }, { - "id": "Core.Dict.set", + "id": "Stdlib.Dict.set", "kind": "value", "name": "set", "docstrings": [ "`set(dictionary, key, value)` sets the value at the provided key to the provided value.\n\n## Examples\n```rescript\nlet dict = Dict.make()\n\ndict->Dict.set(\"someKey\", \"someValue\")\n```" ], - "signature": "let set: (t<'a>, string, 'a) => unit" + "signature": "let set: (dict<'a>, string, 'a) => unit" }, { - "id": "Core.Dict.delete", + "id": "Stdlib.Dict.delete", "kind": "value", "name": "delete", "docstrings": [ - "`delete(dictionary, key)` deletes the value at `key`, if it exists.\n\n## Examples\n```rescript\nlet dict = Dict.fromArray([(\"someKey\", \"someValue\")])\n\ndict->Dict.delete(\"someKey\")\n```" + "`delete(dictionary, key)` deletes the value at `key`, if it exists.\n\n## Examples\n```rescript\nlet dict = dict{\"someKey\": \"someValue\"}\n\ndict->Dict.delete(\"someKey\")\n```" ], - "signature": "let delete: (t<'a>, string) => unit" + "signature": "let delete: (dict<'a>, string) => unit" }, { - "id": "Core.Dict.make", + "id": "Stdlib.Dict.make", "kind": "value", "name": "make", "docstrings": [ - "`make()` creates a new, empty dictionary.\n\n## Examples\n```rescript\nlet dict1: Dict.t = Dict.make() // You can annotate the type of the values of your dict yourself if you want\n\nlet dict2 = Dict.make() // Or you can let ReScript infer it via usage.\ndict2->Dict.set(\"someKey\", 12)\n```" + "`make()` creates a new, empty dictionary.\n\n## Examples\n```rescript\nlet dict1: dict = Dict.make() // You can annotate the type of the values of your dict yourself if you want\n\nlet dict2 = Dict.make() // Or you can let ReScript infer it via usage.\ndict2->Dict.set(\"someKey\", 12)\n```" ], - "signature": "let make: unit => t<'a>" + "signature": "let make: unit => dict<'a>" }, { - "id": "Core.Dict.fromArray", + "id": "Stdlib.Dict.fromArray", "kind": "value", "name": "fromArray", "docstrings": [ "`fromArray(entries)` creates a new dictionary from the provided array of key/value pairs.\n\n## Examples\n```rescript\nlet dict = Dict.fromArray([(\"key1\", \"value1\"), (\"key2\", \"value2\")])\n```" ], - "signature": "let fromArray: array<(string, 'a)> => t<'a>" + "signature": "let fromArray: array<(string, 'a)> => dict<'a>" }, { - "id": "Core.Dict.fromIterator", + "id": "Stdlib.Dict.fromIterator", "kind": "value", "name": "fromIterator", "docstrings": [ - "`fromIterator(entries)` creates a new dictionary from the provided iterator of key/value pairs.\n\n## Examples\n```rescript\n// Pretend we have an iterator of the correct shape\n@val external someIterator: Iterator.t<(string, int)> = \"someIterator\"\n\nlet dict = Dict.fromIterator(someIterator) // Dict.t\n```" + "`fromIterator(entries)` creates a new dictionary from the provided iterator of key/value pairs.\n\n## Examples\n\n```rescript\nlet iterator: Iterator.t<(string, int)> = %raw(`\n (() => {\n var map1 = new Map();\n map1.set('first', 1);\n map1.set('second', 2);\n var iterator1 = map1[Symbol.iterator]();\n return iterator1;\n })()\n`)\niterator\n->Dict.fromIterator\n->Dict.valuesToArray\n->assertEqual([1, 2])\n```" ], - "signature": "let fromIterator: Core__Iterator.t<(string, 'a)> => t<'a>" + "signature": "let fromIterator: Iterator.t<(string, 'a)> => dict<'a>" }, { - "id": "Core.Dict.toArray", + "id": "Stdlib.Dict.toArray", "kind": "value", "name": "toArray", "docstrings": [ "`toArray(dictionary)` returns an array of all the key/value pairs of the dictionary.\n\n## Examples\n```rescript\nlet dict = Dict.make()\ndict->Dict.set(\"someKey\", 1)\ndict->Dict.set(\"someKey2\", 2)\nlet asArray = dict->Dict.toArray\nConsole.log(asArray) // Logs `[[\"someKey\", 1], [\"someKey2\", 2]]` to the console\n```" ], - "signature": "let toArray: t<'a> => array<(string, 'a)>" + "signature": "let toArray: dict<'a> => array<(string, 'a)>" }, { - "id": "Core.Dict.keysToArray", + "id": "Stdlib.Dict.keysToArray", "kind": "value", "name": "keysToArray", "docstrings": [ "`keysToArray(dictionary)` returns an array of all the keys of the dictionary.\n\n## Examples\n```rescript\nlet dict = Dict.make()\ndict->Dict.set(\"someKey\", 1)\ndict->Dict.set(\"someKey2\", 2)\nlet keys = dict->Dict.keysToArray\nConsole.log(keys) // Logs `[\"someKey\", \"someKey2\"]` to the console\n```" ], - "signature": "let keysToArray: t<'a> => array" + "signature": "let keysToArray: dict<'a> => array" }, { - "id": "Core.Dict.valuesToArray", + "id": "Stdlib.Dict.valuesToArray", "kind": "value", "name": "valuesToArray", "docstrings": [ "`valuesToArray(dictionary)` returns an array of all the values of the dictionary.\n\n## Examples\n```rescript\nlet dict = Dict.make()\ndict->Dict.set(\"someKey\", 1)\ndict->Dict.set(\"someKey2\", 2)\nlet values = dict->Dict.valuesToArray\nConsole.log(values) // Logs `[1, 2]` to the console\n```" ], - "signature": "let valuesToArray: t<'a> => array<'a>" + "signature": "let valuesToArray: dict<'a> => array<'a>" }, { - "id": "Core.Dict.assign", + "id": "Stdlib.Dict.assign", "kind": "value", "name": "assign", "docstrings": [ "`assign(dictionary1, dictionary2)` [shallowly](https://developer.mozilla.org/en-US/docs/Glossary/Shallow_copy) merges dictionary2 into dictionary1, and returns dictionary1.\n\nBeware this will *mutate* dictionary1. If you're looking for a way to copy a dictionary, check out `Dict.copy`.\n\n## Examples\n```rescript\nlet dict1 = Dict.make()\ndict1->Dict.set(\"firstKey\", 1)\nConsole.log(dict1->Dict.keysToArray) // Logs `[\"firstKey\"]`\n\nlet dict2 = Dict.make()\ndict2->Dict.set(\"someKey\", 2)\ndict2->Dict.set(\"someKey2\", 3)\n\nlet dict1 = dict1->Dict.assign(dict2)\n\nConsole.log(dict1->Dict.keysToArray) // Logs `[\"firstKey\", \"someKey\", \"someKey2\"]`\n\n```" ], - "signature": "let assign: (t<'a>, t<'a>) => t<'a>" + "signature": "let assign: (dict<'a>, dict<'a>) => dict<'a>" }, { - "id": "Core.Dict.copy", + "id": "Stdlib.Dict.copy", "kind": "value", "name": "copy", "docstrings": [ - "`copy(dictionary)` [shallowly copies](https://developer.mozilla.org/en-US/docs/Glossary/Shallow_copy) the provided dictionary to a new dictionary.\n\n## Examples\n```rescript\nlet dict = Dict.fromArray([(\"key1\", \"value1\"), (\"key2\", \"value2\")])\nlet dict2 = dict->Dict.copy\n\n// Both log `[\"key1\", \"key2\"]` here.\nConsole.log2(dict->Dict.keysToArray, dict2->Dict.keysToArray)\n```" + "`copy(dictionary)` [shallowly copies](https://developer.mozilla.org/en-US/docs/Glossary/Shallow_copy) the provided dictionary to a new dictionary.\n\n## Examples\n```rescript\nlet dict = dict{\"key1\": \"value1\", \"key2\": \"value2\"}\nlet dict2 = dict->Dict.copy\n\n// Both log `[\"key1\", \"key2\"]` here.\nConsole.log2(dict->Dict.keysToArray, dict2->Dict.keysToArray)\n```" ], - "signature": "let copy: t<'a> => t<'a>" + "signature": "let copy: dict<'a> => dict<'a>" }, { - "id": "Core.Dict.forEach", + "id": "Stdlib.Dict.forEach", "kind": "value", "name": "forEach", "docstrings": [ - "`forEach(dictionary, f)` iterates through all values of the dict.\n\n> Please note that this is *without the keys*, just the values. If you need the key as well, use `Dict.forEachWithKey`.\n\n## Examples\n```rescript\nlet dict = Dict.fromArray([(\"key1\", \"value1\"), (\"key2\", \"value2\")])\n\ndict->Dict.forEach(value => {\n Console.log(value)\n})\n```" + "`forEach(dictionary, f)` iterates through all values of the dict.\n\n> Please note that this is *without the keys*, just the values. If you need the key as well, use `Dict.forEachWithKey`.\n\n## Examples\n```rescript\nlet dict = dict{\"key1\": \"value1\", \"key2\": \"value2\"}\n\ndict->Dict.forEach(value => {\n Console.log(value)\n})\n```" ], - "signature": "let forEach: (t<'a>, 'a => unit) => unit" + "signature": "let forEach: (dict<'a>, 'a => unit) => unit" }, { - "id": "Core.Dict.forEachWithKey", + "id": "Stdlib.Dict.forEachWithKey", "kind": "value", "name": "forEachWithKey", "docstrings": [ - "`forEachWithKey(dictionary, f)` iterates through all values of the dict, including the key for each value.\n\n## Examples\n```rescript\nlet dict = Dict.fromArray([(\"key1\", \"value1\"), (\"key2\", \"value2\")])\n\ndict->Dict.forEachWithKey((value, key) => {\n Console.log2(value, key)\n})\n```" + "`forEachWithKey(dictionary, f)` iterates through all values of the dict, including the key for each value.\n\n## Examples\n```rescript\nlet dict = dict{\"key1\": \"value1\", \"key2\": \"value2\"}\n\ndict->Dict.forEachWithKey((value, key) => {\n Console.log2(value, key)\n})\n```" + ], + "signature": "let forEachWithKey: (dict<'a>, ('a, string) => unit) => unit" + }, + { + "id": "Stdlib.Dict.mapValues", + "kind": "value", + "name": "mapValues", + "docstrings": [ + "`mapValues(dictionary, f)` returns a new dictionary with the same keys, and `f` applied to each value in the original dictionary.\n\n## Examples\n\n```rescript\nlet dict = dict{\"key1\": 1, \"key2\": 2}\n\ndict->Dict.mapValues(v => v + 10)->Dict.toArray // [(\"key1\", 11), (\"key2\", 12)]\ndict->Dict.mapValues(v => Int.toString(v))->Dict.toArray // [(\"key1\", \"1\"), (\"key2\", \"2\")]\n```" + ], + "signature": "let mapValues: (dict<'a>, 'a => 'b) => dict<'b>" + }, + { + "id": "Stdlib.Dict.has", + "kind": "value", + "name": "has", + "docstrings": [ + "`has(dictionary, \"key\")` returns true if the \"key\" is present in the dictionary.\n\nBe aware that it uses the JavaScript `in` operator under the hood.\n\n## Examples\n\n```rescript\nlet dict = dict{\"key1\": Some(1), \"key2\": None}\n\ndict->Dict.has(\"key1\")->assertEqual(true)\ndict->Dict.has(\"key2\")->assertEqual(true)\ndict->Dict.has(\"key3\")->assertEqual(false)\ndict->Dict.has(\"toString\")->assertEqual(true)\n```" ], - "signature": "let forEachWithKey: (t<'a>, ('a, string) => unit) => unit" + "signature": "let has: (dict<'a>, string) => bool" }, { - "id": "Core.Dict.mapValues", + "id": "Stdlib.Dict.ignore", "kind": "value", - "name": "mapValues", + "name": "ignore", "docstrings": [ - "`mapValues(dictionary, f)` returns a new dictionary with the same keys, and `f` applied to each value in the original dictionary.\n\n## Examples\n\n```rescript\nlet dict = Dict.fromArray([(\"key1\", 1), (\"key2\", 2)])\n\ndict->Dict.mapValues(v => v + 10)->Dict.toArray // [(\"key1\", 11), (\"key2\", 12)]\ndict->Dict.mapValues(v => Int.toString(v))->Dict.toArray // [(\"key1\", \"1\"), (\"key2\", \"2\")]\n```" + "`ignore(dict)` ignores the provided dict and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." ], - "signature": "let mapValues: (t<'a>, 'a => 'b) => t<'b>" + "signature": "let ignore: dict<'a> => unit" } ] }, - "core/date": { - "id": "Core.Date", + "stdlib/date": { + "id": "Stdlib.Date", "name": "Date", "docstrings": [ "Functions for interacting with JavaScript Dates." ], "items": [ { - "id": "Core.Date.t", + "id": "Stdlib.Date.t", "kind": "type", "name": "t", "docstrings": [ "A type representing a JavaScript date." ], - "signature": "type t = Js.Date.t" + "signature": "type t" }, { - "id": "Core.Date.msSinceEpoch", + "id": "Stdlib.Date.msSinceEpoch", "kind": "type", "name": "msSinceEpoch", "docstrings": [ @@ -7857,7 +9298,7 @@ "signature": "type msSinceEpoch = float" }, { - "id": "Core.Date.localeOptions", + "id": "Stdlib.Date.localeOptions", "kind": "type", "name": "localeOptions", "docstrings": [ @@ -7866,7 +9307,7 @@ "signature": "type localeOptions = {\n dateStyle?: [#full | #long | #medium | #short],\n timeStyle?: [#full | #long | #medium | #short],\n weekday?: [#long | #narrow | #short],\n era?: [#long | #narrow | #short],\n year?: [#\"2-digit\" | #numeric],\n month?: [\n | #\"2-digit\"\n | #long\n | #narrow\n | #numeric\n | #short\n ],\n day?: [#\"2-digit\" | #numeric],\n hour?: [#\"2-digit\" | #numeric],\n minute?: [#\"2-digit\" | #numeric],\n second?: [#\"2-digit\" | #numeric],\n timeZoneName?: [#long | #short],\n}" }, { - "id": "Core.Date.make", + "id": "Stdlib.Date.make", "kind": "value", "name": "make", "docstrings": [ @@ -7875,7 +9316,7 @@ "signature": "let make: unit => t" }, { - "id": "Core.Date.fromString", + "id": "Stdlib.Date.fromString", "kind": "value", "name": "fromString", "docstrings": [ @@ -7884,7 +9325,7 @@ "signature": "let fromString: string => t" }, { - "id": "Core.Date.fromTime", + "id": "Stdlib.Date.fromTime", "kind": "value", "name": "fromTime", "docstrings": [ @@ -7893,7 +9334,7 @@ "signature": "let fromTime: msSinceEpoch => t" }, { - "id": "Core.Date.makeWithYM", + "id": "Stdlib.Date.makeWithYM", "kind": "value", "name": "makeWithYM", "docstrings": [ @@ -7902,52 +9343,52 @@ "signature": "let makeWithYM: (~year: int, ~month: int) => t" }, { - "id": "Core.Date.makeWithYMD", + "id": "Stdlib.Date.makeWithYMD", "kind": "value", "name": "makeWithYMD", "docstrings": [ - "Creates a date object with the given year, month and date (day of month).\nBe aware of using a value for year < 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#interpretation_of_two-digit_years).\nMonths are 0-indexed (0 = January, 11 = December).\nValues, which are out of range, will be carried over to the next bigger unit (s. example).\n\n## Examples\n```rescript\nDate.makeWithYMD(~year=2023, ~month=1, ~date=20)\n// 2023-02-20T00:00:00.000Z\n\nDate.makeWithYMD(~year=2023, ~month=1, ~date=-1)\n// 2022-11-29T00:00:00.000Z\n\nDate.makeWithYMD(~year=2023, ~month=1, ~date=29)\n// 2023-03-01T00:00:00.000Z\n```" + "Creates a date object with the given year, month and date (day of month).\nBe aware of using a value for year < 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#interpretation_of_two-digit_years).\nMonths are 0-indexed (0 = January, 11 = December).\nValues, which are out of range, will be carried over to the next bigger unit (s. example).\n\n## Examples\n```rescript\nDate.makeWithYMD(~year=2023, ~month=1, ~day=20)\n// 2023-02-20T00:00:00.000Z\n\nDate.makeWithYMD(~year=2023, ~month=1, ~day=-1)\n// 2022-11-29T00:00:00.000Z\n\nDate.makeWithYMD(~year=2023, ~month=1, ~day=29)\n// 2023-03-01T00:00:00.000Z\n```" ], - "signature": "let makeWithYMD: (~year: int, ~month: int, ~date: int) => t" + "signature": "let makeWithYMD: (~year: int, ~month: int, ~day: int) => t" }, { - "id": "Core.Date.makeWithYMDH", + "id": "Stdlib.Date.makeWithYMDH", "kind": "value", "name": "makeWithYMDH", "docstrings": [ - "Creates a date object with the given year, month, date (day of month) and hours.\nBe aware of using a value for year < 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#interpretation_of_two-digit_years).\nMonths are 0-indexed (0 = January, 11 = December).\nValues, which are out of range, will be carried over to the next bigger unit (s. example).\n\n## Examples\n```rescript\nDate.makeWithYMDH(~year=2023, ~month=1, ~date=20, ~hours=16)\n// 2023-02-20T16:00:00.000Z\n\nDate.makeWithYMDH(~year=2023, ~month=1, ~date=20, ~hours=24)\n// 2023-02-21T00:00:00.000Z\n\nDate.makeWithYMDH(~year=2023, ~month=1, ~date=20, ~hours=-1)\n// 2023-02-19T23:00:00.000Z\n\n// Note: The output depends on your local time zone.\n// In nodejs you can change it by using the TZ env (`export TZ='Europe/London' && node index.bs.js`)\n\n```" + "Creates a date object with the given year, month, date (day of month) and hours.\nBe aware of using a value for year < 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#interpretation_of_two-digit_years).\nMonths are 0-indexed (0 = January, 11 = December).\nValues, which are out of range, will be carried over to the next bigger unit (s. example).\n\n## Examples\n```rescript\nDate.makeWithYMDH(~year=2023, ~month=1, ~day=20, ~hours=16)\n// 2023-02-20T16:00:00.000Z\n\nDate.makeWithYMDH(~year=2023, ~month=1, ~day=20, ~hours=24)\n// 2023-02-21T00:00:00.000Z\n\nDate.makeWithYMDH(~year=2023, ~month=1, ~day=20, ~hours=-1)\n// 2023-02-19T23:00:00.000Z\n\n// Note: The output depends on your local time zone.\n// In nodejs you can change it by using the TZ env (`export TZ='Europe/London' && node index.bs.js`)\n\n```" ], - "signature": "let makeWithYMDH: (~year: int, ~month: int, ~date: int, ~hours: int) => t" + "signature": "let makeWithYMDH: (~year: int, ~month: int, ~day: int, ~hours: int) => t" }, { - "id": "Core.Date.makeWithYMDHM", + "id": "Stdlib.Date.makeWithYMDHM", "kind": "value", "name": "makeWithYMDHM", "docstrings": [ - "Creates a date object with the given year, month, date (day of month), hours and minutes.\nBe aware of using a value for year < 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#interpretation_of_two-digit_years).\nMonths are 0-indexed (0 = January, 11 = December).\nValues, which are out of range, will be carried over to the next bigger unit (s. example).\n\n## Examples\n```rescript\nDate.makeWithYMDHM(~year=2023, ~month=1, ~date=20, ~hours=16, ~minutes=40)\n// 2023-02-20T16:40:00.000Z\n\nDate.makeWithYMDHM(~year=2023, ~month=1, ~date=20, ~hours=16, ~minutes=60)\n// 2023-02-20T17:00:00.000Z\n\nDate.makeWithYMDHM(~year=2023, ~month=1, ~date=20, ~hours=16, ~minutes=-1)\n// 2023-02-20T15:59:00.000Z\n\n// Note: The output depends on your local time zone.\n// In nodejs you can change it by using the TZ env (`export TZ='Europe/London' && node index.bs.js`)\n\n```" + "Creates a date object with the given year, month, date (day of month), hours and minutes.\nBe aware of using a value for year < 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#interpretation_of_two-digit_years).\nMonths are 0-indexed (0 = January, 11 = December).\nValues, which are out of range, will be carried over to the next bigger unit (s. example).\n\n## Examples\n```rescript\nDate.makeWithYMDHM(~year=2023, ~month=1, ~day=20, ~hours=16, ~minutes=40)\n// 2023-02-20T16:40:00.000Z\n\nDate.makeWithYMDHM(~year=2023, ~month=1, ~day=20, ~hours=16, ~minutes=60)\n// 2023-02-20T17:00:00.000Z\n\nDate.makeWithYMDHM(~year=2023, ~month=1, ~day=20, ~hours=16, ~minutes=-1)\n// 2023-02-20T15:59:00.000Z\n\n// Note: The output depends on your local time zone.\n// In nodejs you can change it by using the TZ env (`export TZ='Europe/London' && node index.bs.js`)\n\n```" ], - "signature": "let makeWithYMDHM: (\n ~year: int,\n ~month: int,\n ~date: int,\n ~hours: int,\n ~minutes: int,\n) => t" + "signature": "let makeWithYMDHM: (\n ~year: int,\n ~month: int,\n ~day: int,\n ~hours: int,\n ~minutes: int,\n) => t" }, { - "id": "Core.Date.makeWithYMDHMS", + "id": "Stdlib.Date.makeWithYMDHMS", "kind": "value", "name": "makeWithYMDHMS", "docstrings": [ - "Creates a date object with the given year, month, date (day of month), hours, minutes and seconds.\nBe aware of using a value for year < 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#interpretation_of_two-digit_years).\nMonths are 0-indexed (0 = January, 11 = December).\nValues, which are out of range, will be carried over to the next bigger unit (s. example).\n\n## Examples\n```rescript\nDate.makeWithYMDHMS(~year=2023, ~month=1, ~date=20, ~hours=16, ~minutes=40, ~seconds=0)\n// 2023-02-20T16:40:00.000Z\n\nDate.makeWithYMDHMS(~year=2023, ~month=1, ~date=20, ~hours=16, ~minutes=40, ~seconds=60)\n// 2023-02-20T16:41:00.000Z\n\nDate.makeWithYMDHMS(~year=2023, ~month=1, ~date=20, ~hours=16, ~minutes=40, ~seconds=-1)\n// 2023-02-20T16:39:59.000Z\n\n// Note: The output depends on your local time zone.\n// In nodejs you can change it by using the TZ env (`export TZ='Europe/London' && node index.bs.js`)\n\n```" + "Creates a date object with the given year, month, date (day of month), hours, minutes and seconds.\nBe aware of using a value for year < 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#interpretation_of_two-digit_years).\nMonths are 0-indexed (0 = January, 11 = December).\nValues, which are out of range, will be carried over to the next bigger unit (s. example).\n\n## Examples\n```rescript\nDate.makeWithYMDHMS(~year=2023, ~month=1, ~day=20, ~hours=16, ~minutes=40, ~seconds=0)\n// 2023-02-20T16:40:00.000Z\n\nDate.makeWithYMDHMS(~year=2023, ~month=1, ~day=20, ~hours=16, ~minutes=40, ~seconds=60)\n// 2023-02-20T16:41:00.000Z\n\nDate.makeWithYMDHMS(~year=2023, ~month=1, ~day=20, ~hours=16, ~minutes=40, ~seconds=-1)\n// 2023-02-20T16:39:59.000Z\n\n// Note: The output depends on your local time zone.\n// In nodejs you can change it by using the TZ env (`export TZ='Europe/London' && node index.bs.js`)\n\n```" ], - "signature": "let makeWithYMDHMS: (\n ~year: int,\n ~month: int,\n ~date: int,\n ~hours: int,\n ~minutes: int,\n ~seconds: int,\n) => t" + "signature": "let makeWithYMDHMS: (\n ~year: int,\n ~month: int,\n ~day: int,\n ~hours: int,\n ~minutes: int,\n ~seconds: int,\n) => t" }, { - "id": "Core.Date.makeWithYMDHMSM", + "id": "Stdlib.Date.makeWithYMDHMSM", "kind": "value", "name": "makeWithYMDHMSM", "docstrings": [ - "Creates a date object with the given year, month, date (day of month), hours, minutes, seconds and milliseconds.\nBe aware of using a value for year < 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#interpretation_of_two-digit_years).\nMonths are 0-indexed (0 = January, 11 = December).\nValues, which are out of range, will be carried over to the next bigger unit (s. example).\n\n## Examples\n```rescript\nDate.makeWithYMDHMSM(~year=2023, ~month=1, ~date=20, ~hours=16, ~minutes=40, ~seconds=0, ~milliseconds=0)\n// 2023-02-20T16:40:00.000Z\n\nDate.makeWithYMDHMSM(~year=2023, ~month=1, ~date=20, ~hours=16, ~minutes=40, ~seconds=0, ~milliseconds=1000)\n// 2023-02-20T16:40:01.000Z\n\nDate.makeWithYMDHMSM(~year=2023, ~month=1, ~date=20, ~hours=16, ~minutes=40, ~seconds=0, ~milliseconds=-1)\n// 2023-02-20T16:39:59.999Z\n\n// Note: The output depends on your local time zone.\n// In nodejs you can change it by using the TZ env (`export TZ='Europe/London' && node index.bs.js`)\n\n```" + "Creates a date object with the given year, month, date (day of month), hours, minutes, seconds and milliseconds.\nBe aware of using a value for year < 100, because it behaves inconsistent (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#interpretation_of_two-digit_years).\nMonths are 0-indexed (0 = January, 11 = December).\nValues, which are out of range, will be carried over to the next bigger unit (s. example).\n\n## Examples\n```rescript\nDate.makeWithYMDHMSM(~year=2023, ~month=1, ~day=20, ~hours=16, ~minutes=40, ~seconds=0, ~milliseconds=0)\n// 2023-02-20T16:40:00.000Z\n\nDate.makeWithYMDHMSM(~year=2023, ~month=1, ~day=20, ~hours=16, ~minutes=40, ~seconds=0, ~milliseconds=1000)\n// 2023-02-20T16:40:01.000Z\n\nDate.makeWithYMDHMSM(~year=2023, ~month=1, ~day=20, ~hours=16, ~minutes=40, ~seconds=0, ~milliseconds=-1)\n// 2023-02-20T16:39:59.999Z\n\n// Note: The output depends on your local time zone.\n// In nodejs you can change it by using the TZ env (`export TZ='Europe/London' && node index.bs.js`)\n\n```" ], - "signature": "let makeWithYMDHMSM: (\n ~year: int,\n ~month: int,\n ~date: int,\n ~hours: int,\n ~minutes: int,\n ~seconds: int,\n ~milliseconds: int,\n) => t" + "signature": "let makeWithYMDHMSM: (\n ~year: int,\n ~month: int,\n ~day: int,\n ~hours: int,\n ~minutes: int,\n ~seconds: int,\n ~milliseconds: int,\n) => t" }, { - "id": "Core.Date.now", + "id": "Stdlib.Date.now", "kind": "value", "name": "now", "docstrings": [ @@ -7956,21 +9397,21 @@ "signature": "let now: unit => msSinceEpoch" }, { - "id": "Core.Date.equal", + "id": "Stdlib.Date.equal", "kind": "value", "name": "equal", "docstrings": [], "signature": "let equal: (t, t) => bool" }, { - "id": "Core.Date.compare", + "id": "Stdlib.Date.compare", "kind": "value", "name": "compare", "docstrings": [], - "signature": "let compare: (t, t) => Core__Ordering.t" + "signature": "let compare: (t, t) => Ordering.t" }, { - "id": "Core.Date.getTime", + "id": "Stdlib.Date.getTime", "kind": "value", "name": "getTime", "docstrings": [ @@ -7979,7 +9420,7 @@ "signature": "let getTime: t => msSinceEpoch" }, { - "id": "Core.Date.getTimezoneOffset", + "id": "Stdlib.Date.getTimezoneOffset", "kind": "value", "name": "getTimezoneOffset", "docstrings": [ @@ -7988,7 +9429,7 @@ "signature": "let getTimezoneOffset: t => int" }, { - "id": "Core.Date.getFullYear", + "id": "Stdlib.Date.getFullYear", "kind": "value", "name": "getFullYear", "docstrings": [ @@ -7997,7 +9438,7 @@ "signature": "let getFullYear: t => int" }, { - "id": "Core.Date.getMonth", + "id": "Stdlib.Date.getMonth", "kind": "value", "name": "getMonth", "docstrings": [ @@ -8006,7 +9447,7 @@ "signature": "let getMonth: t => int" }, { - "id": "Core.Date.getDate", + "id": "Stdlib.Date.getDate", "kind": "value", "name": "getDate", "docstrings": [ @@ -8015,7 +9456,7 @@ "signature": "let getDate: t => int" }, { - "id": "Core.Date.getHours", + "id": "Stdlib.Date.getHours", "kind": "value", "name": "getHours", "docstrings": [ @@ -8024,7 +9465,7 @@ "signature": "let getHours: t => int" }, { - "id": "Core.Date.getMinutes", + "id": "Stdlib.Date.getMinutes", "kind": "value", "name": "getMinutes", "docstrings": [ @@ -8033,7 +9474,7 @@ "signature": "let getMinutes: t => int" }, { - "id": "Core.Date.getSeconds", + "id": "Stdlib.Date.getSeconds", "kind": "value", "name": "getSeconds", "docstrings": [ @@ -8042,7 +9483,7 @@ "signature": "let getSeconds: t => int" }, { - "id": "Core.Date.getMilliseconds", + "id": "Stdlib.Date.getMilliseconds", "kind": "value", "name": "getMilliseconds", "docstrings": [ @@ -8051,7 +9492,7 @@ "signature": "let getMilliseconds: t => int" }, { - "id": "Core.Date.getDay", + "id": "Stdlib.Date.getDay", "kind": "value", "name": "getDay", "docstrings": [ @@ -8060,7 +9501,7 @@ "signature": "let getDay: t => int" }, { - "id": "Core.Date.setFullYear", + "id": "Stdlib.Date.setFullYear", "kind": "value", "name": "setFullYear", "docstrings": [ @@ -8069,7 +9510,7 @@ "signature": "let setFullYear: (t, int) => unit" }, { - "id": "Core.Date.setFullYearM", + "id": "Stdlib.Date.setFullYearM", "kind": "value", "name": "setFullYearM", "docstrings": [ @@ -8078,16 +9519,16 @@ "signature": "let setFullYearM: (t, ~year: int, ~month: int) => unit" }, { - "id": "Core.Date.setFullYearMD", + "id": "Stdlib.Date.setFullYearMD", "kind": "value", "name": "setFullYearMD", "docstrings": [ - "`setFullYearMD(date, ~year, ~month, ~date)`\n\nSets the year, month and date (day of month) of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setFullYearMD(~year=2024, ~month=0, ~date=1)\n```" + "`setFullYearMD(date, ~year, ~month, ~day)`\n\nSets the year, month and date (day of month) of a date (according to local time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setFullYearMD(~year=2024, ~month=0, ~day=1)\n```" ], - "signature": "let setFullYearMD: (t, ~year: int, ~month: int, ~date: int) => unit" + "signature": "let setFullYearMD: (t, ~year: int, ~month: int, ~day: int) => unit" }, { - "id": "Core.Date.setMonth", + "id": "Stdlib.Date.setMonth", "kind": "value", "name": "setMonth", "docstrings": [ @@ -8096,7 +9537,7 @@ "signature": "let setMonth: (t, int) => unit" }, { - "id": "Core.Date.setDate", + "id": "Stdlib.Date.setDate", "kind": "value", "name": "setDate", "docstrings": [ @@ -8105,7 +9546,7 @@ "signature": "let setDate: (t, int) => unit" }, { - "id": "Core.Date.setHours", + "id": "Stdlib.Date.setHours", "kind": "value", "name": "setHours", "docstrings": [ @@ -8114,7 +9555,7 @@ "signature": "let setHours: (t, int) => unit" }, { - "id": "Core.Date.setHoursM", + "id": "Stdlib.Date.setHoursM", "kind": "value", "name": "setHoursM", "docstrings": [ @@ -8123,7 +9564,7 @@ "signature": "let setHoursM: (t, ~hours: int, ~minutes: int) => unit" }, { - "id": "Core.Date.setHoursMS", + "id": "Stdlib.Date.setHoursMS", "kind": "value", "name": "setHoursMS", "docstrings": [ @@ -8132,7 +9573,7 @@ "signature": "let setHoursMS: (t, ~hours: int, ~minutes: int, ~seconds: int) => unit" }, { - "id": "Core.Date.setHoursMSMs", + "id": "Stdlib.Date.setHoursMSMs", "kind": "value", "name": "setHoursMSMs", "docstrings": [ @@ -8141,7 +9582,7 @@ "signature": "let setHoursMSMs: (\n t,\n ~hours: int,\n ~minutes: int,\n ~seconds: int,\n ~milliseconds: int,\n) => unit" }, { - "id": "Core.Date.setMinutes", + "id": "Stdlib.Date.setMinutes", "kind": "value", "name": "setMinutes", "docstrings": [ @@ -8150,7 +9591,7 @@ "signature": "let setMinutes: (t, int) => unit" }, { - "id": "Core.Date.setMinutesS", + "id": "Stdlib.Date.setMinutesS", "kind": "value", "name": "setMinutesS", "docstrings": [ @@ -8159,7 +9600,7 @@ "signature": "let setMinutesS: (t, ~minutes: int, ~seconds: int) => unit" }, { - "id": "Core.Date.setMinutesSMs", + "id": "Stdlib.Date.setMinutesSMs", "kind": "value", "name": "setMinutesSMs", "docstrings": [ @@ -8168,7 +9609,7 @@ "signature": "let setMinutesSMs: (\n t,\n ~minutes: int,\n ~seconds: int,\n ~milliseconds: int,\n) => unit" }, { - "id": "Core.Date.setSeconds", + "id": "Stdlib.Date.setSeconds", "kind": "value", "name": "setSeconds", "docstrings": [ @@ -8177,7 +9618,7 @@ "signature": "let setSeconds: (t, int) => unit" }, { - "id": "Core.Date.setSecondsMs", + "id": "Stdlib.Date.setSecondsMs", "kind": "value", "name": "setSecondsMs", "docstrings": [ @@ -8186,7 +9627,7 @@ "signature": "let setSecondsMs: (t, ~seconds: int, ~milliseconds: int) => unit" }, { - "id": "Core.Date.setMilliseconds", + "id": "Stdlib.Date.setMilliseconds", "kind": "value", "name": "setMilliseconds", "docstrings": [ @@ -8195,7 +9636,7 @@ "signature": "let setMilliseconds: (t, int) => unit" }, { - "id": "Core.Date.getUTCFullYear", + "id": "Stdlib.Date.getUTCFullYear", "kind": "value", "name": "getUTCFullYear", "docstrings": [ @@ -8204,7 +9645,7 @@ "signature": "let getUTCFullYear: t => int" }, { - "id": "Core.Date.getUTCMonth", + "id": "Stdlib.Date.getUTCMonth", "kind": "value", "name": "getUTCMonth", "docstrings": [ @@ -8213,7 +9654,7 @@ "signature": "let getUTCMonth: t => int" }, { - "id": "Core.Date.getUTCDate", + "id": "Stdlib.Date.getUTCDate", "kind": "value", "name": "getUTCDate", "docstrings": [ @@ -8222,7 +9663,7 @@ "signature": "let getUTCDate: t => int" }, { - "id": "Core.Date.getUTCHours", + "id": "Stdlib.Date.getUTCHours", "kind": "value", "name": "getUTCHours", "docstrings": [ @@ -8231,7 +9672,7 @@ "signature": "let getUTCHours: t => int" }, { - "id": "Core.Date.getUTCMinutes", + "id": "Stdlib.Date.getUTCMinutes", "kind": "value", "name": "getUTCMinutes", "docstrings": [ @@ -8240,7 +9681,7 @@ "signature": "let getUTCMinutes: t => int" }, { - "id": "Core.Date.getUTCSeconds", + "id": "Stdlib.Date.getUTCSeconds", "kind": "value", "name": "getUTCSeconds", "docstrings": [ @@ -8249,7 +9690,7 @@ "signature": "let getUTCSeconds: t => int" }, { - "id": "Core.Date.getUTCMilliseconds", + "id": "Stdlib.Date.getUTCMilliseconds", "kind": "value", "name": "getUTCMilliseconds", "docstrings": [ @@ -8258,7 +9699,7 @@ "signature": "let getUTCMilliseconds: t => int" }, { - "id": "Core.Date.getUTCDay", + "id": "Stdlib.Date.getUTCDay", "kind": "value", "name": "getUTCDay", "docstrings": [ @@ -8267,7 +9708,7 @@ "signature": "let getUTCDay: t => int" }, { - "id": "Core.Date.setUTCFullYear", + "id": "Stdlib.Date.setUTCFullYear", "kind": "value", "name": "setUTCFullYear", "docstrings": [ @@ -8276,7 +9717,7 @@ "signature": "let setUTCFullYear: (t, int) => unit" }, { - "id": "Core.Date.setUTCFullYearM", + "id": "Stdlib.Date.setUTCFullYearM", "kind": "value", "name": "setUTCFullYearM", "docstrings": [ @@ -8285,16 +9726,16 @@ "signature": "let setUTCFullYearM: (t, ~year: int, ~month: int) => unit" }, { - "id": "Core.Date.setUTCFullYearMD", + "id": "Stdlib.Date.setUTCFullYearMD", "kind": "value", "name": "setUTCFullYearMD", "docstrings": [ - "`setUTCFullYearMD(date, ~year, ~month, ~date)`\n\nSets the year, month and date (day of month) of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCFullYearMD(~year=2024, ~month=0, ~date=1)\n```" + "`setUTCFullYearMD(date, ~year, ~month, ~day)`\n\nSets the year, month and date (day of month) of a date (according to UTC time).\nBeware this will *mutate* the date.\n\n## Examples\n```rescript\nDate.fromString(\"2023-02-20T16:40:00.00\")->Date.setUTCFullYearMD(~year=2024, ~month=0, ~day=1)\n```" ], - "signature": "let setUTCFullYearMD: (t, ~year: int, ~month: int, ~date: int) => unit" + "signature": "let setUTCFullYearMD: (t, ~year: int, ~month: int, ~day: int) => unit" }, { - "id": "Core.Date.setUTCMonth", + "id": "Stdlib.Date.setUTCMonth", "kind": "value", "name": "setUTCMonth", "docstrings": [ @@ -8303,7 +9744,7 @@ "signature": "let setUTCMonth: (t, int) => unit" }, { - "id": "Core.Date.setUTCDate", + "id": "Stdlib.Date.setUTCDate", "kind": "value", "name": "setUTCDate", "docstrings": [ @@ -8312,7 +9753,7 @@ "signature": "let setUTCDate: (t, int) => unit" }, { - "id": "Core.Date.setUTCHours", + "id": "Stdlib.Date.setUTCHours", "kind": "value", "name": "setUTCHours", "docstrings": [ @@ -8321,7 +9762,7 @@ "signature": "let setUTCHours: (t, int) => unit" }, { - "id": "Core.Date.setUTCHoursM", + "id": "Stdlib.Date.setUTCHoursM", "kind": "value", "name": "setUTCHoursM", "docstrings": [ @@ -8330,7 +9771,7 @@ "signature": "let setUTCHoursM: (t, ~hours: int, ~minutes: int) => unit" }, { - "id": "Core.Date.setUTCHoursMS", + "id": "Stdlib.Date.setUTCHoursMS", "kind": "value", "name": "setUTCHoursMS", "docstrings": [ @@ -8339,7 +9780,7 @@ "signature": "let setUTCHoursMS: (t, ~hours: int, ~minutes: int, ~seconds: int) => unit" }, { - "id": "Core.Date.setUTCHoursMSMs", + "id": "Stdlib.Date.setUTCHoursMSMs", "kind": "value", "name": "setUTCHoursMSMs", "docstrings": [ @@ -8348,7 +9789,7 @@ "signature": "let setUTCHoursMSMs: (\n t,\n ~hours: int,\n ~minutes: int,\n ~seconds: int,\n ~milliseconds: int,\n) => unit" }, { - "id": "Core.Date.setUTCMinutes", + "id": "Stdlib.Date.setUTCMinutes", "kind": "value", "name": "setUTCMinutes", "docstrings": [ @@ -8357,7 +9798,7 @@ "signature": "let setUTCMinutes: (t, int) => unit" }, { - "id": "Core.Date.setUTCMinutesS", + "id": "Stdlib.Date.setUTCMinutesS", "kind": "value", "name": "setUTCMinutesS", "docstrings": [ @@ -8366,7 +9807,7 @@ "signature": "let setUTCMinutesS: (t, ~minutes: int, ~seconds: int) => unit" }, { - "id": "Core.Date.setUTCMinutesSMs", + "id": "Stdlib.Date.setUTCMinutesSMs", "kind": "value", "name": "setUTCMinutesSMs", "docstrings": [ @@ -8375,7 +9816,7 @@ "signature": "let setUTCMinutesSMs: (\n t,\n ~minutes: int,\n ~seconds: int,\n ~milliseconds: int,\n) => unit" }, { - "id": "Core.Date.setUTCSeconds", + "id": "Stdlib.Date.setUTCSeconds", "kind": "value", "name": "setUTCSeconds", "docstrings": [ @@ -8384,7 +9825,7 @@ "signature": "let setUTCSeconds: (t, int) => unit" }, { - "id": "Core.Date.setUTCSecondsMs", + "id": "Stdlib.Date.setUTCSecondsMs", "kind": "value", "name": "setUTCSecondsMs", "docstrings": [ @@ -8393,7 +9834,7 @@ "signature": "let setUTCSecondsMs: (t, ~seconds: int, ~milliseconds: int) => unit" }, { - "id": "Core.Date.setUTCMilliseconds", + "id": "Stdlib.Date.setUTCMilliseconds", "kind": "value", "name": "setUTCMilliseconds", "docstrings": [ @@ -8402,7 +9843,7 @@ "signature": "let setUTCMilliseconds: (t, int) => unit" }, { - "id": "Core.Date.toDateString", + "id": "Stdlib.Date.toDateString", "kind": "value", "name": "toDateString", "docstrings": [ @@ -8411,7 +9852,7 @@ "signature": "let toDateString: t => string" }, { - "id": "Core.Date.toString", + "id": "Stdlib.Date.toString", "kind": "value", "name": "toString", "docstrings": [ @@ -8420,7 +9861,7 @@ "signature": "let toString: t => string" }, { - "id": "Core.Date.toTimeString", + "id": "Stdlib.Date.toTimeString", "kind": "value", "name": "toTimeString", "docstrings": [ @@ -8429,7 +9870,7 @@ "signature": "let toTimeString: t => string" }, { - "id": "Core.Date.toLocaleDateString", + "id": "Stdlib.Date.toLocaleDateString", "kind": "value", "name": "toLocaleDateString", "docstrings": [ @@ -8438,7 +9879,7 @@ "signature": "let toLocaleDateString: t => string" }, { - "id": "Core.Date.toLocaleDateStringWithLocale", + "id": "Stdlib.Date.toLocaleDateStringWithLocale", "kind": "value", "name": "toLocaleDateStringWithLocale", "docstrings": [ @@ -8447,7 +9888,7 @@ "signature": "let toLocaleDateStringWithLocale: (t, string) => string" }, { - "id": "Core.Date.toLocaleDateStringWithLocaleAndOptions", + "id": "Stdlib.Date.toLocaleDateStringWithLocaleAndOptions", "kind": "value", "name": "toLocaleDateStringWithLocaleAndOptions", "docstrings": [ @@ -8456,7 +9897,7 @@ "signature": "let toLocaleDateStringWithLocaleAndOptions: (t, string, localeOptions) => string" }, { - "id": "Core.Date.toLocaleString", + "id": "Stdlib.Date.toLocaleString", "kind": "value", "name": "toLocaleString", "docstrings": [ @@ -8465,7 +9906,7 @@ "signature": "let toLocaleString: t => string" }, { - "id": "Core.Date.toLocaleStringWithLocale", + "id": "Stdlib.Date.toLocaleStringWithLocale", "kind": "value", "name": "toLocaleStringWithLocale", "docstrings": [ @@ -8474,7 +9915,7 @@ "signature": "let toLocaleStringWithLocale: (t, string) => string" }, { - "id": "Core.Date.toLocaleStringWithLocaleAndOptions", + "id": "Stdlib.Date.toLocaleStringWithLocaleAndOptions", "kind": "value", "name": "toLocaleStringWithLocaleAndOptions", "docstrings": [ @@ -8483,7 +9924,7 @@ "signature": "let toLocaleStringWithLocaleAndOptions: (t, string, localeOptions) => string" }, { - "id": "Core.Date.toLocaleTimeString", + "id": "Stdlib.Date.toLocaleTimeString", "kind": "value", "name": "toLocaleTimeString", "docstrings": [ @@ -8492,7 +9933,7 @@ "signature": "let toLocaleTimeString: t => string" }, { - "id": "Core.Date.toLocaleTimeStringWithLocale", + "id": "Stdlib.Date.toLocaleTimeStringWithLocale", "kind": "value", "name": "toLocaleTimeStringWithLocale", "docstrings": [ @@ -8501,7 +9942,7 @@ "signature": "let toLocaleTimeStringWithLocale: (t, string) => string" }, { - "id": "Core.Date.toLocaleTimeStringWithLocaleAndOptions", + "id": "Stdlib.Date.toLocaleTimeStringWithLocaleAndOptions", "kind": "value", "name": "toLocaleTimeStringWithLocaleAndOptions", "docstrings": [ @@ -8510,7 +9951,7 @@ "signature": "let toLocaleTimeStringWithLocaleAndOptions: (t, string, localeOptions) => string" }, { - "id": "Core.Date.toISOString", + "id": "Stdlib.Date.toISOString", "kind": "value", "name": "toISOString", "docstrings": [ @@ -8519,7 +9960,7 @@ "signature": "let toISOString: t => string" }, { - "id": "Core.Date.toUTCString", + "id": "Stdlib.Date.toUTCString", "kind": "value", "name": "toUTCString", "docstrings": [ @@ -8528,953 +9969,1327 @@ "signature": "let toUTCString: t => string" }, { - "id": "Core.Date.toJSON", + "id": "Stdlib.Date.toJSON", "kind": "value", "name": "toJSON", "docstrings": [ "`toJSON(date)`\n\nConverts a JavaScript date to a string.\nIf the date is valid, the function will return the same result as `Date.toISOString`.\nInvalid dates will return `None`.\n\n## Examples\n```rescript\nDate.fromString(\"2023-01-01T00:00:00.00+00:00\")->Date.toJSON\n// Some(\"2023-01-01T00:00:00.000Z\")\n\nDate.fromString(\"\")->Date.toJSON\n// None\n```" ], "signature": "let toJSON: t => option" + }, + { + "id": "Stdlib.Date.ignore", + "kind": "value", + "name": "ignore", + "docstrings": [ + "`ignore(date)` ignores the provided date and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." + ], + "signature": "let ignore: t => unit" } ] }, - "core/dataview": { - "id": "Core.DataView", + "stdlib/dataview": { + "id": "Stdlib.DataView", "name": "DataView", "docstrings": [], "items": [ { - "id": "Core.DataView.t", + "id": "Stdlib.DataView.t", "kind": "type", "name": "t", "docstrings": [], "signature": "type t" }, { - "id": "Core.DataView.fromBuffer", + "id": "Stdlib.DataView.fromBuffer", "kind": "value", "name": "fromBuffer", "docstrings": [], - "signature": "let fromBuffer: Core__ArrayBuffer.t => t" + "signature": "let fromBuffer: ArrayBuffer.t => t" }, { - "id": "Core.DataView.fromBufferToEnd", + "id": "Stdlib.DataView.fromBufferToEnd", "kind": "value", "name": "fromBufferToEnd", "docstrings": [], - "signature": "let fromBufferToEnd: (Core__ArrayBuffer.t, ~byteOffset: int) => t" + "signature": "let fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t" }, { - "id": "Core.DataView.fromBufferWithRange", + "id": "Stdlib.DataView.fromBufferWithRange", "kind": "value", "name": "fromBufferWithRange", "docstrings": [], - "signature": "let fromBufferWithRange: (Core__ArrayBuffer.t, ~byteOffset: int, ~length: int) => t" + "signature": "let fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t" }, { - "id": "Core.DataView.buffer", + "id": "Stdlib.DataView.buffer", "kind": "value", "name": "buffer", "docstrings": [], - "signature": "let buffer: t => Core__ArrayBuffer.t" + "signature": "let buffer: t => ArrayBuffer.t" }, { - "id": "Core.DataView.byteLength", + "id": "Stdlib.DataView.byteLength", "kind": "value", "name": "byteLength", "docstrings": [], "signature": "let byteLength: t => int" }, { - "id": "Core.DataView.byteOffset", + "id": "Stdlib.DataView.byteOffset", "kind": "value", "name": "byteOffset", "docstrings": [], "signature": "let byteOffset: t => int" }, { - "id": "Core.DataView.getInt8", + "id": "Stdlib.DataView.getInt8", "kind": "value", "name": "getInt8", "docstrings": [], - "signature": "let getInt8: t => int" + "signature": "let getInt8: (t, int) => int" }, { - "id": "Core.DataView.getUint8", + "id": "Stdlib.DataView.getUint8", "kind": "value", "name": "getUint8", "docstrings": [], - "signature": "let getUint8: t => int" + "signature": "let getUint8: (t, int) => int" }, { - "id": "Core.DataView.getInt16", + "id": "Stdlib.DataView.getInt16", "kind": "value", "name": "getInt16", "docstrings": [], - "signature": "let getInt16: t => int" + "signature": "let getInt16: (t, int) => int" }, { - "id": "Core.DataView.getUint16", + "id": "Stdlib.DataView.getUint16", "kind": "value", "name": "getUint16", "docstrings": [], - "signature": "let getUint16: t => int" + "signature": "let getUint16: (t, int) => int" }, { - "id": "Core.DataView.getInt32", + "id": "Stdlib.DataView.getInt32", "kind": "value", "name": "getInt32", "docstrings": [], - "signature": "let getInt32: t => int" + "signature": "let getInt32: (t, int) => int" }, { - "id": "Core.DataView.getUint32", + "id": "Stdlib.DataView.getUint32", "kind": "value", "name": "getUint32", "docstrings": [], - "signature": "let getUint32: t => int" + "signature": "let getUint32: (t, int) => int" }, { - "id": "Core.DataView.getFloat32", + "id": "Stdlib.DataView.getFloat32", "kind": "value", "name": "getFloat32", "docstrings": [], - "signature": "let getFloat32: t => float" + "signature": "let getFloat32: (t, int) => float" }, { - "id": "Core.DataView.getFloat64", + "id": "Stdlib.DataView.getFloat64", "kind": "value", "name": "getFloat64", "docstrings": [], - "signature": "let getFloat64: t => float" + "signature": "let getFloat64: (t, int) => float" }, { - "id": "Core.DataView.getBigInt64", + "id": "Stdlib.DataView.getBigInt64", "kind": "value", "name": "getBigInt64", "docstrings": [], - "signature": "let getBigInt64: t => bigint" + "signature": "let getBigInt64: (t, int) => bigint" }, { - "id": "Core.DataView.getBigUint64", + "id": "Stdlib.DataView.getBigUint64", "kind": "value", "name": "getBigUint64", "docstrings": [], - "signature": "let getBigUint64: t => bigint" + "signature": "let getBigUint64: (t, int) => bigint" + }, + { + "id": "Stdlib.DataView.setInt8", + "kind": "value", + "name": "setInt8", + "docstrings": [], + "signature": "let setInt8: (t, int, int) => unit" + }, + { + "id": "Stdlib.DataView.setUint8", + "kind": "value", + "name": "setUint8", + "docstrings": [], + "signature": "let setUint8: (t, int, int) => unit" + }, + { + "id": "Stdlib.DataView.setInt16", + "kind": "value", + "name": "setInt16", + "docstrings": [], + "signature": "let setInt16: (t, int, int) => unit" + }, + { + "id": "Stdlib.DataView.setUint16", + "kind": "value", + "name": "setUint16", + "docstrings": [], + "signature": "let setUint16: (t, int, int) => unit" + }, + { + "id": "Stdlib.DataView.setInt32", + "kind": "value", + "name": "setInt32", + "docstrings": [], + "signature": "let setInt32: (t, int, int) => unit" + }, + { + "id": "Stdlib.DataView.setUint32", + "kind": "value", + "name": "setUint32", + "docstrings": [], + "signature": "let setUint32: (t, int, int) => unit" + }, + { + "id": "Stdlib.DataView.setFloat32", + "kind": "value", + "name": "setFloat32", + "docstrings": [], + "signature": "let setFloat32: (t, int, float) => unit" + }, + { + "id": "Stdlib.DataView.setFloat64", + "kind": "value", + "name": "setFloat64", + "docstrings": [], + "signature": "let setFloat64: (t, int, float) => unit" + }, + { + "id": "Stdlib.DataView.setBigInt64", + "kind": "value", + "name": "setBigInt64", + "docstrings": [], + "signature": "let setBigInt64: (t, int, bigint) => unit" + }, + { + "id": "Stdlib.DataView.setBigUint64", + "kind": "value", + "name": "setBigUint64", + "docstrings": [], + "signature": "let setBigUint64: (t, int, bigint) => unit" + }, + { + "id": "Stdlib.DataView.ignore", + "kind": "value", + "name": "ignore", + "docstrings": [ + "`ignore(dataView)` ignores the provided dataView and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." + ], + "signature": "let ignore: t => unit" + } + ] + }, + "stdlib/console": { + "id": "Stdlib.Console", + "name": "Console", + "docstrings": [ + "Functions for interacting with JavaScript console.\n\nSee: [`console`](https://developer.mozilla.org/en-US/docs/Web/API/Console)." + ], + "items": [ + { + "id": "Stdlib.Console.assert_", + "kind": "value", + "name": "assert_", + "docstrings": [ + "`assert_(assertion, value)` print a message to console if `assertion` evaluates `false`. Does nothing if it's `true`.\n\nSee [`console.assert`](https://developer.mozilla.org/en-US/docs/Web/API/console/assert)\non MDN.\n\n## Examples\n\n```rescript\nConsole.assert_(false, \"Hello World!\")\nConsole.assert_(42 === 42, \"The answer\")\n```" + ], + "signature": "let assert_: (bool, 'a) => unit" + }, + { + "id": "Stdlib.Console.assert2", + "kind": "value", + "name": "assert2", + "docstrings": [ + "`assert2(v1, v2)`. Like `assert_`, but with two arguments.\n\n## Examples\n\n```rescript\nConsole.assert2(false, \"Hello\", \"World\")\nConsole.assert2(42 === 42, [1, 2, 3], '4')\n```" + ], + "signature": "let assert2: (bool, 'a, 'b) => unit" + }, + { + "id": "Stdlib.Console.assert3", + "kind": "value", + "name": "assert3", + "docstrings": [ + "`assert3(v1, v2, v3)`. Like `assert_`, but with three arguments.\n\n## Examples\n\n```rescript\nConsole.assert3(false, \"Hello\", \"World\", \"ReScript\")\nConsole.assert3(42 === 42, \"One\", 2, #3)\n```" + ], + "signature": "let assert3: (bool, 'a, 'b, 'c) => unit" + }, + { + "id": "Stdlib.Console.assert4", + "kind": "value", + "name": "assert4", + "docstrings": [ + "`assert4(v1, v2, v3, v4)`. Like `assert_`, but with four arguments.\n\n## Examples\n\n```rescript\nlet value = 42\nConsole.assert4(false, \"Hello\", \"World\", \"ReScript\", \"!!!\")\nConsole.assert4(value === 42, [1, 2], (3, 4), [#5, #6], #\"polyvar\")\n```" + ], + "signature": "let assert4: (bool, 'a, 'b, 'c, 'd) => unit" + }, + { + "id": "Stdlib.Console.assert5", + "kind": "value", + "name": "assert5", + "docstrings": [ + "`assert5(v1, v2, v3, v4, v5)`. Like `assert_`, but with five arguments.\n\n## Examples\n\n```rescript\nlet value = 42\nConsole.assert5(false, \"Hello\", \"World\", \"JS\", '!', '!')\nConsole.assert5(value === 42, [1, 2], (3, 4), [#5, #6], #\"polyvar\", {\"name\": \"ReScript\"})\n```" + ], + "signature": "let assert5: (bool, 'a, 'b, 'c, 'd, 'e) => unit" + }, + { + "id": "Stdlib.Console.assert6", + "kind": "value", + "name": "assert6", + "docstrings": [ + "`assert6(v1, v2)`. Like `assert_`, but with six arguments.\n\n## Examples\n\n```rescript\nlet value = 42\nConsole.assert6(false, \"Hello\", \"World\", \"JS\", '!', '!', '?')\nConsole.assert6(value === 42, [1, 2], (3, 4), [#5, #6], #\"polyvar\", {\"name\": \"ReScript\"}, 42)\n```" + ], + "signature": "let assert6: (bool, 'a, 'b, 'c, 'd, 'e, 'f) => unit" + }, + { + "id": "Stdlib.Console.assertMany", + "kind": "value", + "name": "assertMany", + "docstrings": [ + "`assertMany(assertion, arr)`. Like `assert_`, but variadic.\n\n## Examples\n\n```rescript\nlet value = 42\nConsole.assertMany(false, [\"Hello\", \"World\"])\nConsole.assertMany(value === 42, [1, 2, 3])\n```" + ], + "signature": "let assertMany: (bool, array<'a>) => unit" + }, + { + "id": "Stdlib.Console.clear", + "kind": "value", + "name": "clear", + "docstrings": [ + "`clear()` clears the console, if allowed.\n\nSee [`console.clear`](https://developer.mozilla.org/en-US/docs/Web/API/console/clear)\non MDN.\n\n## Examples\n\n```rescript\nConsole.clear()\n```" + ], + "signature": "let clear: unit => unit" + }, + { + "id": "Stdlib.Console.count", + "kind": "value", + "name": "count", + "docstrings": [ + "`count(label)` prints to the console the number of times it's been called with the given label.\n\nSee [`console.count`](https://developer.mozilla.org/en-US/docs/Web/API/console/count)\non MDN.\n\n## Examples\n\n```rescript\nConsole.count(\"rescript\")\n```" + ], + "signature": "let count: string => unit" + }, + { + "id": "Stdlib.Console.countReset", + "kind": "value", + "name": "countReset", + "docstrings": [ + "`countReset(label)` resets the count for the given label to 0.\n\nSee [`console.countReset`](https://developer.mozilla.org/en-US/docs/Web/API/console/countReset)\non MDN.\n\n## Examples\n\n```rescript\nConsole.countReset(\"rescript\")\n```" + ], + "signature": "let countReset: string => unit" + }, + { + "id": "Stdlib.Console.debug", + "kind": "value", + "name": "debug", + "docstrings": [ + "`debug(value)` print a debug message to console.\n\nSee [`console.debug`](https://developer.mozilla.org/en-US/docs/Web/API/console/debug)\non MDN.\n\n## Examples\n\n```rescript\nConsole.debug(\"Hello\")\nlet obj = {\"name\": \"ReScript\", \"version\": 10}\nConsole.debug(obj)\n```" + ], + "signature": "let debug: 'a => unit" + }, + { + "id": "Stdlib.Console.debug2", + "kind": "value", + "name": "debug2", + "docstrings": [ + "`debug2(v1, v2)`. Like `debug`, but with two arguments.\n\n## Examples\n\n```rescript\nConsole.debug2(\"Hello\", \"World\")\nConsole.debug2([1, 2, 3], '4')\n```" + ], + "signature": "let debug2: ('a, 'b) => unit" + }, + { + "id": "Stdlib.Console.debug3", + "kind": "value", + "name": "debug3", + "docstrings": [ + "`debug3(v1, v2, v3)`. Like `debug`, but with three arguments.\n\n## Examples\n\n```rescript\nConsole.debug3(\"Hello\", \"World\", \"ReScript\")\nConsole.debug3(\"One\", 2, #3)\n```" + ], + "signature": "let debug3: ('a, 'b, 'c) => unit" + }, + { + "id": "Stdlib.Console.debug4", + "kind": "value", + "name": "debug4", + "docstrings": [ + "`debug4(v1, v2, v3, v4)`. Like `debug`, but with four arguments.\n\n## Examples\n\n```rescript\nConsole.debug4(\"Hello\", \"World\", \"ReScript\", \"!!!\")\nConsole.debug4([1, 2], (3, 4), [#5, #6], #\"polyvar\")\n```" + ], + "signature": "let debug4: ('a, 'b, 'c, 'd) => unit" + }, + { + "id": "Stdlib.Console.debug5", + "kind": "value", + "name": "debug5", + "docstrings": [ + "`debug5(v1, v2, v3, v4, v5)`. Like `debug`, but with five arguments.\n\n## Examples\n\n```rescript\nConsole.debug5(\"Hello\", \"World\", \"JS\", '!', '!')\nConsole.debug5([1, 2], (3, 4), [#5, #6], #\"polyvar\", {\"name\": \"ReScript\"})\n```" + ], + "signature": "let debug5: ('a, 'b, 'c, 'd, 'e) => unit" + }, + { + "id": "Stdlib.Console.debug6", + "kind": "value", + "name": "debug6", + "docstrings": [ + "`debug6(v1, v2, v3, v4, v5, v6)`. Like `debug`, but with six arguments.\n\n## Examples\n\n```rescript\nConsole.debug6(\"Hello\", \"World\", \"JS\", '!', '!', '?')\nConsole.debug6([1, 2], (3, 4), [#5, #6], #\"polyvar\", {\"name\": \"ReScript\"}, 42)\n```" + ], + "signature": "let debug6: ('a, 'b, 'c, 'd, 'e, 'f) => unit" + }, + { + "id": "Stdlib.Console.debugMany", + "kind": "value", + "name": "debugMany", + "docstrings": [ + "`debugMany(arr)`. Like `debug`, but variadic.\n\n## Examples\n\n```rescript\nConsole.debugMany([\"Hello\", \"World\"])\nConsole.debugMany([1, 2, 3])\n```" + ], + "signature": "let debugMany: array<'a> => unit" + }, + { + "id": "Stdlib.Console.dirOptions", + "kind": "type", + "name": "dirOptions", + "docstrings": [], + "signature": "type dirOptions = {\n colors?: bool,\n depth?: Nullable.t,\n showHidden?: bool,\n}" + }, + { + "id": "Stdlib.Console.dir", + "kind": "value", + "name": "dir", + "docstrings": [ + "`dir(object, options)` displays an interactive view of the object in the console.\n\nSee [`console.dir`](https://developer.mozilla.org/en-US/docs/Web/API/console/dir)\non MDN.\n\n## Examples\n\n```rescript\nConsole.dir({\"language\": \"rescript\", \"version\": \"10.1.2\"})\nConsole.dir({\"language\": \"rescript\", \"version\": {\"major\": \"10\", \"minor\": \"1\", \"patch\": \"2\"}}, ~options={depth: null})\n```" + ], + "signature": "let dir: ('a, ~options: dirOptions=?) => unit" + }, + { + "id": "Stdlib.Console.dirxml", + "kind": "value", + "name": "dirxml", + "docstrings": [ + "`dirxml(object)` displays an interactive tree view of an XML/HTML element in the console.\n\nSee [`console.dirxml`](https://developer.mozilla.org/en-US/docs/Web/API/console/dirxml)\non MDN." + ], + "signature": "let dirxml: 'a => unit" + }, + { + "id": "Stdlib.Console.error", + "kind": "value", + "name": "error", + "docstrings": [ + "`error(value)` prints an error message to console.\n\nSee [`console.error`](https://developer.mozilla.org/en-US/docs/Web/API/console/error)\non MDN.\n\n## Examples\n\n```rescript\nConsole.error(\"error message\")\nConsole.error((\"error\", \"invalid value\"))\n```" + ], + "signature": "let error: 'a => unit" + }, + { + "id": "Stdlib.Console.error2", + "kind": "value", + "name": "error2", + "docstrings": [ + "`error(v1, v2)`. Like `error`, but two arguments.\n\n## Examples\n\n```rescript\nConsole.error2(\"Error\", \"here\")\nConsole.error2((\"log\", \"error\"), \"message\")\n```" + ], + "signature": "let error2: ('a, 'b) => unit" + }, + { + "id": "Stdlib.Console.error3", + "kind": "value", + "name": "error3", + "docstrings": [ + "`error3(v1, v2, v3)`. Like `error`, but three arguments.\n\n## Examples\n\n```rescript\nConsole.error3(\"Hello\", \"World\", \"!!!\")\nConsole.error3(#first, #second, #third)\n```" + ], + "signature": "let error3: ('a, 'b, 'c) => unit" + }, + { + "id": "Stdlib.Console.error4", + "kind": "value", + "name": "error4", + "docstrings": [ + "`error4(v1, v2, v3, v4)`. Like `error`, but with four arguments.\n\n## Examples\n\n```rescript\nConsole.error4(\"Hello\", \"World\", \"ReScript\", '!')\nConsole.error4(#first, #second, #third, (\"fourth\"))\n```" + ], + "signature": "let error4: ('a, 'b, 'c, 'd) => unit" + }, + { + "id": "Stdlib.Console.error5", + "kind": "value", + "name": "error5", + "docstrings": [ + "`error5(v1, v2, v3, v4, v5)`. Like `error`, but with five arguments.\n\n## Examples\n\n```rescript\nConsole.error5('e', 'r', 'r', 'o', 'r')\nConsole.error5(1, #second, #third, (\"fourth\"), 'c')\n```" + ], + "signature": "let error5: ('a, 'b, 'c, 'd, 'e) => unit" }, { - "id": "Core.DataView.setInt8", + "id": "Stdlib.Console.error6", "kind": "value", - "name": "setInt8", - "docstrings": [], - "signature": "let setInt8: (t, int) => unit" + "name": "error6", + "docstrings": [ + "`error6(v1, v2, v3, v4, v5, v6)`. Like `error`, but with six arguments.\n\n## Examples\n\n```rescript\nConsole.error6(\"Hello\", \"World\", \"from\", \"JS\", \"!!!\", '!')\nConsole.error6([1, 2], (3, 4), [#5, #6], #\"polyvar\", {\"name\": \"ReScript\"}, 42)\n```" + ], + "signature": "let error6: ('a, 'b, 'c, 'd, 'e, 'f) => unit" }, { - "id": "Core.DataView.setUint8", + "id": "Stdlib.Console.group", "kind": "value", - "name": "setUint8", - "docstrings": [], - "signature": "let setUint8: (t, int) => unit" + "name": "group", + "docstrings": [ + "`group(label)` creates a new \"group\" level with the given label.\n\nSee [`console.group`](https://developer.mozilla.org/en-US/docs/Web/API/console/group)\non MDN.\n\n## Example\n\n```rescript\nConsole.group(\"first group\")\nConsole.group(\"second group\")\nConsole.log(\"a message on the second level\")\nConsole.groupEnd()\nConsole.log(\"a message message on the first level\")\nConsole.groupEnd()\n```" + ], + "signature": "let group: string => unit" }, { - "id": "Core.DataView.setInt16", + "id": "Stdlib.Console.groupCollapsed", "kind": "value", - "name": "setInt16", - "docstrings": [], - "signature": "let setInt16: (t, int) => unit" + "name": "groupCollapsed", + "docstrings": [ + "`groupCollapsed(label)`. Like `group` but collapses the group initially.\n\nSee [`console.groupCollapsed`](https://developer.mozilla.org/en-US/docs/Web/API/console/groupCollapsed)\non MDN." + ], + "signature": "let groupCollapsed: string => unit" }, { - "id": "Core.DataView.setUint16", + "id": "Stdlib.Console.groupEnd", "kind": "value", - "name": "setUint16", - "docstrings": [], - "signature": "let setUint16: (t, int) => unit" + "name": "groupEnd", + "docstrings": [ + "`groupEnd()` ends the current group.\n\nSee [`console.groupEnd`](https://developer.mozilla.org/en-US/docs/Web/API/console/groupEnd)\non MDN." + ], + "signature": "let groupEnd: unit => unit" }, { - "id": "Core.DataView.setInt32", + "id": "Stdlib.Console.errorMany", "kind": "value", - "name": "setInt32", - "docstrings": [], - "signature": "let setInt32: (t, int) => unit" + "name": "errorMany", + "docstrings": [ + "`errorMany(arr)`. Like `error`, but variadic.\n\n## Examples\n\n```rescript\nConsole.errorMany([\"Hello\", \"World\"])\nConsole.errorMany([1, 2, 3])\n```" + ], + "signature": "let errorMany: array<'a> => unit" }, { - "id": "Core.DataView.setUint32", + "id": "Stdlib.Console.info", "kind": "value", - "name": "setUint32", - "docstrings": [], - "signature": "let setUint32: (t, int) => unit" + "name": "info", + "docstrings": [ + "`info(value)` print an informational message to console.\n\nSee [`console.info`](https://developer.mozilla.org/en-US/docs/Web/API/console/info)\non MDN.\n\n## Examples\n\n```rescript\nConsole.info(\"Information\")\nConsole.info((\"Hello\", \"JS\"))\n```" + ], + "signature": "let info: 'a => unit" }, { - "id": "Core.DataView.setFloat32", + "id": "Stdlib.Console.info2", "kind": "value", - "name": "setFloat32", - "docstrings": [], - "signature": "let setFloat32: (t, float) => unit" + "name": "info2", + "docstrings": [ + "`info2(v1, v2)`. Like `info`, but with two arguments.\n\n## Examples\n\n```rescript\nConsole.info2(\"Info\", \"failed to download\")\nConsole.info2(#info, {\"name\": \"ReScript\"})\n```" + ], + "signature": "let info2: ('a, 'b) => unit" }, { - "id": "Core.DataView.setFloat64", + "id": "Stdlib.Console.info3", "kind": "value", - "name": "setFloat64", - "docstrings": [], - "signature": "let setFloat64: (t, float) => unit" + "name": "info3", + "docstrings": [ + "`info3(v1, v2, v3)`. Like `info`, but with three arguments.\n\n## Examples\n\n```rescript\nConsole.info3(\"Hello\", \"World\", \"ReScript\")\nConsole.info3([1, 2, 3], #4, #5)\n```" + ], + "signature": "let info3: ('a, 'b, 'c) => unit" }, { - "id": "Core.DataView.setBigInt64", + "id": "Stdlib.Console.info4", "kind": "value", - "name": "setBigInt64", - "docstrings": [], - "signature": "let setBigInt64: (t, bigint) => unit" + "name": "info4", + "docstrings": [ + "`info4(v1, v2, v3, v4)`. Like `info`, but with four arguments.\n\n## Examples\n\n```rescript\nConsole.info4(\"Hello\", \"World\", \"ReScript\", '!')\nConsole.info4([1, 2, 3], #4, #5, #lastinfo)\n```" + ], + "signature": "let info4: ('a, 'b, 'c, 'd) => unit" }, { - "id": "Core.DataView.setBigUint64", + "id": "Stdlib.Console.info5", "kind": "value", - "name": "setBigUint64", - "docstrings": [], - "signature": "let setBigUint64: (t, bigint) => unit" - } - ] - }, - "core/console": { - "id": "Core.Console", - "name": "Console", - "docstrings": [ - "Functions for interacting with JavaScript console.\n\nSee: [`console`](https://developer.mozilla.org/en-US/docs/Web/API/Console)." - ], - "items": [ + "name": "info5", + "docstrings": [ + "`info5(v1, v2, v3, v4, v5)`. Like `info`, but with five arguments.\n\n## Examples\n\n```rescript\nConsole.info5(\"Hello\", \"World\", \"from\", \"JS\", \"!!!\")\nConsole.info5([1, 2], (3, 4), [#5, #6], #\"polyvar\", {\"name\": \"ReScript\"})\n```" + ], + "signature": "let info5: ('a, 'b, 'c, 'd, 'e) => unit" + }, { - "id": "Core.Console.assert_", + "id": "Stdlib.Console.info6", "kind": "value", - "name": "assert_", + "name": "info6", "docstrings": [ - "`assert_(assertion, value)` print a message to console if `assertion` evaluates `false`. Does nothing if it's `true`.\n\nSee [`console.assert`](https://developer.mozilla.org/en-US/docs/Web/API/console/assert)\non MDN.\n\n## Examples\n\n```rescript\nConsole.assert_(false, \"Hello World!\")\nConsole.assert_(42 == 42, \"The answer\")\n```" + "`info6(v1, v2, v3, v4, v5, v6)`. Like `info`, but with six arguments.\n\n## Examples\n\n```rescript\nConsole.info6(\"Hello\", \"World\", \"from\", \"JS\", \"!!!\", '!')\nConsole.info6([1, 2], (3, 4), [#5, #6], #\"polyvar\", {\"name\": \"ReScript\"}, 42)\n```" ], - "signature": "let assert_: (bool, 'a) => unit" + "signature": "let info6: ('a, 'b, 'c, 'd, 'e, 'f) => unit" }, { - "id": "Core.Console.assert2", + "id": "Stdlib.Console.infoMany", "kind": "value", - "name": "assert2", + "name": "infoMany", "docstrings": [ - "`assert2(v1, v2)`. Like `assert_`, but with two arguments.\n\n## Examples\n\n```rescript\nConsole.assert2(false, \"Hello\", \"World\")\nConsole.assert2(42 == 42, [1, 2, 3], '4')\n```" + "`infoMany(arr)`. Like `info`, but variadic.\n\n## Examples\n\n```rescript\nConsole.infoMany([\"Hello\", \"World\"])\nConsole.infoMany([1, 2, 3])\n```" ], - "signature": "let assert2: (bool, 'a, 'b) => unit" + "signature": "let infoMany: array<'a> => unit" }, { - "id": "Core.Console.assert3", + "id": "Stdlib.Console.log", "kind": "value", - "name": "assert3", + "name": "log", "docstrings": [ - "`assert3(v1, v2, v3)`. Like `assert_`, but with three arguments.\n\n## Examples\n\n```rescript\nConsole.assert3(false, \"Hello\", \"World\", \"ReScript\")\nConsole.assert3(42 == 42, \"One\", 2, #3)\n```" + "`log(value)` print a message to console.\n\nSee [`console.log`](https://developer.mozilla.org/en-US/docs/Web/API/console/log)\non MDN.\n\n## Examples\n\n```rescript\nConsole.log(\"Hello\")\nlet obj = {\"name\": \"ReScript\", \"version\": 10}\nConsole.log(obj)\n```" ], - "signature": "let assert3: (bool, 'a, 'b, 'c) => unit" + "signature": "let log: 'a => unit" }, { - "id": "Core.Console.assert4", + "id": "Stdlib.Console.log2", "kind": "value", - "name": "assert4", + "name": "log2", "docstrings": [ - "`assert4(v1, v2, v3, v4)`. Like `assert_`, but with four arguments.\n\n## Examples\n\n```rescript\nlet value = 42\nConsole.assert4(false, \"Hello\", \"World\", \"ReScript\", \"!!!\")\nConsole.assert4(value == 42, [1, 2], (3, 4), [#5, #6], #\"polyvar\")\n```" + "`log2(v1, v2)`. Like `log`, but with two arguments.\n\n## Examples\n\n```rescript\nConsole.log2(\"Hello\", \"World\")\nConsole.log2([1, 2, 3], '4')\n```" ], - "signature": "let assert4: (bool, 'a, 'b, 'c, 'd) => unit" + "signature": "let log2: ('a, 'b) => unit" }, { - "id": "Core.Console.assert5", + "id": "Stdlib.Console.log3", "kind": "value", - "name": "assert5", + "name": "log3", "docstrings": [ - "`assert5(v1, v2, v3, v4, v5)`. Like `assert_`, but with five arguments.\n\n## Examples\n\n```rescript\nlet value = 42\nConsole.assert5(false, \"Hello\", \"World\", \"JS\", '!', '!')\nConsole.assert5(value == 42, [1, 2], (3, 4), [#5, #6], #\"polyvar\", {\"name\": \"ReScript\"})\n```" + "`log3(v1, v2, v3)`. Like `log`, but with three arguments.\n\n## Examples\n\n```rescript\nConsole.log3(\"Hello\", \"World\", \"ReScript\")\nConsole.log3(\"One\", 2, #3)\n```" ], - "signature": "let assert5: (bool, 'a, 'b, 'c, 'd, 'e) => unit" + "signature": "let log3: ('a, 'b, 'c) => unit" }, { - "id": "Core.Console.assert6", + "id": "Stdlib.Console.log4", "kind": "value", - "name": "assert6", + "name": "log4", "docstrings": [ - "`assert6(v1, v2)`. Like `assert_`, but with six arguments.\n\n## Examples\n\n```rescript\nlet value = 42\nConsole.assert6(false, \"Hello\", \"World\", \"JS\", '!', '!', '?')\nConsole.assert6(value == 42, [1, 2], (3, 4), [#5, #6], #\"polyvar\", {\"name\": \"ReScript\"}, 42)\n```" + "`log4(v1, v2, v3, v4)`. Like `log`, but with four arguments.\n\n## Examples\n\n```rescript\nConsole.log4(\"Hello\", \"World\", \"ReScript\", \"!!!\")\nConsole.log4([1, 2], (3, 4), [#5, #6], #\"polyvar\")\n```" ], - "signature": "let assert6: (bool, 'a, 'b, 'c, 'd, 'e, 'f) => unit" + "signature": "let log4: ('a, 'b, 'c, 'd) => unit" }, { - "id": "Core.Console.assertMany", + "id": "Stdlib.Console.log5", "kind": "value", - "name": "assertMany", + "name": "log5", "docstrings": [ - "`assertMany(assertion, arr)`. Like `assert_`, but variadic.\n\n## Examples\n\n```rescript\nlet value = 42\nConsole.assertMany(false, [\"Hello\", \"World\"])\nConsole.assertMany(value == 42, [1, 2, 3])\n```" + "`log5(v1, v2, v3, v4, v5)`. Like `log`, but with five arguments.\n\n## Examples\n\n```rescript\nConsole.log5(\"Hello\", \"World\", \"JS\", '!', '!')\nConsole.log5([1, 2], (3, 4), [#5, #6], #\"polyvar\", {\"name\": \"ReScript\"})\n```" ], - "signature": "let assertMany: (bool, array<'a>) => unit" + "signature": "let log5: ('a, 'b, 'c, 'd, 'e) => unit" }, { - "id": "Core.Console.clear", + "id": "Stdlib.Console.log6", "kind": "value", - "name": "clear", + "name": "log6", "docstrings": [ - "`clear()` clears the console, if allowed.\n\nSee [`console.clear`](https://developer.mozilla.org/en-US/docs/Web/API/console/clear)\non MDN.\n\n## Examples\n\n```rescript\nConsole.clear()\n```" + "`log6(v1, v2, v3, v4, v5, v6)`. Like `log`, but with six arguments.\n\n## Examples\n\n```rescript\nConsole.log6(\"Hello\", \"World\", \"JS\", '!', '!', '?')\nConsole.log6([1, 2], (3, 4), [#5, #6], #\"polyvar\", {\"name\": \"ReScript\"}, 42)\n```" ], - "signature": "let clear: unit => unit" + "signature": "let log6: ('a, 'b, 'c, 'd, 'e, 'f) => unit" }, { - "id": "Core.Console.count", + "id": "Stdlib.Console.logMany", "kind": "value", - "name": "count", + "name": "logMany", "docstrings": [ - "`count(label)` prints to the console the number of times it's been called with the given label.\n\nSee [`console.count`](https://developer.mozilla.org/en-US/docs/Web/API/console/count)\non MDN.\n\n## Examples\n\n```rescript\nConsole.count(\"rescript\")\n```" + "`logMany(arr)`. Like `log`, but variadic.\n\n## Examples\n\n```rescript\nConsole.logMany([\"Hello\", \"World\"])\nConsole.logMany([1, 2, 3])\n```" ], - "signature": "let count: string => unit" + "signature": "let logMany: array<'a> => unit" }, { - "id": "Core.Console.countReset", + "id": "Stdlib.Console.table", "kind": "value", - "name": "countReset", + "name": "table", "docstrings": [ - "`countReset(label)` resets the count for the given label to 0.\n\nSee [`console.countReset`](https://developer.mozilla.org/en-US/docs/Web/API/console/countReset)\non MDN.\n\n## Examples\n\n```rescript\nConsole.countReset(\"rescript\")\n```" + "`table(object)` displays an tabular view of the object in the console.\n\nSee [`console.table`](https://developer.mozilla.org/en-US/docs/Web/API/console/table)\non MDN.\n\n## Examples\n\n```rescript\nConsole.table({\"language\": \"rescript\", \"version\": \"10.1.2\"})\n```" ], - "signature": "let countReset: string => unit" + "signature": "let table: 'a => unit" }, { - "id": "Core.Console.debug", + "id": "Stdlib.Console.time", "kind": "value", - "name": "debug", + "name": "time", "docstrings": [ - "`debug(value)` print a debug message to console.\n\nSee [`console.debug`](https://developer.mozilla.org/en-US/docs/Web/API/console/debug)\non MDN.\n\n## Examples\n\n```rescript\nConsole.debug(\"Hello\")\nlet obj = {\"name\": \"ReScript\", \"version\": 10}\nConsole.debug(obj)\n```" + "`time(label)` creates a timer to measure how long an operation takes. `label`\nmust be a unique name. Call `console.timeEnd` with the same `label` to print\noutput time.\n\nSee [`console.time`](https://developer.mozilla.org/en-US/docs/Web/API/console/time)\non MDN.\n\n## Examples\n\n```rescript\nConsole.time(\"for_time\")\nfor x in 3 downto 1 {\n Console.log(x)\n Console.timeLog(\"for_time\")\n}\nConsole.timeEnd(\"for_time\")\n```" ], - "signature": "let debug: 'a => unit" + "signature": "let time: string => unit" }, { - "id": "Core.Console.debug2", + "id": "Stdlib.Console.timeEnd", "kind": "value", - "name": "debug2", + "name": "timeEnd", "docstrings": [ - "`debug2(v1, v2)`. Like `debug`, but with two arguments.\n\n## Examples\n\n```rescript\nConsole.debug2(\"Hello\", \"World\")\nConsole.debug2([1, 2, 3], '4')\n```" + "`timeEnd(label)` stops a timer created by `time`.\n\nSee [`console.timeEnd`](https://developer.mozilla.org/en-US/docs/Web/API/console/timeEnd)\non MDN.\n\n## Examples\n\n```rescript\nConsole.time(\"for_time\")\nfor x in 3 downto 1 {\n Console.log(x)\n Console.timeLog(\"for_time\")\n}\nConsole.timeEnd(\"for_time\")\n```" ], - "signature": "let debug2: ('a, 'b) => unit" + "signature": "let timeEnd: string => unit" }, { - "id": "Core.Console.debug3", + "id": "Stdlib.Console.timeLog", "kind": "value", - "name": "debug3", + "name": "timeLog", "docstrings": [ - "`debug3(v1, v2, v3)`. Like `debug`, but with three arguments.\n\n## Examples\n\n```rescript\nConsole.debug3(\"Hello\", \"World\", \"ReScript\")\nConsole.debug3(\"One\", 2, #3)\n```" + "`timeLog(label)` prints the current elapsed time of the given timer to the console.\n\nSee [`console.timeLog`](https://developer.mozilla.org/en-US/docs/Web/API/console/timeLog)\non MDN.\n\n## Examples\n\n```rescript\nConsole.time(\"for_time\")\nfor x in 3 downto 1 {\n Console.log(x)\n Console.timeLog(\"for_time\")\n}\nConsole.timeEnd(\"for_time\")\n```" ], - "signature": "let debug3: ('a, 'b, 'c) => unit" + "signature": "let timeLog: string => unit" }, { - "id": "Core.Console.debug4", + "id": "Stdlib.Console.trace", "kind": "value", - "name": "debug4", + "name": "trace", "docstrings": [ - "`debug4(v1, v2, v3, v4)`. Like `debug`, but with four arguments.\n\n## Examples\n\n```rescript\nConsole.debug4(\"Hello\", \"World\", \"ReScript\", \"!!!\")\nConsole.debug4([1, 2], (3, 4), [#5, #6], #\"polyvar\")\n```" + "`trace()` print a stack trace to console.\n\nSee [`console.trace`](https://developer.mozilla.org/en-US/docs/Web/API/console/trace)\non MDN.\n\n## Examples\n\n```rescript\nlet main = () => {\n Console.trace()\n}\nmain()\n// In the console, the following trace will be displayed:\n// main\n// \n```" ], - "signature": "let debug4: ('a, 'b, 'c, 'd) => unit" + "signature": "let trace: unit => unit" }, { - "id": "Core.Console.debug5", + "id": "Stdlib.Console.warn", "kind": "value", - "name": "debug5", + "name": "warn", "docstrings": [ - "`debug5(v1, v2, v3, v4, v5)`. Like `debug`, but with five arguments.\n\n## Examples\n\n```rescript\nConsole.debug5(\"Hello\", \"World\", \"JS\", '!', '!')\nConsole.debug5([1, 2], (3, 4), [#5, #6], #\"polyvar\", {\"name\": \"ReScript\"})\n```" + "`warn(value)` print a warning message to console.\n\nSee [`console.warn`](https://developer.mozilla.org/en-US/docs/Web/API/console/warn)\non MDN.\n\n## Examples\n\n```rescript\nConsole.warn(\"Warning\")\nConsole.warn((\"Warning\", \"invalid number\"))\n```" ], - "signature": "let debug5: ('a, 'b, 'c, 'd, 'e) => unit" + "signature": "let warn: 'a => unit" }, { - "id": "Core.Console.debug6", + "id": "Stdlib.Console.warn2", "kind": "value", - "name": "debug6", + "name": "warn2", "docstrings": [ - "`debug6(v1, v2, v3, v4, v5, v6)`. Like `debug`, but with six arguments.\n\n## Examples\n\n```rescript\nConsole.debug6(\"Hello\", \"World\", \"JS\", '!', '!', '?')\nConsole.debug6([1, 2], (3, 4), [#5, #6], #\"polyvar\", {\"name\": \"ReScript\"}, 42)\n```" + "`warn2(v1, v2)`. Like `warn`, but two arguments.\n\n## Examples\n\n```rescript\nConsole.warn2(\"Hello\", \"World\")\nConsole.warn2([1, 2, 3], 4)\n```" ], - "signature": "let debug6: ('a, 'b, 'c, 'd, 'e, 'f) => unit" + "signature": "let warn2: ('a, 'b) => unit" }, { - "id": "Core.Console.debugMany", + "id": "Stdlib.Console.warn3", "kind": "value", - "name": "debugMany", + "name": "warn3", "docstrings": [ - "`debugMany(arr)`. Like `debug`, but variadic.\n\n## Examples\n\n```rescript\nConsole.debugMany([\"Hello\", \"World\"])\nConsole.debugMany([1, 2, 3])\n```" + "`warn3(v1, v2, v3)`. Like `warn`, but three arguments.\n\n## Examples\n\n```rescript\nConsole.warn3(\"Hello\", \"World\", \"ReScript\")\nConsole.warn3([1, 2, 3], #4, #5)\n```" ], - "signature": "let debugMany: array<'a> => unit" + "signature": "let warn3: ('a, 'b, 'c) => unit" }, { - "id": "Core.Console.dir", + "id": "Stdlib.Console.warn4", "kind": "value", - "name": "dir", + "name": "warn4", "docstrings": [ - "`dir(object)` displays an interactive view of the object in the console.\n\nSee [`console.dir`](https://developer.mozilla.org/en-US/docs/Web/API/console/dir)\non MDN.\n\n## Examples\n\n```rescript\nConsole.dir({\"language\": \"rescript\", \"version\": \"10.1.2\"})\n```" + "`warn4(v1, v2, v3, v4)`. Like `warn`, but with four arguments.\n\n## Examples\n\n```rescript\nConsole.warn4(\"Hello\", \"World\", \"ReScript\", \"!!!\")\nConsole.warn4(#first, #second, #third, (\"fourth\"))\n```" ], - "signature": "let dir: 'a => unit" + "signature": "let warn4: ('a, 'b, 'c, 'd) => unit" }, { - "id": "Core.Console.dirxml", + "id": "Stdlib.Console.warn5", "kind": "value", - "name": "dirxml", + "name": "warn5", "docstrings": [ - "`dirxml(object)` displays an interactive tree view of an XML/HTML element in the console.\n\nSee [`console.dirxml`](https://developer.mozilla.org/en-US/docs/Web/API/console/dirxml)\non MDN." + "`warn5(v1, v2, v3, v4, v5)`. Like `warn`, but with five arguments.\n\n## Examples\n\n```rescript\nConsole.warn5(\"Hello\", \"World\", \"from\", \"JS\", \"!!!\")\nConsole.warn5([1, 2], (3, 4), [#5, #6], #\"polyvar\", {\"name\": \"ReScript\"})\n```" ], - "signature": "let dirxml: 'a => unit" + "signature": "let warn5: ('a, 'b, 'c, 'd, 'e) => unit" }, { - "id": "Core.Console.error", + "id": "Stdlib.Console.warn6", "kind": "value", - "name": "error", + "name": "warn6", "docstrings": [ - "`error(value)` prints an error message to console.\n\nSee [`console.error`](https://developer.mozilla.org/en-US/docs/Web/API/console/error)\non MDN.\n\n## Examples\n\n```rescript\nConsole.error(\"error message\")\nConsole.error((\"error\", \"invalid value\"))\n```" + "`warn6(v1, v2, v3, v4, v5, v6)`. Like `warn`, but with six arguments.\n\n## Examples\n\n```rescript\nConsole.warn6(\"Hello\", \"World\", \"from\", \"JS\", \"!!!\", '!')\nConsole.warn6([1, 2], (3, 4), [#5, #6], #\"polyvar\", {\"name\": \"ReScript\"}, 42)\n```" ], - "signature": "let error: 'a => unit" + "signature": "let warn6: ('a, 'b, 'c, 'd, 'e, 'f) => unit" }, { - "id": "Core.Console.error2", + "id": "Stdlib.Console.warnMany", "kind": "value", - "name": "error2", + "name": "warnMany", "docstrings": [ - "`error(v1, v2)`. Like `error`, but two arguments.\n\n## Examples\n\n```rescript\nConsole.error2(\"Error\", \"here\")\nConsole.error2((\"log\", \"error\"), \"message\")\n```" + "`warnMany(arr)`. Like `warn`, but variadic.\n\n## Examples\n\n```rescript\nConsole.warnMany([\"Hello\", \"World\"])\nConsole.warnMany([1, 2, 3])\n```" ], - "signature": "let error2: ('a, 'b) => unit" + "signature": "let warnMany: array<'a> => unit" + } + ] + }, + "stdlib/bool": { + "id": "Stdlib.Bool", + "name": "Bool", + "docstrings": [ + "Functions for interacting with JavaScript booleans.\nSee: [`Boolean`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)" + ], + "items": [ + { + "id": "Stdlib.Bool.t", + "kind": "type", + "name": "t", + "docstrings": [ + "Type representing a boolean." + ], + "signature": "type t = bool" }, { - "id": "Core.Console.error3", + "id": "Stdlib.Bool.toString", "kind": "value", - "name": "error3", + "name": "toString", "docstrings": [ - "`error3(v1, v2, v3)`. Like `error`, but three arguments.\n\n## Examples\n\n```rescript\nConsole.error3(\"Hello\", \"World\", \"!!!\")\nConsole.error3(#first, #second, #third)\n```" + "Converts a boolean to a string.\n\n## Examples\n```rescript\nBool.toString(true)->assertEqual(\"true\")\nBool.toString(false)->assertEqual(\"false\")\n```" ], - "signature": "let error3: ('a, 'b, 'c) => unit" + "signature": "let toString: bool => string" }, { - "id": "Core.Console.error4", + "id": "Stdlib.Bool.fromString", "kind": "value", - "name": "error4", + "name": "fromString", "docstrings": [ - "`error4(v1, v2, v3, v4)`. Like `error`, but with four arguments.\n\n## Examples\n\n```rescript\nConsole.error4(\"Hello\", \"World\", \"ReScript\", '!')\nConsole.error4(#first, #second, #third, (\"fourth\"))\n```" + "Converts a string to a boolean.\n\n## Examples\n```rescript\nBool.fromString(\"true\")->assertEqual(Some(true))\nBool.fromString(\"false\")->assertEqual(Some(false))\nBool.fromString(\"notAValidBoolean\")->assertEqual(None)\n```" ], - "signature": "let error4: ('a, 'b, 'c, 'd) => unit" + "signature": "let fromString: string => option" }, { - "id": "Core.Console.error5", + "id": "Stdlib.Bool.fromStringOrThrow", "kind": "value", - "name": "error5", + "name": "fromStringOrThrow", "docstrings": [ - "`error5(v1, v2, v3, v4, v5)`. Like `error`, but with five arguments.\n\n## Examples\n\n```rescript\nConsole.error5('e', 'r', 'r', 'o', 'r')\nConsole.error5(1, #second, #third, (\"fourth\"), 'c')\n```" + "Converts a string to a boolean.\nThrows an `Invalid_argument` exception if the string is not a valid boolean.\n\n## Examples\n```rescript\nBool.fromStringOrThrow(\"true\")->assertEqual(true)\nBool.fromStringOrThrow(\"false\")->assertEqual(false)\nswitch Bool.fromStringOrThrow(\"notAValidBoolean\") {\n| exception Invalid_argument(_) => assert(true)\n| _ => assert(false)\n}\n```" ], - "signature": "let error5: ('a, 'b, 'c, 'd, 'e) => unit" + "signature": "let fromStringOrThrow: string => bool" }, { - "id": "Core.Console.error6", + "id": "Stdlib.Bool.fromStringExn", "kind": "value", - "name": "error6", + "name": "fromStringExn", "docstrings": [ - "`error6(v1, v2, v3, v4, v5, v6)`. Like `error`, but with six arguments.\n\n## Examples\n\n```rescript\nConsole.error6(\"Hello\", \"World\", \"from\", \"JS\", \"!!!\", '!')\nConsole.error6([1, 2], (3, 4), [#5, #6], #\"polyvar\", {\"name\": \"ReScript\"}, 42)\n```" + "Converts a string to a boolean.\nBeware, this function will throw an `Invalid_argument` exception \nif the string is not a valid boolean.\n\n## Examples\n```rescript\nBool.fromStringExn(\"true\")->assertEqual(true)\nBool.fromStringExn(\"false\")->assertEqual(false)\nswitch Bool.fromStringExn(\"notAValidBoolean\") {\n| exception Invalid_argument(_) => assert(true)\n| _ => assert(false)\n}\n```" ], - "signature": "let error6: ('a, 'b, 'c, 'd, 'e, 'f) => unit" + "signature": "let fromStringExn: string => bool", + "deprecated": "Use `fromStringOrThrow` instead" }, { - "id": "Core.Console.group", + "id": "Stdlib.Bool.compare", "kind": "value", - "name": "group", + "name": "compare", + "docstrings": [], + "signature": "let compare: (bool, bool) => Ordering.t" + }, + { + "id": "Stdlib.Bool.equal", + "kind": "value", + "name": "equal", + "docstrings": [], + "signature": "let equal: (bool, bool) => bool" + } + ] + }, + "stdlib/bigint": { + "id": "Stdlib.BigInt", + "name": "BigInt", + "docstrings": [], + "items": [ + { + "id": "Stdlib.BigInt.t", + "kind": "type", + "name": "t", "docstrings": [ - "`group(label)` creates a new \"group\" level with the given label.\n\nSee [`console.group`](https://developer.mozilla.org/en-US/docs/Web/API/console/group)\non MDN.\n\n## Example\n\n```rescript\nConsole.group(\"first group\")\nConsole.group(\"second group\")\nConsole.log(\"a message on the second level\")\nConsole.groupEnd()\nConsole.log(\"a message message on the first level\")\nConsole.groupEnd()\n```" + "Type representing a bigint." ], - "signature": "let group: string => unit" + "signature": "type t = bigint" }, { - "id": "Core.Console.groupCollapsed", + "id": "Stdlib.BigInt.asIntN", "kind": "value", - "name": "groupCollapsed", + "name": "asIntN", + "docstrings": [], + "signature": "let asIntN: (~width: int, bigint) => bigint" + }, + { + "id": "Stdlib.BigInt.asUintN", + "kind": "value", + "name": "asUintN", + "docstrings": [], + "signature": "let asUintN: (~width: int, bigint) => bigint" + }, + { + "id": "Stdlib.BigInt.fromStringOrThrow", + "kind": "value", + "name": "fromStringOrThrow", "docstrings": [ - "`groupCollapsed(label)`. Like `group` but collapses the group initially.\n\nSee [`console.groupCollapsed`](https://developer.mozilla.org/en-US/docs/Web/API/console/groupCollapsed)\non MDN." + "Parses the given `string` into a `bigint` using JavaScript semantics. Return the\nnumber as a `bigint` if successfully parsed. Throws a syntax exception otherwise.\n\n## Examples\n\n```rescript\nBigInt.fromStringOrThrow(\"123\")->assertEqual(123n)\n\nBigInt.fromStringOrThrow(\"\")->assertEqual(0n)\n\nBigInt.fromStringOrThrow(\"0x11\")->assertEqual(17n)\n\nBigInt.fromStringOrThrow(\"0b11\")->assertEqual(3n)\n\nBigInt.fromStringOrThrow(\"0o11\")->assertEqual(9n)\n\n/* catch exception */\nswitch BigInt.fromStringOrThrow(\"a\") {\n| exception JsExn(_error) => assert(true)\n| _bigInt => assert(false)\n}\n```" ], - "signature": "let groupCollapsed: string => unit" + "signature": "let fromStringOrThrow: string => bigint" }, { - "id": "Core.Console.groupEnd", + "id": "Stdlib.BigInt.fromString", "kind": "value", - "name": "groupEnd", + "name": "fromString", "docstrings": [ - "`groupEnd()` ends the current group.\n\nSee [`console.groupEnd`](https://developer.mozilla.org/en-US/docs/Web/API/console/groupEnd)\non MDN." + "Parses the given `string` into a `bigint` using JavaScript semantics. Returns \n`Some(bigint)` if the string can be parsed, `None` otherwise.\n\n## Examples\n\n```rescript\nBigInt.fromString(\"123\")->assertEqual(Some(123n))\n\nBigInt.fromString(\"\")->assertEqual(Some(0n))\n\nBigInt.fromString(\"0x11\")->assertEqual(Some(17n))\n\nBigInt.fromString(\"0b11\")->assertEqual(Some(3n))\n\nBigInt.fromString(\"0o11\")->assertEqual(Some(9n))\n\nBigInt.fromString(\"invalid\")->assertEqual(None)\n```" ], - "signature": "let groupEnd: unit => unit" + "signature": "let fromString: string => option" }, { - "id": "Core.Console.errorMany", + "id": "Stdlib.BigInt.fromStringExn", "kind": "value", - "name": "errorMany", - "docstrings": [ - "`errorMany(arr)`. Like `error`, but variadic.\n\n## Examples\n\n```rescript\nConsole.errorMany([\"Hello\", \"World\"])\nConsole.errorMany([1, 2, 3])\n```" - ], - "signature": "let errorMany: array<'a> => unit" + "name": "fromStringExn", + "docstrings": [], + "signature": "let fromStringExn: string => bigint", + "deprecated": "Use `fromStringOrThrow` instead" }, { - "id": "Core.Console.info", + "id": "Stdlib.BigInt.fromInt", "kind": "value", - "name": "info", - "docstrings": [ - "`info(value)` print an informational message to console.\n\nSee [`console.info`](https://developer.mozilla.org/en-US/docs/Web/API/console/info)\non MDN.\n\n## Examples\n\n```rescript\nConsole.info(\"Information\")\nConsole.info((\"Hello\", \"JS\"))\n```" - ], - "signature": "let info: 'a => unit" + "name": "fromInt", + "docstrings": [], + "signature": "let fromInt: int => bigint" }, { - "id": "Core.Console.info2", + "id": "Stdlib.BigInt.fromFloatOrThrow", "kind": "value", - "name": "info2", + "name": "fromFloatOrThrow", "docstrings": [ - "`info2(v1, v2)`. Like `info`, but with two arguments.\n\n## Examples\n\n```rescript\nConsole.info2(\"Info\", \"failed to download\")\nConsole.info2(#info, {\"name\": \"ReScript\"})\n```" + "Converts a `float` to a `bigint` using JavaScript semantics. \nThrows an exception if the float is not an integer or is infinite/NaN.\n\n## Examples\n\n```rescript\nBigInt.fromFloatOrThrow(123.0)->assertEqual(123n)\n\nBigInt.fromFloatOrThrow(0.0)->assertEqual(0n)\n\nBigInt.fromFloatOrThrow(-456.0)->assertEqual(-456n)\n\n/* This will throw an exception */\nswitch BigInt.fromFloatOrThrow(123.5) {\n| exception JsExn(_error) => assert(true)\n| _bigInt => assert(false)\n}\n```" ], - "signature": "let info2: ('a, 'b) => unit" + "signature": "let fromFloatOrThrow: float => bigint" }, { - "id": "Core.Console.info3", + "id": "Stdlib.BigInt.fromFloat", "kind": "value", - "name": "info3", - "docstrings": [ - "`info3(v1, v2, v3)`. Like `info`, but with three arguments.\n\n## Examples\n\n```rescript\nConsole.info3(\"Hello\", \"World\", \"ReScript\")\nConsole.info3([1, 2, 3], #4, #5)\n```" - ], - "signature": "let info3: ('a, 'b, 'c) => unit" + "name": "fromFloat", + "docstrings": [], + "signature": "let fromFloat: float => option" }, { - "id": "Core.Console.info4", + "id": "Stdlib.BigInt.toString", "kind": "value", - "name": "info4", + "name": "toString", "docstrings": [ - "`info4(v1, v2, v3, v4)`. Like `info`, but with four arguments.\n\n## Examples\n\n```rescript\nConsole.info4(\"Hello\", \"World\", \"ReScript\", '!')\nConsole.info4([1, 2, 3], #4, #5, #lastinfo)\n```" + "Formats a `bigint` as a string. Return a `string` representing the given value.\nSee [`toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString) on MDN.\n\n## Examples\n\n```rescript\nBigInt.toString(123n)->assertEqual(\"123\")\n```" ], - "signature": "let info4: ('a, 'b, 'c, 'd) => unit" + "signature": "let toString: (bigint, ~radix: int=?) => string" }, { - "id": "Core.Console.info5", + "id": "Stdlib.BigInt.toStringWithRadix", "kind": "value", - "name": "info5", - "docstrings": [ - "`info5(v1, v2, v3, v4, v5)`. Like `info`, but with five arguments.\n\n## Examples\n\n```rescript\nConsole.info5(\"Hello\", \"World\", \"from\", \"JS\", \"!!!\")\nConsole.info5([1, 2], (3, 4), [#5, #6], #\"polyvar\", {\"name\": \"ReScript\"})\n```" - ], - "signature": "let info5: ('a, 'b, 'c, 'd, 'e) => unit" + "name": "toStringWithRadix", + "docstrings": [], + "signature": "let toStringWithRadix: (bigint, ~radix: int) => string", + "deprecated": "Use `toString` with `~radix` instead" }, { - "id": "Core.Console.info6", + "id": "Stdlib.BigInt.toLocaleString", "kind": "value", - "name": "info6", + "name": "toLocaleString", "docstrings": [ - "`info6(v1, v2, v3, v4, v5, v6)`. Like `info`, but with six arguments.\n\n## Examples\n\n```rescript\nConsole.info6(\"Hello\", \"World\", \"from\", \"JS\", \"!!!\", '!')\nConsole.info6([1, 2], (3, 4), [#5, #6], #\"polyvar\", {\"name\": \"ReScript\"}, 42)\n```" + "Returns a string with a language-sensitive representation of this BigInt value.\n\n## Examples\n\n```rescript\nBigInt.toString(123n)->assertEqual(\"123\")\n```" ], - "signature": "let info6: ('a, 'b, 'c, 'd, 'e, 'f) => unit" + "signature": "let toLocaleString: bigint => string" }, { - "id": "Core.Console.infoMany", + "id": "Stdlib.BigInt.toFloat", "kind": "value", - "name": "infoMany", - "docstrings": [ - "`infoMany(arr)`. Like `info`, but variadic.\n\n## Examples\n\n```rescript\nConsole.infoMany([\"Hello\", \"World\"])\nConsole.infoMany([1, 2, 3])\n```" - ], - "signature": "let infoMany: array<'a> => unit" + "name": "toFloat", + "docstrings": [], + "signature": "let toFloat: bigint => float" }, { - "id": "Core.Console.log", + "id": "Stdlib.BigInt.toInt", "kind": "value", - "name": "log", - "docstrings": [ - "`log(value)` print a message to console.\n\nSee [`console.log`](https://developer.mozilla.org/en-US/docs/Web/API/console/log)\non MDN.\n\n## Examples\n\n```rescript\nConsole.log(\"Hello\")\nlet obj = {\"name\": \"ReScript\", \"version\": 10}\nConsole.log(obj)\n```" - ], - "signature": "let log: 'a => unit" + "name": "toInt", + "docstrings": [], + "signature": "let toInt: bigint => int" }, { - "id": "Core.Console.log2", + "id": "Stdlib.BigInt.add", "kind": "value", - "name": "log2", - "docstrings": [ - "`log2(v1, v2)`. Like `log`, but with two arguments.\n\n## Examples\n\n```rescript\nConsole.log2(\"Hello\", \"World\")\nConsole.log2([1, 2, 3], '4')\n```" - ], - "signature": "let log2: ('a, 'b) => unit" + "name": "add", + "docstrings": [], + "signature": "let add: (bigint, bigint) => bigint" }, { - "id": "Core.Console.log3", + "id": "Stdlib.BigInt.sub", "kind": "value", - "name": "log3", - "docstrings": [ - "`log3(v1, v2, v3)`. Like `log`, but with three arguments.\n\n## Examples\n\n```rescript\nConsole.log3(\"Hello\", \"World\", \"ReScript\")\nConsole.log3(\"One\", 2, #3)\n```" - ], - "signature": "let log3: ('a, 'b, 'c) => unit" + "name": "sub", + "docstrings": [], + "signature": "let sub: (bigint, bigint) => bigint" }, { - "id": "Core.Console.log4", + "id": "Stdlib.BigInt.mul", "kind": "value", - "name": "log4", - "docstrings": [ - "`log4(v1, v2, v3, v4)`. Like `log`, but with four arguments.\n\n## Examples\n\n```rescript\nConsole.log4(\"Hello\", \"World\", \"ReScript\", \"!!!\")\nConsole.log4([1, 2], (3, 4), [#5, #6], #\"polyvar\")\n```" - ], - "signature": "let log4: ('a, 'b, 'c, 'd) => unit" + "name": "mul", + "docstrings": [], + "signature": "let mul: (bigint, bigint) => bigint" }, { - "id": "Core.Console.log5", + "id": "Stdlib.BigInt.div", "kind": "value", - "name": "log5", - "docstrings": [ - "`log5(v1, v2, v3, v4, v5)`. Like `log`, but with five arguments.\n\n## Examples\n\n```rescript\nConsole.log5(\"Hello\", \"World\", \"JS\", '!', '!')\nConsole.log5([1, 2], (3, 4), [#5, #6], #\"polyvar\", {\"name\": \"ReScript\"})\n```" - ], - "signature": "let log5: ('a, 'b, 'c, 'd, 'e) => unit" + "name": "div", + "docstrings": [], + "signature": "let div: (bigint, bigint) => bigint" }, { - "id": "Core.Console.log6", + "id": "Stdlib.BigInt.mod", "kind": "value", - "name": "log6", - "docstrings": [ - "`log6(v1, v2, v3, v4, v5, v6)`. Like `log`, but with six arguments.\n\n## Examples\n\n```rescript\nConsole.log6(\"Hello\", \"World\", \"JS\", '!', '!', '?')\nConsole.log6([1, 2], (3, 4), [#5, #6], #\"polyvar\", {\"name\": \"ReScript\"}, 42)\n```" - ], - "signature": "let log6: ('a, 'b, 'c, 'd, 'e, 'f) => unit" + "name": "mod", + "docstrings": [], + "signature": "let mod: (bigint, bigint) => bigint" }, { - "id": "Core.Console.logMany", + "id": "Stdlib.BigInt.bitwiseAnd", "kind": "value", - "name": "logMany", - "docstrings": [ - "`logMany(arr)`. Like `log`, but variadic.\n\n## Examples\n\n```rescript\nConsole.logMany([\"Hello\", \"World\"])\nConsole.logMany([1, 2, 3])\n```" - ], - "signature": "let logMany: array<'a> => unit" + "name": "bitwiseAnd", + "docstrings": [], + "signature": "let bitwiseAnd: (bigint, bigint) => bigint" }, { - "id": "Core.Console.table", + "id": "Stdlib.BigInt.bitwiseOr", "kind": "value", - "name": "table", - "docstrings": [ - "`table(object)` displays an tabular view of the object in the console.\n\nSee [`console.table`](https://developer.mozilla.org/en-US/docs/Web/API/console/table)\non MDN.\n\n## Examples\n\n```rescript\nConsole.table({\"language\": \"rescript\", \"version\": \"10.1.2\"})\n```" - ], - "signature": "let table: 'a => unit" + "name": "bitwiseOr", + "docstrings": [], + "signature": "let bitwiseOr: (bigint, bigint) => bigint" }, { - "id": "Core.Console.time", + "id": "Stdlib.BigInt.bitwiseXor", "kind": "value", - "name": "time", - "docstrings": [ - "`time(label)` creates a timer to measure how long an operation takes. `label`\nmust be a unique name. Call `console.timeEnd` with the same `label` to print\noutput time.\n\nSee [`console.time`](https://developer.mozilla.org/en-US/docs/Web/API/console/time)\non MDN.\n\n## Examples\n\n```rescript\nConsole.time(\"for_time\")\nfor x in 3 downto 1 {\n Console.log(x)\n Console.timeLog(\"for_time\")\n}\nConsole.timeEnd(\"for_time\")\n```" - ], - "signature": "let time: string => unit" + "name": "bitwiseXor", + "docstrings": [], + "signature": "let bitwiseXor: (bigint, bigint) => bigint" }, { - "id": "Core.Console.timeEnd", + "id": "Stdlib.BigInt.bitwiseNot", "kind": "value", - "name": "timeEnd", - "docstrings": [ - "`timeEnd(label)` stops a timer created by `time`.\n\nSee [`console.timeEnd`](https://developer.mozilla.org/en-US/docs/Web/API/console/timeEnd)\non MDN.\n\n## Examples\n\n```rescript\nConsole.time(\"for_time\")\nfor x in 3 downto 1 {\n Console.log(x)\n Console.timeLog(\"for_time\")\n}\nConsole.timeEnd(\"for_time\")\n```" - ], - "signature": "let timeEnd: string => unit" + "name": "bitwiseNot", + "docstrings": [], + "signature": "let bitwiseNot: bigint => bigint" }, { - "id": "Core.Console.timeLog", + "id": "Stdlib.BigInt.shiftLeft", "kind": "value", - "name": "timeLog", - "docstrings": [ - "`timeLog(label)` prints the current elapsed time of the given timer to the console.\n\nSee [`console.timeLog`](https://developer.mozilla.org/en-US/docs/Web/API/console/timeLog)\non MDN.\n\n## Examples\n\n```rescript\nConsole.time(\"for_time\")\nfor x in 3 downto 1 {\n Console.log(x)\n Console.timeLog(\"for_time\")\n}\nConsole.timeEnd(\"for_time\")\n```" - ], - "signature": "let timeLog: string => unit" + "name": "shiftLeft", + "docstrings": [], + "signature": "let shiftLeft: (bigint, bigint) => bigint" }, { - "id": "Core.Console.trace", + "id": "Stdlib.BigInt.shiftRight", "kind": "value", - "name": "trace", - "docstrings": [ - "`trace()` print a stack trace to console.\n\nSee [`console.trace`](https://developer.mozilla.org/en-US/docs/Web/API/console/trace)\non MDN.\n\n## Examples\n\n```rescript\nlet main = () => {\n Console.trace()\n}\nmain()\n// In the console, the following trace will be displayed:\n// main\n// \n```" - ], - "signature": "let trace: unit => unit" + "name": "shiftRight", + "docstrings": [], + "signature": "let shiftRight: (bigint, bigint) => bigint" }, { - "id": "Core.Console.warn", + "id": "Stdlib.BigInt.ignore", "kind": "value", - "name": "warn", + "name": "ignore", "docstrings": [ - "`warn(value)` print a warning message to console.\n\nSee [`console.warn`](https://developer.mozilla.org/en-US/docs/Web/API/console/warn)\non MDN.\n\n## Examples\n\n```rescript\nConsole.warn(\"Warning\")\nConsole.warn((\"Warning\", \"invalid number\"))\n```" + "`ignore(bigint)` ignores the provided bigint and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." ], - "signature": "let warn: 'a => unit" + "signature": "let ignore: bigint => unit" }, { - "id": "Core.Console.warn2", + "id": "Stdlib.BigInt.land", "kind": "value", - "name": "warn2", - "docstrings": [ - "`warn2(v1, v2)`. Like `warn`, but two arguments.\n\n## Examples\n\n```rescript\nConsole.warn2(\"Hello\", \"World\")\nConsole.warn2([1, 2, 3], 4)\n```" - ], - "signature": "let warn2: ('a, 'b) => unit" + "name": "land", + "docstrings": [], + "signature": "let land: (bigint, bigint) => bigint", + "deprecated": "Use `&` operator or `bitwiseAnd` instead." }, { - "id": "Core.Console.warn3", + "id": "Stdlib.BigInt.lor", "kind": "value", - "name": "warn3", - "docstrings": [ - "`warn3(v1, v2, v3)`. Like `warn`, but three arguments.\n\n## Examples\n\n```rescript\nConsole.warn3(\"Hello\", \"World\", \"ReScript\")\nConsole.warn3([1, 2, 3], #4, #5)\n```" - ], - "signature": "let warn3: ('a, 'b, 'c) => unit" + "name": "lor", + "docstrings": [], + "signature": "let lor: (bigint, bigint) => bigint", + "deprecated": "Use `bitwiseOr` instead." }, { - "id": "Core.Console.warn4", + "id": "Stdlib.BigInt.lxor", "kind": "value", - "name": "warn4", - "docstrings": [ - "`warn4(v1, v2, v3, v4)`. Like `warn`, but with four arguments.\n\n## Examples\n\n```rescript\nConsole.warn4(\"Hello\", \"World\", \"ReScript\", \"!!!\")\nConsole.warn4(#first, #second, #third, (\"fourth\"))\n```" - ], - "signature": "let warn4: ('a, 'b, 'c, 'd) => unit" + "name": "lxor", + "docstrings": [], + "signature": "let lxor: (bigint, bigint) => bigint", + "deprecated": "Use `^` operator or `bitwiseXor` instead." }, { - "id": "Core.Console.warn5", + "id": "Stdlib.BigInt.lnot", "kind": "value", - "name": "warn5", - "docstrings": [ - "`warn5(v1, v2, v3, v4, v5)`. Like `warn`, but with five arguments.\n\n## Examples\n\n```rescript\nConsole.warn5(\"Hello\", \"World\", \"from\", \"JS\", \"!!!\")\nConsole.warn5([1, 2], (3, 4), [#5, #6], #\"polyvar\", {\"name\": \"ReScript\"})\n```" - ], - "signature": "let warn5: ('a, 'b, 'c, 'd, 'e) => unit" + "name": "lnot", + "docstrings": [], + "signature": "let lnot: bigint => bigint", + "deprecated": "Use `~` operator or `bitwiseNot` instead." }, { - "id": "Core.Console.warn6", + "id": "Stdlib.BigInt.lsl", "kind": "value", - "name": "warn6", - "docstrings": [ - "`warn6(v1, v2, v3, v4, v5, v6)`. Like `warn`, but with six arguments.\n\n## Examples\n\n```rescript\nConsole.warn6(\"Hello\", \"World\", \"from\", \"JS\", \"!!!\", '!')\nConsole.warn6([1, 2], (3, 4), [#5, #6], #\"polyvar\", {\"name\": \"ReScript\"}, 42)\n```" - ], - "signature": "let warn6: ('a, 'b, 'c, 'd, 'e, 'f) => unit" + "name": "lsl", + "docstrings": [], + "signature": "let lsl: (bigint, bigint) => bigint", + "deprecated": "Use `<<` operator or `shiftLeft` instead." }, { - "id": "Core.Console.warnMany", + "id": "Stdlib.BigInt.asr", "kind": "value", - "name": "warnMany", - "docstrings": [ - "`warnMany(arr)`. Like `warn`, but variadic.\n\n## Examples\n\n```rescript\nConsole.warnMany([\"Hello\", \"World\"])\nConsole.warnMany([1, 2, 3])\n```" - ], - "signature": "let warnMany: array<'a> => unit" + "name": "asr", + "docstrings": [], + "signature": "let asr: (bigint, bigint) => bigint", + "deprecated": "Use `>>` operator or `shiftRight` instead." } ] }, - "core/array": { - "id": "Core.Array", + "stdlib/array": { + "id": "Stdlib.Array", "name": "Array", - "docstrings": [], + "docstrings": [ + "A mutable array.\n\nCompiles to a regular JavaScript array." + ], "items": [ { - "id": "Core.Array.fromIterator", + "id": "Stdlib.Array.t", + "kind": "type", + "name": "t", + "docstrings": [ + "Type representing an array of value `'a`." + ], + "signature": "type t<'a> = array<'a>" + }, + { + "id": "Stdlib.Array.arrayLike", + "kind": "type", + "name": "arrayLike", + "docstrings": [], + "signature": "type arrayLike<'a>" + }, + { + "id": "Stdlib.Array.fromIterator", "kind": "value", "name": "fromIterator", "docstrings": [ - "`fromIterator(iterator)`\n\n Creates an array from the provided `iterator`\n\n ```res example\n let map = Map.fromArray([(\"foo\", 1), (\"bar\", 2)])\n\n Array.fromIterator(map->Map.values) // [1, 2]\n ```" + "`fromIterator(iterator)`\n\nCreates an array from the provided `iterator`\n\n## Examples\n\n```rescript\nMap.fromArray([(\"foo\", 1), (\"bar\", 2)])\n->Map.values\n->Array.fromIterator\n->assertEqual([1, 2])\n```" ], - "signature": "let fromIterator: Core__Iterator.t<'a> => array<'a>" + "signature": "let fromIterator: Iterator.t<'a> => array<'a>" }, { - "id": "Core.Array.fromArrayLike", + "id": "Stdlib.Array.fromArrayLike", "kind": "value", "name": "fromArrayLike", "docstrings": [], - "signature": "let fromArrayLike: Js.Array2.array_like<'a> => array<'a>" + "signature": "let fromArrayLike: arrayLike<'a> => array<'a>" }, { - "id": "Core.Array.fromArrayLikeWithMap", + "id": "Stdlib.Array.fromArrayLikeWithMap", "kind": "value", "name": "fromArrayLikeWithMap", "docstrings": [], - "signature": "let fromArrayLikeWithMap: (Js.Array2.array_like<'a>, 'a => 'b) => array<'b>" + "signature": "let fromArrayLikeWithMap: (arrayLike<'a>, 'a => 'b) => array<'b>" }, { - "id": "Core.Array.make", + "id": "Stdlib.Array.make", "kind": "value", "name": "make", "docstrings": [ - "`make(~length, init)`\n\n Creates an array of length `length` initialized with the value of `init`.\n\n ```res example\n Array.make(~length=3, #apple) == [#apple, #apple, #apple]\n ```" + "`make(~length, init)`\n\nCreates an array of length `length` initialized with the value of `init`.\n\n## Examples\n\n```rescript\nArray.make(~length=3, #apple)->assertEqual([#apple, #apple, #apple])\nArray.make(~length=6, 7)->assertEqual([7, 7, 7, 7, 7, 7])\n```" ], "signature": "let make: (~length: int, 'a) => array<'a>" }, { - "id": "Core.Array.fromInitializer", + "id": "Stdlib.Array.fromInitializer", "kind": "value", "name": "fromInitializer", "docstrings": [ - "`fromInitializer(~length, f)`\n\n Creates an array of length `length` initialized with the value returned from `f ` for each index.\n\n ```res example\n Array.fromInitializer(~length=3, i => i + 3) == [3, 4, 5]\n ```" + "`fromInitializer(~length, f)`\n\nCreates an array of length `length` initialized with the value returned from `f ` for each index.\n\n## Examples\n\n```rescript\nArray.fromInitializer(~length=3, i => i + 3)->assertEqual([3, 4, 5])\n\nArray.fromInitializer(~length=7, i => i + 3)->assertEqual([3, 4, 5, 6, 7, 8, 9])\n```" ], "signature": "let fromInitializer: (~length: int, int => 'a) => array<'a>" }, { - "id": "Core.Array.equal", + "id": "Stdlib.Array.equal", "kind": "value", "name": "equal", "docstrings": [], "signature": "let equal: (array<'a>, array<'a>, ('a, 'a) => bool) => bool" }, { - "id": "Core.Array.compare", + "id": "Stdlib.Array.compare", "kind": "value", "name": "compare", "docstrings": [], - "signature": "let compare: (\n array<'a>,\n array<'a>,\n ('a, 'a) => Core__Ordering.t,\n) => Core__Ordering.t" + "signature": "let compare: (\n array<'a>,\n array<'a>,\n ('a, 'a) => Ordering.t,\n) => Ordering.t" }, { - "id": "Core.Array.isArray", + "id": "Stdlib.Array.isArray", "kind": "value", "name": "isArray", "docstrings": [], "signature": "let isArray: 'a => bool" }, { - "id": "Core.Array.length", + "id": "Stdlib.Array.length", "kind": "value", "name": "length", "docstrings": [ - "`length(array)` returns the length of (i.e. number of items in) the array.\n\nSee [`Array.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/length) on MDN.\n\n## Examples\n```rescript\nlet someArray = [\"hi\", \"hello\"]\n\nConsole.log(someArray->Array.length) // 2\n```" + "`length(array)` returns the length of (i.e. number of items in) the array.\n\nSee [`Array.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/length) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\n\nsomeArray\n->Array.length\n->assertEqual(2)\n```" ], "signature": "let length: array<'a> => int" }, { - "id": "Core.Array.copyAllWithin", + "id": "Stdlib.Array.copyAllWithin", "kind": "value", "name": "copyAllWithin", "docstrings": [], "signature": "let copyAllWithin: (array<'a>, ~target: int) => array<'a>" }, { - "id": "Core.Array.copyWithinToEnd", + "id": "Stdlib.Array.copyWithinToEnd", "kind": "value", "name": "copyWithinToEnd", "docstrings": [], "signature": "let copyWithinToEnd: (array<'a>, ~target: int, ~start: int) => array<'a>" }, { - "id": "Core.Array.copyWithin", + "id": "Stdlib.Array.copyWithin", "kind": "value", "name": "copyWithin", "docstrings": [], "signature": "let copyWithin: (\n array<'a>,\n ~target: int,\n ~start: int,\n ~end: int,\n) => array<'a>" }, { - "id": "Core.Array.fillAll", + "id": "Stdlib.Array.fillAll", "kind": "value", "name": "fillAll", "docstrings": [ - "`fillAll(array, value)` fills the entire `array` with `value`.\n\nBeware this will *mutate* the array.\n\nSee [`Array.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/fill) on MDN.\n\n## Examples\n```rescript\nlet myArray = [1, 2, 3, 4]\nmyArray->Array.fillAll(9)\n\nConsole.log(myArray) // [9, 9, 9, 9]\n```" + "`fillAll(array, value)` fills the entire `array` with `value`.\n\nBeware this will *mutate* the array.\n\nSee [`Array.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/fill) on MDN.\n\n## Examples\n\n```rescript\nlet myArray = [1, 2, 3, 4]\nmyArray->Array.fillAll(9)\nmyArray->assertEqual([9, 9, 9, 9])\n```" ], "signature": "let fillAll: (array<'a>, 'a) => unit" }, { - "id": "Core.Array.fillToEnd", + "id": "Stdlib.Array.fillToEnd", "kind": "value", "name": "fillToEnd", "docstrings": [ - "`fillToEnd(array, value, ~start)` fills `array` with `value` from the `start` index.\n\nBeware this will *mutate* the array.\n\nSee [`Array.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/fill) on MDN.\n\n## Examples\n```rescript\nlet myArray = [1, 2, 3, 4]\nmyArray->Array.fillToEnd(9, ~start=1)\n\nConsole.log(myArray) // [1, 9, 9, 9]\n```" + "`fillToEnd(array, value, ~start)` fills `array` with `value` from the `start` index.\n\nBeware this will *mutate* the array.\n\nSee [`Array.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/fill) on MDN.\n\n## Examples\n\n```rescript\nlet myArray = [1, 2, 3, 4]\nmyArray->Array.fillToEnd(9, ~start=1)\nmyArray->assertEqual([1, 9, 9, 9])\n```" ], "signature": "let fillToEnd: (array<'a>, 'a, ~start: int) => unit" }, { - "id": "Core.Array.fill", + "id": "Stdlib.Array.fill", "kind": "value", "name": "fill", "docstrings": [ - "`fill(array, value, ~start, ~end)` fills `array` with `value` from `start` to `end`.\n\nBeware this will *mutate* the array.\n\nSee [`Array.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/fill) on MDN.\n\n## Examples\n```rescript\nlet myArray = [1, 2, 3, 4]\nmyArray->Array.fill(9, ~start=1, ~end=2)\n\nConsole.log(myArray) // [1, 9, 9, 4]\n```" + "`fill(array, value, ~start, ~end)` fills `array` with `value` from `start` to `end`.\n\nBeware this will *mutate* the array.\n\nSee [`Array.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/fill) on MDN.\n\n## Examples\n\n```rescript\nlet myArray = [1, 2, 3, 4]\n\nmyArray->Array.fill(9, ~start=1, ~end=3)\n\nmyArray->assertEqual([1, 9, 9, 4])\n```" ], "signature": "let fill: (array<'a>, 'a, ~start: int, ~end: int) => unit" }, { - "id": "Core.Array.pop", + "id": "Stdlib.Array.pop", "kind": "value", "name": "pop", "docstrings": [ - "`pop(array)` removes the last item from `array` and returns it.\n\nBeware this will *mutate* the array.\n\nSee [`Array.pop`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/pop) on MDN.\n\n## Examples\n```rescript\nlet someArray = [\"hi\", \"hello\"]\nlet lastItem = someArray->Array.pop // \"hello\"\n\nConsole.log(someArray) // [\"hi\"]. Notice last item is gone.\n```" + "`pop(array)` removes the last item from `array` and returns it.\n\nBeware this will *mutate* the array.\n\nSee [`Array.pop`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/pop) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\n\nsomeArray\n->Array.pop\n->assertEqual(Some(\"hello\"))\n\nsomeArray->assertEqual([\"hi\"]) // Notice last item is gone.\n```" ], "signature": "let pop: array<'a> => option<'a>" }, { - "id": "Core.Array.push", + "id": "Stdlib.Array.push", "kind": "value", "name": "push", "docstrings": [ - "`push(array, item)` appends `item` to the end of `array`.\n\nBeware this will *mutate* the array.\n\nSee [`Array.push`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/push) on MDN.\n\n## Examples\n```rescript\nlet someArray = [\"hi\", \"hello\"]\nsomeArray->Array.push(\"yay\")\n\nConsole.log(someArray) // [\"hi\", \"hello\", \"yay\"]\n```" + "`push(array, item)` appends `item` to the end of `array`.\n\nBeware this will *mutate* the array.\n\nSee [`Array.push`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/push) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\n\nsomeArray->Array.push(\"yay\")\n\nsomeArray->assertEqual([\"hi\", \"hello\", \"yay\"])\n```" ], "signature": "let push: (array<'a>, 'a) => unit" }, { - "id": "Core.Array.pushMany", + "id": "Stdlib.Array.pushMany", "kind": "value", "name": "pushMany", "docstrings": [ - "`pushMany(array, itemsArray)` appends many new items to the end of the array.\n\nBeware this will *mutate* the array.\n\nSee [`Array.push`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/push) on MDN.\n\n## Examples\n```rescript\nlet someArray = [\"hi\", \"hello\"]\nsomeArray->Array.pushMany([\"yay\", \"wehoo\"])\n\nConsole.log(someArray) // [\"hi\", \"hello\", \"yay\", \"wehoo\"]\n```" + "`pushMany(array, itemsArray)` appends many new items to the end of the array.\n\nBeware this will *mutate* the array.\n\nSee [`Array.push`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/push) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\n\nsomeArray->Array.pushMany([\"yay\", \"wehoo\"])\nsomeArray->assertEqual([\"hi\", \"hello\", \"yay\", \"wehoo\"])\n```" ], "signature": "let pushMany: (array<'a>, array<'a>) => unit" }, { - "id": "Core.Array.reverse", + "id": "Stdlib.Array.reverse", "kind": "value", "name": "reverse", "docstrings": [ - "`reverse(array)` reverses the order of the items in `array`.\n\nBeware this will *mutate* the array.\n\nSee [`Array.reverse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reverse) on MDN.\n\n## Examples\n```rescript\nlet someArray = [\"hi\", \"hello\"]\nsomeArray->Array.reverse\n\nConsole.log(someArray) // [\"hello\", \"h1\"]\n```" + "`reverse(array)` reverses the order of the items in `array`.\n\nBeware this will *mutate* the array.\n\nSee [`Array.reverse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reverse) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\nsomeArray->Array.reverse\n\nsomeArray->assertEqual([\"hello\", \"hi\"])\n```" ], "signature": "let reverse: array<'a> => unit" }, { - "id": "Core.Array.shift", + "id": "Stdlib.Array.shift", "kind": "value", "name": "shift", "docstrings": [ - "`shift(array)` removes the first item in the array, and returns it.\n\nBeware this will *mutate* the array.\n\nSee [`Array.shift`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/shift) on MDN.\n\n## Examples\n```rescript\nlet someArray = [\"hi\", \"hello\"]\nlet lastItem = someArray->Array.shift // \"hi\"\n\nConsole.log(someArray) // [\"hello\"]. Notice first item is gone.\n```" + "`shift(array)` removes the first item in the array, and returns it.\n\nBeware this will *mutate* the array.\n\nSee [`Array.shift`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/shift) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\n\nsomeArray\n->Array.shift\n->assertEqual(Some(\"hi\"))\n\nsomeArray->assertEqual([\"hello\"]) // Notice first item is gone.\n```" ], "signature": "let shift: array<'a> => option<'a>" }, { - "id": "Core.Array.toSorted", + "id": "Stdlib.Array.toSorted", "kind": "value", "name": "toSorted", "docstrings": [ - "`toSorted(array, comparator)` returns a new, sorted array from `array`, using the `comparator` function.\n\nSee [`Array.toSorted`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toSorted) on MDN.\n\n## Examples\n```rescript\nlet someArray = [3, 2, 1]\nlet sorted = someArray->Array.toSorted(Int.compare)\n\nConsole.log(sorted) // [1, 2, 3]\nConsole.log(someArray) // [3, 2, 1]. Original unchanged\n```" + "`toSorted(array, comparator)` returns a new, sorted array from `array`, using the `comparator` function.\n\nSee [`Array.toSorted`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toSorted) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [3, 2, 1]\n\nsomeArray\n->Array.toSorted(Int.compare)\n->assertEqual([1, 2, 3])\n\nsomeArray->assertEqual([3, 2, 1]) // Original unchanged\n```" ], - "signature": "let toSorted: (array<'a>, ('a, 'a) => Core__Ordering.t) => array<'a>" + "signature": "let toSorted: (array<'a>, ('a, 'a) => Ordering.t) => array<'a>" }, { - "id": "Core.Array.sort", + "id": "Stdlib.Array.sort", "kind": "value", "name": "sort", "docstrings": [ - "`sort(array, comparator)` sorts `array` in-place using the `comparator` function.\n\nBeware this will *mutate* the array.\n\nSee [`Array.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort) on MDN.\n\n## Examples\n```rescript\nlet someArray = [3, 2, 1]\nsomeArray->Array.sort((a, b) => float(a - b))\n\nConsole.log(someArray) // [1, 2, 3]\n```" + "`sort(array, comparator)` sorts `array` in-place using the `comparator` function.\n\nBeware this will *mutate* the array.\n\nSee [`Array.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort) on MDN.\n\n## Examples\n\n```rescript\nlet array = [3, 2, 1]\narray->Array.sort((a, b) => float(a - b))\narray->assertEqual([1, 2, 3])\n```" ], - "signature": "let sort: (array<'a>, ('a, 'a) => Core__Ordering.t) => unit" + "signature": "let sort: (array<'a>, ('a, 'a) => Ordering.t) => unit" }, { - "id": "Core.Array.splice", + "id": "Stdlib.Array.splice", "kind": "value", "name": "splice", "docstrings": [], "signature": "let splice: (\n array<'a>,\n ~start: int,\n ~remove: int,\n ~insert: array<'a>,\n) => unit" }, { - "id": "Core.Array.toSpliced", + "id": "Stdlib.Array.toSpliced", "kind": "value", "name": "toSpliced", "docstrings": [], "signature": "let toSpliced: (\n array<'a>,\n ~start: int,\n ~remove: int,\n ~insert: array<'a>,\n) => array<'a>" }, { - "id": "Core.Array.with", + "id": "Stdlib.Array.removeInPlace", + "kind": "value", + "name": "removeInPlace", + "docstrings": [ + "`removeInPlace(array, index)` removes the item at the specified `index` from `array`.\n\nBeware this will *mutate* the array.\n\n## Examples\n\n```rescript\nlet array = []\narray->Array.removeInPlace(0)\nassertEqual(array, []) // Removing from an empty array does nothing\n\nlet array2 = [\"Hello\", \"Hi\", \"Good bye\"]\narray2->Array.removeInPlace(1)\nassertEqual(array2, [\"Hello\", \"Good bye\"]) // Removes the item at index 1\n```" + ], + "signature": "let removeInPlace: (array<'a>, int) => unit" + }, + { + "id": "Stdlib.Array.with", "kind": "value", "name": "with", "docstrings": [], "signature": "let with: (array<'a>, int, 'a) => array<'a>" }, { - "id": "Core.Array.unshift", + "id": "Stdlib.Array.unshift", "kind": "value", "name": "unshift", "docstrings": [ - "`unshift(array, item)` inserts a new item at the start of the array.\n\nBeware this will *mutate* the array.\n\nSee [`Array.unshift`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/unshift) on MDN.\n\n## Examples\n```rescript\nlet someArray = [\"hi\", \"hello\"]\nsomeArray->Array.unshift(\"yay\")\n\nConsole.log(someArray) // [\"yay\", \"hi\", \"hello\"]\n```" + "`unshift(array, item)` inserts a new item at the start of the array.\n\nBeware this will *mutate* the array.\n\nSee [`Array.unshift`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/unshift) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\nsomeArray->Array.unshift(\"yay\")\nsomeArray->assertEqual([\"yay\", \"hi\", \"hello\"])\n```" ], "signature": "let unshift: (array<'a>, 'a) => unit" }, { - "id": "Core.Array.unshiftMany", + "id": "Stdlib.Array.unshiftMany", "kind": "value", "name": "unshiftMany", "docstrings": [ - "`unshiftMany(array, itemsArray)` inserts many new items to the start of the array.\n\nBeware this will *mutate* the array.\n\nSee [`Array.push`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/unshift) on MDN.\n\n## Examples\n```rescript\nlet someArray = [\"hi\", \"hello\"]\nsomeArray->Array.unshiftMany([\"yay\", \"wehoo\"])\n\nConsole.log(someArray) // [\"yay\", \"wehoo\", \"hi\", \"hello\"]\n```" + "`unshiftMany(array, itemsArray)` inserts many new items to the start of the array.\n\nBeware this will *mutate* the array.\n\nSee [`Array.push`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/unshift) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\nsomeArray->Array.unshiftMany([\"yay\", \"wehoo\"])\nsomeArray->assertEqual([\"yay\", \"wehoo\", \"hi\", \"hello\"])\n```" ], "signature": "let unshiftMany: (array<'a>, array<'a>) => unit" }, { - "id": "Core.Array.concat", + "id": "Stdlib.Array.concat", "kind": "value", "name": "concat", "docstrings": [ - "`concat(array1, array2)` concatenates the two arrays, creating a new array.\n\nSee [`Array.concat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/concat) on MDN.\n\n## Examples\n```rescript\nlet array1 = [\"hi\", \"hello\"]\nlet array2 = [\"yay\", \"wehoo\"]\n\nlet someArray = array1->Array.concat(array2)\n\nConsole.log(someArray) // [\"hi\", \"hello\", \"yay\", \"wehoo\"]\n```" + "`concat(array1, array2)` concatenates the two arrays, creating a new array.\n\nSee [`Array.concat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/concat) on MDN.\n\n## Examples\n\n```rescript\nlet array1 = [\"hi\", \"hello\"]\nlet array2 = [\"yay\", \"wehoo\"]\n\nlet someArray = array1->Array.concat(array2)\n\nsomeArray->assertEqual([\"hi\", \"hello\", \"yay\", \"wehoo\"])\n```" ], "signature": "let concat: (array<'a>, array<'a>) => array<'a>" }, { - "id": "Core.Array.concatMany", + "id": "Stdlib.Array.concatMany", "kind": "value", "name": "concatMany", "docstrings": [ @@ -9483,224 +11298,260 @@ "signature": "let concatMany: (array<'a>, array>) => array<'a>" }, { - "id": "Core.Array.flat", + "id": "Stdlib.Array.flat", "kind": "value", "name": "flat", "docstrings": [ - "`flat(arrays)` concatenates an array of arrays into a single array.\n\nSee [`Array.flat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/flat) on MDN.\n\n## Examples\n```rescript\nConsole.log([[1], [2], [3, 4]]->Array.flat) // [1, 2, 3, 4]\n```" + "`flat(arrays)` concatenates an array of arrays into a single array.\n\nSee [`Array.flat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/flat) on MDN.\n\n## Examples\n\n```rescript\n[[1], [2], [3, 4]]\n->Array.flat\n->assertEqual([1, 2, 3, 4])\n```" ], "signature": "let flat: array> => array<'a>" }, { - "id": "Core.Array.includes", + "id": "Stdlib.Array.includes", "kind": "value", "name": "includes", "docstrings": [ - "`includes(array, item)` checks whether `array` includes `item`, by doing a [strict check for equality](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Strict_equality).\n\nSee [`Array.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/includes) on MDN.\n\n## Examples\n```rescript\nConsole.log([1, 2]->Array.includes(1)) // true\nConsole.log([1, 2]->Array.includes(3)) // false\nConsole.log([{\"language\": \"ReScript\"}]->Array.includes({\"language\": \"ReScript\"})) // false, because of strict equality\n```" + "`includes(array, item)` checks whether `array` includes `item`, by doing a [strict check for equality](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Strict_equality).\n\nSee [`Array.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/includes) on MDN.\n\n## Examples\n\n```rescript\n[1, 2]->Array.includes(1)->assertEqual(true)\n[1, 2]->Array.includes(3)->assertEqual(false)\n\n[{\"language\": \"ReScript\"}]\n->Array.includes({\"language\": \"ReScript\"})\n->assertEqual(false) // false, because of strict equality\n```" ], "signature": "let includes: (array<'a>, 'a) => bool" }, { - "id": "Core.Array.indexOf", + "id": "Stdlib.Array.indexOf", "kind": "value", "name": "indexOf", "docstrings": [ - "`indexOf(array, item)` returns the index of the provided `item` in `array`. Uses [strict check for equality](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Strict_equality) when comparing items.\n\nReturns `-1` if the item doesn not exist. Check out `Array.indexOfOpt` for a version that returns `None` instead of `-1` if the item does not exist.\n\nSee [`Array.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf) on MDN.\n\n## Examples\n```rescript\nConsole.log([1, 2]->Array.indexOf(2)) // 1\nConsole.log([1, 2]->Array.indexOf(3)) // -1\nConsole.log([{\"language\": \"ReScript\"}]->Array.indexOf({\"language\": \"ReScript\"})) // -1, because of strict equality\n```" + "`indexOf(array, item)` returns the index of the provided `item` in `array`. Uses [strict check for equality](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Strict_equality) when comparing items.\n\nReturns `-1` if the item doesn not exist. Check out `Array.indexOfOpt` for a version that returns `None` instead of `-1` if the item does not exist.\n\nSee [`Array.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf) on MDN.\n\n## Examples\n\n```rescript\n[1, 2]->Array.indexOf(2)->assertEqual(1)\n[1, 2]->Array.indexOf(3)->assertEqual(-1)\n\n[{\"language\": \"ReScript\"}]\n->Array.indexOf({\"language\": \"ReScript\"})\n->assertEqual(-1) // -1, because of strict equality\n```" ], "signature": "let indexOf: (array<'a>, 'a) => int" }, { - "id": "Core.Array.indexOfOpt", + "id": "Stdlib.Array.indexOfOpt", "kind": "value", "name": "indexOfOpt", "docstrings": [ - "`indexOfOpt(array, item)` returns an option of the index of the provided `item` in `array`. Uses [strict check for equality](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Strict_equality) when comparing items.\n\nSee [`Array.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf) on MDN.\n\n## Examples\n```rescript\nConsole.log([1, 2]->Array.indexOfOpt(2)) // Some(1)\nConsole.log([1, 2]->Array.indexOfOpt(3)) // None\nConsole.log([{\"language\": \"ReScript\"}]->Array.indexOfOpt({\"language\": \"ReScript\"})) // None, because of strict equality\n```" + "`indexOfOpt(array, item)` returns an option of the index of the provided `item` in `array`. Uses [strict check for equality](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Strict_equality) when comparing items.\n\nSee [`Array.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf) on MDN.\n\n## Examples\n\n```rescript\n[1, 2]->Array.indexOfOpt(2)->assertEqual(Some(1))\n[1, 2]->Array.indexOfOpt(3)->assertEqual(None)\n[{\"language\": \"ReScript\"}]\n->Array.indexOfOpt({\"language\": \"ReScript\"})\n->assertEqual(None) // None, because of strict equality\n```" ], "signature": "let indexOfOpt: (array<'a>, 'a) => option" }, { - "id": "Core.Array.indexOfFrom", + "id": "Stdlib.Array.indexOfFrom", "kind": "value", "name": "indexOfFrom", "docstrings": [], "signature": "let indexOfFrom: (array<'a>, 'a, int) => int" }, { - "id": "Core.Array.join", + "id": "Stdlib.Array.join", "kind": "value", "name": "join", "docstrings": [ - "`join(array, separator)` produces a string where all items of `array` are printed, separated by `separator`. Array items must be strings, to join number or other arrays, use `joinUnsafe`. Under the hood this will run JavaScript's `toString` on all the array items.\n\nSee [Array.join](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/join)\n\n## Examples\n```rescript\nlet array = [\"One\", \"Two\", \"Three\"]\n\nConsole.log(array->Array.join(\" -- \")) // One -- Two -- Three\n```" + "`join(array, separator)` produces a string where all items of `array` are printed, separated by `separator`. Array items must be strings, to join number or other arrays, use `joinUnsafe`. Under the hood this will run JavaScript's `toString` on all the array items.\n\nSee [Array.join](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/join)\n\n## Examples\n\n```rescript\n[\"One\", \"Two\", \"Three\"]\n->Array.join(\" -- \")\n->assertEqual(\"One -- Two -- Three\")\n```" ], "signature": "let join: (array, string) => string" }, { - "id": "Core.Array.joinWith", + "id": "Stdlib.Array.joinWith", "kind": "value", "name": "joinWith", "docstrings": [ - "`joinWith(array, separator)` produces a string where all items of `array` are printed, separated by `separator`. Array items must be strings, to join number or other arrays, use `joinWithUnsafe`. Under the hood this will run JavaScript's `toString` on all the array items.\n\n## Examples\n```rescript\nlet array = [\"One\", \"Two\", \"Three\"]\n\nConsole.log(array->Array.joinWith(\" -- \")) // One -- Two -- Three\n```" + "`joinWith(array, separator)` produces a string where all items of `array` are printed, separated by `separator`. Array items must be strings, to join number or other arrays, use `joinWithUnsafe`. Under the hood this will run JavaScript's `toString` on all the array items.\n\n## Examples\n\n```rescript\n[\"One\", \"Two\", \"Three\"]\n->Array.joinWith(\" -- \")\n->assertEqual(\"One -- Two -- Three\")\n```" ], "signature": "let joinWith: (array, string) => string", "deprecated": "Use `join` instead" }, { - "id": "Core.Array.joinUnsafe", + "id": "Stdlib.Array.joinUnsafe", "kind": "value", "name": "joinUnsafe", "docstrings": [ - "`joinUnsafe(array, separator)` produces a string where all items of `array` are printed, separated by `separator`. Under the hood this will run JavaScript's `toString` on all the array items.\n\nSee [Array.join](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/join)\n\n## Examples\n```rescript\nlet array = [1, 2, 3]\n\nConsole.log(array->Array.joinUnsafe(\" -- \")) // 1 -- 2 -- 3\n```" + "`joinUnsafe(array, separator)` produces a string where all items of `array` are printed, separated by `separator`. Under the hood this will run JavaScript's `toString` on all the array items.\n\nSee [Array.join](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/join)\n\n## Examples\n\n```rescript\n[1, 2, 3]\n->Array.joinUnsafe(\" -- \")\n->assertEqual(\"1 -- 2 -- 3\")\n```" ], "signature": "let joinUnsafe: (array<'a>, string) => string" }, { - "id": "Core.Array.joinWithUnsafe", + "id": "Stdlib.Array.joinWithUnsafe", "kind": "value", "name": "joinWithUnsafe", "docstrings": [ - "`joinWithUnsafe(array, separator)` produces a string where all items of `array` are printed, separated by `separator`. Under the hood this will run JavaScript's `toString` on all the array items.\n\n## Examples\n```rescript\nlet array = [1, 2, 3]\n\nConsole.log(array->Array.joinWithUnsafe(\" -- \")) // 1 -- 2 -- 3\n```" + "`joinWithUnsafe(array, separator)` produces a string where all items of `array` are printed, separated by `separator`. Under the hood this will run JavaScript's `toString` on all the array items.\n\n## Examples\n\n```rescript\n[1, 2, 3]\n->Array.joinWithUnsafe(\" -- \")\n->assertEqual(\"1 -- 2 -- 3\")\n```" ], "signature": "let joinWithUnsafe: (array<'a>, string) => string", "deprecated": "Use `joinUnsafe` instead" }, { - "id": "Core.Array.lastIndexOf", + "id": "Stdlib.Array.lastIndexOf", "kind": "value", "name": "lastIndexOf", "docstrings": [], "signature": "let lastIndexOf: (array<'a>, 'a) => int" }, { - "id": "Core.Array.lastIndexOfOpt", + "id": "Stdlib.Array.lastIndexOfOpt", "kind": "value", "name": "lastIndexOfOpt", "docstrings": [], "signature": "let lastIndexOfOpt: (array<'a>, 'a) => option" }, { - "id": "Core.Array.lastIndexOfFrom", + "id": "Stdlib.Array.lastIndexOfFrom", "kind": "value", "name": "lastIndexOfFrom", "docstrings": [], "signature": "let lastIndexOfFrom: (array<'a>, 'a, int) => int" }, { - "id": "Core.Array.slice", + "id": "Stdlib.Array.slice", "kind": "value", "name": "slice", "docstrings": [ - "`slice(array, ~start, ~end)` creates a new array of items copied from `array` from `start` until (but not including) `end`.\n\nSee [`Array.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice) on MDN.\n\n## Examples\n```rescript\nlet myArray = [1, 2, 3, 4]\n\nConsole.log(myArray->Array.slice(~start=1, ~end=3)) // [2, 3]\n```" + "`slice(array, ~start, ~end)` creates a new array of items copied from `array` from `start` until (but not including) `end`.\n\nSee [`Array.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice) on MDN.\n\n## Examples\n\n```rescript\n[1, 2, 3, 4]\n->Array.slice(~start=1, ~end=3)\n->assertEqual([2, 3])\n```" ], "signature": "let slice: (array<'a>, ~start: int, ~end: int) => array<'a>" }, { - "id": "Core.Array.sliceToEnd", + "id": "Stdlib.Array.sliceToEnd", "kind": "value", "name": "sliceToEnd", "docstrings": [ - "`sliceToEnd(array, start)` creates a new array from `array`, with all items from `array` starting from `start`.\n\nSee [`Array.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice) on MDN.\n\n## Examples\n```rescript\nlet myArray = [1, 2, 3, 4]\n\nConsole.log(myArray->Array.sliceToEnd(~start=1)) // [2, 3, 4]\n```" + "`sliceToEnd(array, start)` creates a new array from `array`, with all items from `array` starting from `start`.\n\nSee [`Array.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice) on MDN.\n\n## Examples\n\n```rescript\n[1, 2, 3, 4]\n->Array.sliceToEnd(~start=1)\n->assertEqual([2, 3, 4])\n```" ], "signature": "let sliceToEnd: (array<'a>, ~start: int) => array<'a>" }, { - "id": "Core.Array.copy", + "id": "Stdlib.Array.copy", "kind": "value", "name": "copy", "docstrings": [ - "`copy(array)` makes a copy of the array with the items in it, but does not make copies of the items themselves.\n\n## Examples\n```rescript\nlet myArray = [1, 2, 3]\nlet copyOfMyArray = myArray->Array.copy\n\nConsole.log(copyOfMyArray) // [1, 2, 3]\nConsole.log(myArray === copyOfMyArray) // false\n```" + "`copy(array)` makes a copy of the array with the items in it, but does not make copies of the items themselves.\n\n## Examples\n\n```rescript\nlet myArray = [1, 2, 3]\nlet copyOfMyArray = myArray->Array.copy\n\ncopyOfMyArray->assertEqual([1, 2, 3])\nassertEqual(myArray === copyOfMyArray, false)\n```" ], "signature": "let copy: array<'a> => array<'a>" }, { - "id": "Core.Array.toString", + "id": "Stdlib.Array.toString", "kind": "value", "name": "toString", "docstrings": [ - "`toString(array)` stringifies `array` by running `toString` on all of the array elements and joining them with \",\".\n\nSee [`Array.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toString) on MDN.\n\n## Examples\n```rescript\nlet array = [1, 2, 3, 4]\n\nConsole.log(array->Array.toString) // \"1,2,3,4\"\n```" + "`toString(array)` stringifies `array` by running `toString` on all of the array elements and joining them with \",\".\n\nSee [`Array.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toString) on MDN.\n\n## Examples\n\n```rescript\n[1, 2, 3, 4]\n->Array.toString\n->assertEqual(\"1,2,3,4\")\n```" ], "signature": "let toString: array<'a> => string" }, { - "id": "Core.Array.toLocaleString", + "id": "Stdlib.Array.toLocaleString", "kind": "value", "name": "toLocaleString", "docstrings": [], "signature": "let toLocaleString: array<'a> => string" }, { - "id": "Core.Array.every", + "id": "Stdlib.Array.every", "kind": "value", "name": "every", "docstrings": [ - "`every(array, predicate)` returns true if `predicate` returns true for all items in `array`.\n\nSee [`Array.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every) on MDN.\n\n## Examples\n```rescript\nlet array = [1, 2, 3, 4]\n\nConsole.log(array->Array.every(num => num <= 4)) // true\nConsole.log(array->Array.every(num => num === 1)) // false\n```" + "`every(array, predicate)` returns true if `predicate` returns true for all items in `array`.\n\nSee [`Array.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every) on MDN.\n\n## Examples\n\n```rescript\nlet array = [1, 2, 3, 4]\n\narray\n->Array.every(num => num <= 4)\n->assertEqual(true)\n\narray\n->Array.every(num => num === 1)\n->assertEqual(false)\n```" ], "signature": "let every: (array<'a>, 'a => bool) => bool" }, { - "id": "Core.Array.everyWithIndex", + "id": "Stdlib.Array.everyWithIndex", "kind": "value", "name": "everyWithIndex", "docstrings": [ - "`everyWithIndex(array, checker)` returns true if all items in `array` returns true when running the provided `checker` function.\n\nSee [`Array.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every) on MDN.\n\n## Examples\n```rescript\nlet array = [1, 2, 3, 4]\n\nConsole.log(array->Array.everyWithIndex((num, index) => index < 2 && num <= 2)) // true\nConsole.log(array->Array.everyWithIndex((num, index) => index < 2 && num >= 2)) // false\n```" + "`everyWithIndex(array, checker)` returns true if all items in `array` returns true when running the provided `checker` function.\n\nSee [`Array.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every) on MDN.\n\n## Examples\n\n```rescript\nlet array = [1, 2, 3, 4]\n\narray\n->Array.everyWithIndex((num, index) => index < 5 && num <= 4)\n->assertEqual(true)\n\narray\n->Array.everyWithIndex((num, index) => index < 2 && num >= 2)\n->assertEqual(false)\n```" ], "signature": "let everyWithIndex: (array<'a>, ('a, int) => bool) => bool" }, { - "id": "Core.Array.filter", + "id": "Stdlib.Array.filter", "kind": "value", "name": "filter", "docstrings": [ - "`filter(array, checker)` returns a new array containing all elements from `array` for which the provided `checker` function returns true.\n\nSee [`Array.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter) on MDN.\n\n## Examples\n```rescript\nlet array = [1, 2, 3, 4]\n\nConsole.log(array->Array.filter(num => num > 2)) // [3, 4]\n```" + "`filter(array, checker)` returns a new array containing all elements from `array` for which the provided `checker` function returns true.\n\nSee [`Array.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter) on MDN.\n\n## Examples\n\n```rescript\n[1, 2, 3, 4]\n->Array.filter(num => num > 2)\n->assertEqual([3, 4])\n```" ], "signature": "let filter: (array<'a>, 'a => bool) => array<'a>" }, { - "id": "Core.Array.filterWithIndex", + "id": "Stdlib.Array.filterWithIndex", "kind": "value", "name": "filterWithIndex", "docstrings": [ - "`filterWithIndex(array, checker)` returns a new array containing all elements from `array` for which the provided `checker` function returns true.\n\nSee [`Array.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter) on MDN.\n\n## Examples\n```rescript\nlet array = [1, 2, 3, 4]\n\nConsole.log(array->Array.filterWithIndex((num, index) => index === 0 || num === 2)) // [1, 2]\n```" + "`filterWithIndex(array, checker)` returns a new array containing all elements from `array` for which the provided `checker` function returns true.\n\nSee [`Array.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter) on MDN.\n\n## Examples\n\n```rescript\n[1, 2, 3, 4]\n->Array.filterWithIndex((num, index) => index === 0 || num === 2)\n->assertEqual([1, 2])\n```" ], "signature": "let filterWithIndex: (array<'a>, ('a, int) => bool) => array<'a>" }, { - "id": "Core.Array.find", + "id": "Stdlib.Array.find", "kind": "value", "name": "find", "docstrings": [ - "`find(array, checker)` returns the first element of `array` where the provided `checker` function returns true.\n\nSee [`Array.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find) on MDN.\n\n## Examples\n```rescript\ntype languages = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, TypeScript, JavaScript]\n\nswitch array->Array.find(item => item == ReScript) {\n| None => Console.log(\"No item...\")\n| Some(_) => Console.log(\"Yay, ReScript!\")\n}\n```" + "`find(array, checker)` returns the first element of `array` where the provided `checker` function returns true.\n\nSee [`Array.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find) on MDN.\n\n## Examples\n\n```rescript\ntype languages = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, TypeScript, JavaScript]\n\narray\n->Array.find(item => item == ReScript)\n->assertEqual(Some(ReScript))\n```" ], "signature": "let find: (array<'a>, 'a => bool) => option<'a>" }, { - "id": "Core.Array.findWithIndex", + "id": "Stdlib.Array.findWithIndex", "kind": "value", "name": "findWithIndex", "docstrings": [ - "`findWithIndex(array, checker)` returns the first element of `array` where the provided `checker` function returns true.\n\nSee [`Array.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find) on MDN.\n\n## Examples\n```rescript\ntype languages = ReScript | TypeScript | JavaScript\n\nlet array = [TypeScript, JavaScript, ReScript]\n\nswitch array->Array.findWithIndex((item, index) => index > 1 && item == ReScript) {\n| None => Console.log(\"No item...\")\n| Some(_) => Console.log(\"Yay, ReScript exists in a later position!\")\n}\n```" + "`findWithIndex(array, checker)` returns the first element of `array` where the provided `checker` function returns true.\n\nSee [`Array.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find) on MDN.\n\n## Examples\n\n```rescript\ntype languages = ReScript | TypeScript | JavaScript\n\nlet array = [TypeScript, JavaScript, ReScript]\n\narray\n->Array.findWithIndex((item, index) => index > 1 && item == ReScript)\n->assertEqual(Some(ReScript))\n```" ], "signature": "let findWithIndex: (array<'a>, ('a, int) => bool) => option<'a>" }, { - "id": "Core.Array.findIndex", + "id": "Stdlib.Array.findLast", + "kind": "value", + "name": "findLast", + "docstrings": [ + "`findLast(array, checker)` returns the last element of `array` where the provided `checker` function returns true.\n\nSee [`Array.findLast`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findLast) on MDN.\n\n## Examples\n\n```rescript\nlet array = [1, 2, 3]\n\narray\n->Array.findLast(item => item > 0)\n->assertEqual(Some(3))\n```" + ], + "signature": "let findLast: (array<'a>, 'a => bool) => option<'a>" + }, + { + "id": "Stdlib.Array.findLastWithIndex", + "kind": "value", + "name": "findLastWithIndex", + "docstrings": [ + "`findLastWithIndex(array, checker)` returns the last element of `array` where the provided `checker` function returns true.\n\nSee [`Array.findLast`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findLast) on MDN.\n\n## Examples\n\n```rescript\nlet array = [1, 2, 3]\n\narray\n->Array.findLastWithIndex((item, index) => index < 2 && item > 0)\n->assertEqual(Some(2))\n```" + ], + "signature": "let findLastWithIndex: (array<'a>, ('a, int) => bool) => option<'a>" + }, + { + "id": "Stdlib.Array.findIndex", "kind": "value", "name": "findIndex", "docstrings": [ - "`findIndex(array, checker)` returns the index of the first element of `array` where the provided `checker` function returns true.\n\nReturns `-1` if the item does not exist. Consider using `Array.findIndexOpt` if you want an option instead (where `-1` would be `None`).\n\nSee [`Array.findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex) on MDN.\n\n## Examples\n```rescript\ntype languages = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, JavaScript]\n\nConsole.log(array->Array.findIndex(item => item == ReScript)) // 0\nConsole.log(array->Array.findIndex(item => item == TypeScript)) // -1\n```" + "`findIndex(array, checker)` returns the index of the first element of `array` where the provided `checker` function returns true.\n\nReturns `-1` if the item does not exist. Consider using `Array.findIndexOpt` if you want an option instead (where `-1` would be `None`).\n\nSee [`Array.findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex) on MDN.\n\n## Examples\n\n```rescript\ntype languages = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, JavaScript]\n\narray\n->Array.findIndex(item => item == ReScript)\n->assertEqual(0)\n\narray->Array.findIndex(item => item == TypeScript)\n->assertEqual(-1)\n```" ], "signature": "let findIndex: (array<'a>, 'a => bool) => int" }, { - "id": "Core.Array.findIndexWithIndex", + "id": "Stdlib.Array.findIndexWithIndex", "kind": "value", "name": "findIndexWithIndex", "docstrings": [ - "`findIndexWithIndex(array, checker)` returns the index of the first element of `array` where the provided `checker` function returns true.\n\nReturns `-1` if the item does not exist. Consider using `Array.findIndexOpt` if you want an option instead (where `-1` would be `None`).\n\nSee [`Array.findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex) on MDN.\n\n## Examples\n```rescript\ntype languages = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, JavaScript]\n\nlet isReScriptFirst = array->Array.findIndexWithIndex((item, index) => index === 0 && item == ReScript)\nlet isTypeScriptFirst = array->Array.findIndexWithIndex((item, index) => index === 0 && item == TypeScript)\n\nConsole.log(isReScriptFirst) // 0\nConsole.log(isTypeScriptFirst) // -1\n```" + "`findIndexWithIndex(array, checker)` returns the index of the first element of `array` where the provided `checker` function returns true.\n\nReturns `-1` if the item does not exist. Consider using `Array.findIndexOpt` if you want an option instead (where `-1` would be `None`).\n\nSee [`Array.findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex) on MDN.\n\n## Examples\n\n```rescript\ntype languages = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, JavaScript]\n\nlet isReScriptFirst = array->Array.findIndexWithIndex((item, index) => index === 0 && item == ReScript)\nlet isTypeScriptFirst = array->Array.findIndexWithIndex((item, index) => index === 0 && item == TypeScript)\n\nassertEqual(isReScriptFirst, 0)\nassertEqual(isTypeScriptFirst, -1)\n```" ], "signature": "let findIndexWithIndex: (array<'a>, ('a, int) => bool) => int" }, { - "id": "Core.Array.forEach", + "id": "Stdlib.Array.findLastIndex", + "kind": "value", + "name": "findLastIndex", + "docstrings": [ + "`findLastIndex(array, checker)` returns the index of the last element of `array` where the provided `checker` function returns true.\n\nReturns `-1` if the item does not exist. Consider using `Array.findLastIndexOpt` if you want an option instead (where `-1` would be `None`).\n\nSee [`Array.findLastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findLastIndex) on MDN.\n\n## Examples\n\n```rescript\ntype languages = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, JavaScript, ReScript]\n\narray\n->Array.findLastIndex(item => item == ReScript)\n->assertEqual(2)\n\narray->Array.findLastIndex(item => item == TypeScript)\n->assertEqual(-1)\n```" + ], + "signature": "let findLastIndex: (array<'a>, 'a => bool) => int" + }, + { + "id": "Stdlib.Array.findLastIndexWithIndex", + "kind": "value", + "name": "findLastIndexWithIndex", + "docstrings": [ + "`findLastIndexWithIndex(array, checker)` returns the index of the last element of `array` where the provided `checker` function returns true.\n\nReturns `-1` if the item does not exist. Consider using `Array.findLastIndexOpt` if you want an option instead (where `-1` would be `None`).\n\nSee [`Array.findLastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findLastIndex) on MDN.\n\n## Examples\n\n```rescript\ntype languages = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, JavaScript, JavaScript, ReScript]\n\nlet isReScriptLast = array->Array.findLastIndexWithIndex((item, index) => index === 3 && item == ReScript)\nlet isTypeScriptLast = array->Array.findLastIndexWithIndex((item, index) => index === 3 && item == TypeScript)\n\nassertEqual(isReScriptLast, 3)\nassertEqual(isTypeScriptLast, -1)\n```" + ], + "signature": "let findLastIndexWithIndex: (array<'a>, ('a, int) => bool) => int" + }, + { + "id": "Stdlib.Array.forEach", "kind": "value", "name": "forEach", "docstrings": [ @@ -9709,127 +11560,127 @@ "signature": "let forEach: (array<'a>, 'a => unit) => unit" }, { - "id": "Core.Array.forEachWithIndex", + "id": "Stdlib.Array.forEachWithIndex", "kind": "value", "name": "forEachWithIndex", "docstrings": [ - "`forEachWithIndex(array, fn)` runs the provided `fn` on every element of `array`.\n\nSee [`Array.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach) on MDN.\n\n## Examples\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\n\narray->Array.forEachWithIndex((item, index) => {\n Console.log(\"At item \" ++ Int.toString(index) ++ \": \" ++ item)\n})\n```" + "`forEachWithIndex(array, fn)` runs the provided `fn` on every element of `array`.\n\nSee [`Array.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\n\narray->Array.forEachWithIndex((item, index) => {\n Console.log(\"At item \" ++ Int.toString(index) ++ \": \" ++ item)\n})\n```" ], "signature": "let forEachWithIndex: (array<'a>, ('a, int) => unit) => unit" }, { - "id": "Core.Array.map", + "id": "Stdlib.Array.map", "kind": "value", "name": "map", "docstrings": [ - "`map(array, fn)` returns a new array with all elements from `array`, each element transformed using the provided `fn`.\n\nSee [`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) on MDN.\n\n## Examples\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet mappedArray = array->Array.map(greeting => greeting ++ \" to you\")\n\nConsole.log(mappedArray) // [\"Hello to you\", \"Hi to you\", \"Good bye to you\"]\n```" + "`map(array, fn)` returns a new array with all elements from `array`, each element transformed using the provided `fn`.\n\nSee [`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet mappedArray = array->Array.map(greeting => greeting ++ \" to you\")\n\nassertEqual(mappedArray, [\"Hello to you\", \"Hi to you\", \"Good bye to you\"])\n```" ], "signature": "let map: (array<'a>, 'a => 'b) => array<'b>" }, { - "id": "Core.Array.mapWithIndex", + "id": "Stdlib.Array.mapWithIndex", "kind": "value", "name": "mapWithIndex", "docstrings": [ - "`mapWithIndex(array, fn)` returns a new array with all elements from `array`, each element transformed using the provided `fn`.\n\nSee [`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) on MDN.\n\n## Examples\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet mappedArray =\n array->Array.mapWithIndex((greeting, index) =>\n greeting ++ \" at position \" ++ Int.toString(index)\n )\n\nConsole.log(mappedArray) // [\"Hello at position 0\", \"Hi at position 1\", \"Good bye at position 2\"]\n```" + "`mapWithIndex(array, fn)` returns a new array with all elements from `array`, each element transformed using the provided `fn`.\n\nSee [`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet mappedArray =\n array->Array.mapWithIndex((greeting, index) =>\n greeting ++ \" at position \" ++ Int.toString(index)\n )\n\nassertEqual(mappedArray, [\"Hello at position 0\", \"Hi at position 1\", \"Good bye at position 2\"])\n```" ], "signature": "let mapWithIndex: (array<'a>, ('a, int) => 'b) => array<'b>" }, { - "id": "Core.Array.reduce", + "id": "Stdlib.Array.reduce", "kind": "value", "name": "reduce", "docstrings": [ - "`reduce(xs, init, fn)`\n\n Applies `fn` to each element of `xs` from beginning to end. Function `fn` has two parameters: the item from the list and an “accumulator”; which starts with a value of `init`. `reduce` returns the final value of the accumulator.\n\n ```res example\n Array.reduce([2, 3, 4], 1, (a, b) => a + b) == 10\n\n Array.reduce([\"a\", \"b\", \"c\", \"d\"], \"\", (a, b) => a ++ b) == \"abcd\"\n ```" + "`reduce(xs, init, fn)`\n\nApplies `fn` to each element of `xs` from beginning to end. Function `fn` has two parameters: the item from the list and an “accumulator”; which starts with a value of `init`. `reduce` returns the final value of the accumulator.\n\n## Examples\n\n```rescript\nArray.reduce([2, 3, 4], 1, (a, b) => a + b)->assertEqual(10)\n\nArray.reduce([\"a\", \"b\", \"c\", \"d\"], \"\", (a, b) => a ++ b)->assertEqual(\"abcd\")\n\n[1, 2, 3]\n->Array.reduce(list{}, List.add)\n->assertEqual(list{3, 2, 1})\n\nArray.reduce([], list{}, List.add)->assertEqual(list{})\n```" ], "signature": "let reduce: (array<'a>, 'b, ('b, 'a) => 'b) => 'b" }, { - "id": "Core.Array.reduceWithIndex", + "id": "Stdlib.Array.reduceWithIndex", "kind": "value", "name": "reduceWithIndex", "docstrings": [ - "`reduceWithIndex(x, init, fn)`\n\n Applies `fn` to each element of `xs` from beginning to end. Function `fn` has three parameters: the item from the array and an “accumulator”, which starts with a value of `init` and the index of each element. `reduceWithIndex` returns the final value of the accumulator.\n\n ```res example\n Array.reduceWithIndex([1, 2, 3, 4], 0, (acc, x, i) => acc + x + i) == 16\n ```" + "`reduceWithIndex(x, init, fn)`\n\nApplies `fn` to each element of `xs` from beginning to end. Function `fn` has three parameters: the item from the array and an “accumulator”, which starts with a value of `init` and the index of each element. `reduceWithIndex` returns the final value of the accumulator.\n\n## Examples\n\n```rescript\nArray.reduceWithIndex([1, 2, 3, 4], 0, (acc, x, i) => acc + x + i)->assertEqual(16)\n\nArray.reduceWithIndex([1, 2, 3], list{}, (acc, v, i) => list{v + i, ...acc})->assertEqual(list{5, 3, 1})\n\nArray.reduceWithIndex([], list{}, (acc, v, i) => list{v + i, ...acc})->assertEqual(list{})\n```" ], "signature": "let reduceWithIndex: (array<'a>, 'b, ('b, 'a, int) => 'b) => 'b" }, { - "id": "Core.Array.reduceRight", + "id": "Stdlib.Array.reduceRight", "kind": "value", "name": "reduceRight", "docstrings": [ - "`reduceRight(xs, init, fn)`\n\n Works like `Array.reduce`; except that function `fn` is applied to each item of `xs` from the last back to the first.\n\n ```res example\n Array.reduceRight([\"a\", \"b\", \"c\", \"d\"], \"\", (a, b) => a ++ b) == \"dcba\"\n ```" + "`reduceRight(xs, init, fn)`\n\nWorks like `Array.reduce`; except that function `fn` is applied to each item of `xs` from the last back to the first.\n\n## Examples\n\n```rescript\nArray.reduceRight([\"a\", \"b\", \"c\", \"d\"], \"\", (a, b) => a ++ b)->assertEqual(\"dcba\")\n\nArray.reduceRight([1, 2, 3], list{}, List.add)->assertEqual(list{1, 2, 3})\n\nArray.reduceRight([], list{}, List.add)->assertEqual(list{})\n```" ], "signature": "let reduceRight: (array<'a>, 'b, ('b, 'a) => 'b) => 'b" }, { - "id": "Core.Array.reduceRightWithIndex", + "id": "Stdlib.Array.reduceRightWithIndex", "kind": "value", "name": "reduceRightWithIndex", "docstrings": [ - "`reduceRightWithIndex(xs, init, fn)`\n\n Like `reduceRight`, but with an additional index argument on the callback function.\n\n ```res example\n Array.reduceRightWithIndex([1, 2, 3, 4], 0, (acc, x, i) => acc + x + i) == 16\n ```" + "`reduceRightWithIndex(xs, init, fn)`\n\nLike `reduceRight`, but with an additional index argument on the callback function.\n\n## Examples\n\n```rescript\nArray.reduceRightWithIndex([1, 2, 3, 4], 0, (acc, x, i) => acc + x + i)->assertEqual(16)\n\nArray.reduceRightWithIndex([], list{}, (acc, v, i) => list{v + i, ...acc})->assertEqual(list{})\n```" ], "signature": "let reduceRightWithIndex: (array<'a>, 'b, ('b, 'a, int) => 'b) => 'b" }, { - "id": "Core.Array.some", + "id": "Stdlib.Array.some", "kind": "value", "name": "some", "docstrings": [ - "`some(array, predicate)` returns true if `predicate` returns true for any element in `array`.\n\nSee [`Array.some`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some) on MDN.\n\n## Examples\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\n\nConsole.log(array->Array.some(greeting => greeting === \"Hello\")) // true\n```" + "`some(array, predicate)` returns true if `predicate` returns true for any element in `array`.\n\nSee [`Array.some`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\n\narray\n->Array.some(greeting => greeting === \"Hello\")\n->assertEqual(true)\n```" ], "signature": "let some: (array<'a>, 'a => bool) => bool" }, { - "id": "Core.Array.someWithIndex", + "id": "Stdlib.Array.someWithIndex", "kind": "value", "name": "someWithIndex", "docstrings": [ - "`someWithIndex(array, checker)` returns true if running the provided `checker` function on any element in `array` returns true.\n\nSee [`Array.some`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some) on MDN.\n\n## Examples\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\n\nConsole.log(array->Array.someWithIndex((greeting, index) => greeting === \"Hello\" && index === 0)) // true\n```" + "`someWithIndex(array, checker)` returns true if running the provided `checker` function on any element in `array` returns true.\n\nSee [`Array.some`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\n\narray\n->Array.someWithIndex((greeting, index) => greeting === \"Hello\" && index === 0)\n->assertEqual(true)\n```" ], "signature": "let someWithIndex: (array<'a>, ('a, int) => bool) => bool" }, { - "id": "Core.Array.get", + "id": "Stdlib.Array.get", "kind": "value", "name": "get", "docstrings": [ - "`get(array, index)` returns the element at `index` of `array`.\n\nReturns `None` if the index does not exist in the array. Equivalent to doing `array[index]` in JavaScript.\n\n## Examples\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\n\narray->Array.get(0) == Some(\"Hello\") // true\narray->Array.get(3) == None // true\n```" + "`get(array, index)` returns the element at `index` of `array`.\n\nReturns `None` if the index does not exist in the array. Equivalent to doing `array[index]` in JavaScript.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\n\narray\n->Array.get(0)\n->assertEqual(Some(\"Hello\"))\n\narray\n->Array.get(3)\n->assertEqual(None)\n```" ], "signature": "let get: (array<'a>, int) => option<'a>" }, { - "id": "Core.Array.set", + "id": "Stdlib.Array.set", "kind": "value", "name": "set", "docstrings": [ - "`set(array, index, item)` sets the provided `item` at `index` of `array`.\n\nBeware this will *mutate* the array.\n\n## Examples\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\narray->Array.set(1, \"Hello\")\n\nConsole.log(array[1]) // \"Hello\"\n```" + "`set(array, index, item)` sets the provided `item` at `index` of `array`.\n\nBeware this will *mutate* the array.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\narray->Array.set(1, \"Hello\")\n\narray[1]->assertEqual(Some(\"Hello\"))\n```" ], "signature": "let set: (array<'a>, int, 'a) => unit" }, { - "id": "Core.Array.getSymbol", + "id": "Stdlib.Array.getSymbol", "kind": "value", "name": "getSymbol", "docstrings": [], - "signature": "let getSymbol: (array<'a>, Core__Symbol.t) => option<'b>" + "signature": "let getSymbol: (array<'a>, Symbol.t) => option<'b>" }, { - "id": "Core.Array.getSymbolUnsafe", + "id": "Stdlib.Array.getSymbolUnsafe", "kind": "value", "name": "getSymbolUnsafe", "docstrings": [], - "signature": "let getSymbolUnsafe: (array<'a>, Core__Symbol.t) => 'b" + "signature": "let getSymbolUnsafe: (array<'a>, Symbol.t) => 'b" }, { - "id": "Core.Array.setSymbol", + "id": "Stdlib.Array.setSymbol", "kind": "value", "name": "setSymbol", "docstrings": [], - "signature": "let setSymbol: (array<'a>, Core__Symbol.t, 'b) => unit" + "signature": "let setSymbol: (array<'a>, Symbol.t, 'b) => unit" }, { - "id": "Core.Array.getUnsafe", + "id": "Stdlib.Array.getUnsafe", "kind": "value", "name": "getUnsafe", "docstrings": [ @@ -9838,113 +11689,171 @@ "signature": "let getUnsafe: (array<'a>, int) => 'a" }, { - "id": "Core.Array.setUnsafe", + "id": "Stdlib.Array.unsafe_get", + "kind": "value", + "name": "unsafe_get", + "docstrings": [ + "`unsafe_get(array, index)` returns the element at `index` of `array`.\n\nThis is _unsafe_, meaning it will return `undefined` value if `index` does not exist in `array`.\n\nUse `Array.unsafe_get` only when you are sure the `index` exists (i.e. when using for-loop).\n\n## Examples\n\n```rescript\nlet array = [1, 2, 3]\nfor index in 0 to array->Array.length - 1 {\n let value = array->Array.unsafe_get(index)\n Console.log(value)\n}\n```" + ], + "signature": "let unsafe_get: (array<'a>, int) => 'a", + "deprecated": "Use getUnsafe instead. This will be removed in v13" + }, + { + "id": "Stdlib.Array.setUnsafe", "kind": "value", "name": "setUnsafe", "docstrings": [ - "`setUnsafe(array, index, item)` sets the provided `item` at `index` of `array`.\n\nBeware this will *mutate* the array, and is *unsafe*.\n\n## Examples\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\narray->Array.setUnsafe(1, \"Hello\")\n\nConsole.log(array[1]) // \"Hello\"\n```" + "`setUnsafe(array, index, item)` sets the provided `item` at `index` of `array`.\n\nBeware this will *mutate* the array, and is *unsafe*.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\narray->Array.setUnsafe(1, \"Hello\")\n\nassertEqual(array[1], Some(\"Hello\"))\n```" ], "signature": "let setUnsafe: (array<'a>, int, 'a) => unit" }, { - "id": "Core.Array.findIndexOpt", + "id": "Stdlib.Array.findIndexOpt", "kind": "value", "name": "findIndexOpt", "docstrings": [ - "`findIndexOpt(array, checker)` returns the index of the first element of `array` where the provided `checker` function returns true.\n\nReturns `None` if no item matches.\n\nSee [`Array.findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex) on MDN.\n\n## Examples\n```rescript\ntype languages = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, TypeScript, JavaScript]\n\nswitch array->Array.findIndexOpt(item => item == ReScript) {\n| None => Console.log(\"Ahh, no ReScript...\")\n| Some(index) => Console.log(\"Yay, ReScript at index \" ++ Int.toString(index))\n}\n```" + "`findIndexOpt(array, checker)` returns the index of the first element of `array` where the provided `checker` function returns true.\n\nReturns `None` if no item matches.\n\nSee [`Array.findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex) on MDN.\n\n## Examples\n\n```rescript\ntype languages = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, TypeScript, JavaScript]\n\narray\n->Array.findIndexOpt(item => item == ReScript)\n->assertEqual(Some(0))\n```" ], "signature": "let findIndexOpt: (array<'a>, 'a => bool) => option" }, { - "id": "Core.Array.toReversed", + "id": "Stdlib.Array.findLastIndexOpt", + "kind": "value", + "name": "findLastIndexOpt", + "docstrings": [ + "`findIndexOpt(array, checker)` returns the index of the last element of `array` where the provided `checker` function returns true.\n\nReturns `None` if no item matches.\n\nSee [`Array.findLastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findLastIndex) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"hello\", \"world\", \"!\"]\n\narray\n->Array.findLastIndexOpt(item => item->String.includes(\"o\"))\n->assertEqual(Some(1))\n```" + ], + "signature": "let findLastIndexOpt: (array<'a>, 'a => bool) => option" + }, + { + "id": "Stdlib.Array.toReversed", "kind": "value", "name": "toReversed", "docstrings": [ - "`toReversed(array)` creates a new array with all items from `array` in reversed order.\n\nSee [`Array.toReversed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toReversed) on MDN.\n\n## Examples\n```rescript\nlet someArray = [\"hi\", \"hello\"]\nlet reversed = someArray->Array.toReversed\n\nConsole.log(reversed) // [\"hello\", \"h1\"]\nConsole.log(someArray) // [\"h1\", \"hello\"]. Original unchanged\n```" + "`toReversed(array)` creates a new array with all items from `array` in reversed order.\n\nSee [`Array.toReversed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toReversed) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\nlet reversed = someArray->Array.toReversed\n\nreversed->assertEqual([\"hello\", \"hi\"])\nsomeArray->assertEqual([\"hi\", \"hello\"]) // Original unchanged\n```" ], "signature": "let toReversed: array<'a> => array<'a>" }, { - "id": "Core.Array.filterMap", + "id": "Stdlib.Array.filterMap", "kind": "value", "name": "filterMap", "docstrings": [ - "`filterMap(array, fn)`\n\nCalls `fn` for each element and returns a new array containing results of the `fn` calls which are not `None`.\n\n## Examples\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\n\nConsole.log(\n array->Array.filterMap(item =>\n switch item {\n | \"Hello\" => Some(item->String.length)\n | _ => None\n }\n ),\n) // [5]\n```" + "`filterMap(array, fn)`\n\nCalls `fn` for each element and returns a new array containing results of the `fn` calls which are not `None`.\n\n## Examples\n\n```rescript\n[\"Hello\", \"Hi\", \"Good bye\"]\n->Array.filterMap(item =>\n switch item {\n | \"Hello\" => Some(item->String.length)\n | _ => None\n }\n)\n->assertEqual([5])\n\n[1, 2, 3, 4, 5, 6]\n->Array.filterMap(n => mod(n, 2) == 0 ? Some(n * n) : None)\n->assertEqual([4, 16, 36])\n\nArray.filterMap([1, 2, 3, 4, 5, 6], _ => None)->assertEqual([])\n\nArray.filterMap([], n => mod(n, 2) == 0 ? Some(n * n) : None)->assertEqual([])\n```" ], "signature": "let filterMap: (array<'a>, 'a => option<'b>) => array<'b>" }, { - "id": "Core.Array.keepSome", + "id": "Stdlib.Array.keepSome", "kind": "value", "name": "keepSome", "docstrings": [ - "`keepSome(arr)`\n\n Returns a new array containing `value` for all elements that are `Some(value)`\n and ignoring every value that is `None`\n\n ```res example\n Array.keepSome([Some(1), None, Some(3)]) == [1, 3]\n ```" + "`keepSome(arr)`\n\nReturns a new array containing `value` for all elements that are `Some(value)`\nand ignoring every value that is `None`\n\n## Examples\n\n```rescript\nArray.keepSome([Some(1), None, Some(3)])->assertEqual([1, 3])\n\nArray.keepSome([Some(1), Some(2), Some(3)])->assertEqual([1, 2, 3])\n\nArray.keepSome([None, None, None])->assertEqual([])\n\nArray.keepSome([])->assertEqual([])\n```" ], "signature": "let keepSome: array> => array<'a>" }, { - "id": "Core.Array.toShuffled", + "id": "Stdlib.Array.toShuffled", "kind": "value", "name": "toShuffled", "docstrings": [ - "`toShuffled(array)` returns a new array with all items in `array` in a random order.\n\n## Examples\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet shuffledArray = array->Array.toShuffled\n\nConsole.log(shuffledArray)\n```" + "`toShuffled(array)` returns a new array with all items in `array` in a random order.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet shuffledArray = array->Array.toShuffled\nConsole.log(shuffledArray)\n\nArray.toShuffled([1, 2, 3])\n->Array.length\n->assertEqual(3)\n```" ], "signature": "let toShuffled: array<'a> => array<'a>" }, { - "id": "Core.Array.shuffle", + "id": "Stdlib.Array.shuffle", "kind": "value", "name": "shuffle", "docstrings": [ - "`shuffle(array)` randomizes the position of all items in `array`.\n\nBeware this will *mutate* the array.\n\n## Examples\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\narray->Array.shuffle\n\nConsole.log(array)\n```" + "`shuffle(array)` randomizes the position of all items in `array`.\n\nBeware this will *mutate* the array.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\narray->Array.shuffle\nConsole.log(array)\n\nlet array2 = [1, 2, 3]\narray2->Array.shuffle\n\narray2\n->Array.length\n->assertEqual(3)\n```" ], "signature": "let shuffle: array<'a> => unit" }, { - "id": "Core.Array.flatMap", + "id": "Stdlib.Array.flatMap", "kind": "value", "name": "flatMap", "docstrings": [ - "`flatMap(array, mapper)` returns a new array concatenating the arrays returned from running `mapper` on all items in `array`.\n\n## Examples\n```rescript\ntype language = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, TypeScript, JavaScript]\n\nConsole.log(\n array->Array.flatMap(item =>\n switch item {\n | ReScript => [1, 2, 3]\n | TypeScript => [4, 5, 6]\n | JavaScript => [7, 8, 9]\n }\n ),\n)\n// [1, 2, 3, 4, 5, 6, 7, 8, 9]\n```" + "`flatMap(array, mapper)` returns a new array concatenating the arrays returned from running `mapper` on all items in `array`.\n\n## Examples\n\n```rescript\ntype language = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, TypeScript, JavaScript]\n\narray\n->Array.flatMap(item =>\n switch item {\n | ReScript => [1, 2, 3]\n | TypeScript => [4, 5, 6]\n | JavaScript => [7, 8, 9]\n }\n)\n->assertEqual([1, 2, 3, 4, 5, 6, 7, 8, 9])\n```" ], "signature": "let flatMap: (array<'a>, 'a => array<'b>) => array<'b>" }, { - "id": "Core.Array.flatMapWithIndex", + "id": "Stdlib.Array.flatMapWithIndex", "kind": "value", "name": "flatMapWithIndex", "docstrings": [ - "`flatMapWithIndex(array, mapper)` returns a new array concatenating the arrays returned from running `mapper` on all items in `array`.\n\n## Examples\n```rescript\ntype language = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, TypeScript, JavaScript]\n\nConsole.log(\n array->Array.flatMapWithIndex((item, index) =>\n switch item {\n | ReScript => [index]\n | TypeScript => [index, index + 1]\n | JavaScript => [index, index + 1, index + 2]\n }\n ),\n)\n// [0, 1, 2, 2, 3, 4]\n```" + "`flatMapWithIndex(array, mapper)` returns a new array concatenating the arrays returned from running `mapper` on all items in `array`.\n\n## Examples\n\n```rescript\ntype language = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, TypeScript, JavaScript]\n\n\narray\n->Array.flatMapWithIndex((item, index) =>\n switch item {\n | ReScript => [index]\n | TypeScript => [index, index + 1]\n | JavaScript => [index, index + 1, index + 2]\n }\n)\n->assertEqual([0, 1, 2, 2, 3, 4])\n```" ], "signature": "let flatMapWithIndex: (array<'a>, ('a, int) => array<'b>) => array<'b>" }, { - "id": "Core.Array.findMap", + "id": "Stdlib.Array.findMap", "kind": "value", "name": "findMap", "docstrings": [ - "`findMap(arr, fn)`\n\n Calls `fn` for each element and returns the first value from `fn` that is `Some(_)`.\n Otherwise returns `None`\n\n ```res example\n Array.findMap([1, 2, 3], n => mod(n, 2) == 0 ? Some(n - 2) : None) == Some(0) // true\n ```" + "`findMap(arr, fn)`\n\nCalls `fn` for each element and returns the first value from `fn` that is `Some(_)`.\nOtherwise returns `None`\n\n## Examples\n\n```rescript\nArray.findMap([1, 2, 3], n => mod(n, 2) == 0 ? Some(n - 2) : None)->assertEqual(Some(0))\n\nArray.findMap([1, 2, 3, 4, 5, 6], n => mod(n, 2) == 0 ? Some(n - 8) : None)->assertEqual(Some(-6))\n\nArray.findMap([1, 2, 3, 4, 5, 6], _ => None)->assertEqual(None)\n\nArray.findMap([], n => mod(n, 2) == 0 ? Some(n * n) : None)->assertEqual(None)\n```" ], "signature": "let findMap: (array<'a>, 'a => option<'b>) => option<'b>" }, { - "id": "Core.Array.at", + "id": "Stdlib.Array.at", "kind": "value", "name": "at", "docstrings": [ - "`at(array, index)`\n\n Get an element by its index. Negative indices count backwards from the last item.\n\n ## Examples\n ```rescript\n [\"a\", \"b\", \"c\"]->Array.at(0) // Some(\"a\")\n [\"a\", \"b\", \"c\"]->Array.at(2) // Some(\"c\")\n [\"a\", \"b\", \"c\"]->Array.at(3) // None\n [\"a\", \"b\", \"c\"]->Array.at(-1) // Some(\"c\")\n [\"a\", \"b\", \"c\"]->Array.at(-3) // Some(\"a\")\n [\"a\", \"b\", \"c\"]->Array.at(-4) // None\n ```" + "`at(array, index)`\n\nGet an element by its index. Negative indices count backwards from the last item.\n\n## Examples\n\n```rescript\n[\"a\", \"b\", \"c\"]->Array.at(0)->assertEqual(Some(\"a\"))\n[\"a\", \"b\", \"c\"]->Array.at(2)->assertEqual(Some(\"c\"))\n[\"a\", \"b\", \"c\"]->Array.at(3)->assertEqual(None)\n[\"a\", \"b\", \"c\"]->Array.at(-1)->assertEqual(Some(\"c\"))\n[\"a\", \"b\", \"c\"]->Array.at(-3)->assertEqual(Some(\"a\"))\n[\"a\", \"b\", \"c\"]->Array.at(-4)->assertEqual(None)\n```" ], "signature": "let at: (array<'a>, int) => option<'a>" }, { - "id": "Core.Array.last", + "id": "Stdlib.Array.last", "kind": "value", "name": "last", "docstrings": [ - "`last(array)` returns the last element of `array`.\n\nReturns `None` if the array is empty.\n\n## Examples\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\n\narray->Array.last == Some(\"Good bye\") // true\n[]->Array.last == None // true\n```" + "`last(array)` returns the last element of `array`.\n\nReturns `None` if the array is empty.\n\n## Examples\n\n```rescript\n[\"Hello\", \"Hi\", \"Good bye\"]\n->Array.last\n->assertEqual(Some(\"Good bye\"))\n\n[]\n->Array.last\n->assertEqual(None)\n```" ], "signature": "let last: array<'a> => option<'a>" + }, + { + "id": "Stdlib.Array.ignore", + "kind": "value", + "name": "ignore", + "docstrings": [ + "`ignore(array)` ignores the provided array and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further." + ], + "signature": "let ignore: array<'a> => unit" + }, + { + "id": "Stdlib.Array.entries", + "kind": "value", + "name": "entries", + "docstrings": [ + "`entries(array)` returns a new array iterator object that contains the key/value pairs for each index in the array.\n\nSee [Array.prototype.entries](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/entries) on MDN.\n\n## Examples\n\n```rescript\nlet array = [5, 6, 7]\nlet iterator : Iterator.t<(int, int)> = array->Array.entries\niterator->Iterator.next->assertEqual({done: false, value: Some((0, 5))})\niterator->Iterator.next->assertEqual({done: false, value: Some((1, 6))})\n```" + ], + "signature": "let entries: array<'a> => Iterator.t<(int, 'a)>" + }, + { + "id": "Stdlib.Array.values", + "kind": "value", + "name": "values", + "docstrings": [ + "`values(array)` returns a new array iterator object that contains the values for each index in the array.\n\nSee [Array.prototype.values](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/values) on MDN.\n\n## Examples\n\n```rescript\nlet array = [5, 6, 7]\nlet iterator : Iterator.t = array->Array.values\niterator->Iterator.next->assertEqual({done: false, value: Some(5)})\niterator->Iterator.next->assertEqual({done: false, value: Some(6)})\n```" + ], + "signature": "let values: array<'a> => Iterator.t<'a>" } ] + }, + "stdlib/intervalid": { + "id": "Stdlib.IntervalId", + "name": "IntervalId", + "docstrings": [], + "items": [] + }, + "stdlib/timeoutid": { + "id": "Stdlib.TimeoutId", + "name": "TimeoutId", + "docstrings": [], + "items": [] } } \ No newline at end of file diff --git a/data/api/v12.0.0/toc_tree.json b/data/api/v12.0.0/toc_tree.json index faf8bb122..509e0d55b 100644 --- a/data/api/v12.0.0/toc_tree.json +++ b/data/api/v12.0.0/toc_tree.json @@ -1 +1 @@ -{"js":{"name":"Js","path":["js"],"children":[{"name":"WeakMap","path":["js","weakmap"],"children":[]},{"name":"Map","path":["js","map"],"children":[]},{"name":"WeakSet","path":["js","weakset"],"children":[]},{"name":"Set","path":["js","set"],"children":[]},{"name":"Console","path":["js","console"],"children":[]},{"name":"Vector","path":["js","vector"],"children":[]},{"name":"List","path":["js","list"],"children":[]},{"name":"Result","path":["js","result"],"children":[]},{"name":"Option","path":["js","option"],"children":[]},{"name":"Blob","path":["js","blob"],"children":[]},{"name":"File","path":["js","file"],"children":[]},{"name":"BigInt","path":["js","bigint"],"children":[]},{"name":"Int","path":["js","int"],"children":[]},{"name":"Float","path":["js","float"],"children":[]},{"name":"Types","path":["js","types"],"children":[]},{"name":"TypedArray2","path":["js","typedarray2"],"children":[{"name":"DataView","path":["js","typedarray2","dataview"],"children":[]},{"name":"Float64Array","path":["js","typedarray2","float64array"],"children":[]},{"name":"Float32Array","path":["js","typedarray2","float32array"],"children":[]},{"name":"Uint32Array","path":["js","typedarray2","uint32array"],"children":[]},{"name":"Int32Array","path":["js","typedarray2","int32array"],"children":[]},{"name":"Uint16Array","path":["js","typedarray2","uint16array"],"children":[]},{"name":"Int16Array","path":["js","typedarray2","int16array"],"children":[]},{"name":"Uint8ClampedArray","path":["js","typedarray2","uint8clampedarray"],"children":[]},{"name":"Uint8Array","path":["js","typedarray2","uint8array"],"children":[]},{"name":"Int8Array","path":["js","typedarray2","int8array"],"children":[]},{"name":"ArrayBuffer","path":["js","typedarray2","arraybuffer"],"children":[]}]},{"name":"Typed_array","path":["js","typed_array"],"children":[{"name":"DataView","path":["js","typed_array","dataview"],"children":[]},{"name":"Float64_array","path":["js","typed_array","float64_array"],"children":[]},{"name":"Float64Array","path":["js","typed_array","float64array"],"children":[]},{"name":"Float32_array","path":["js","typed_array","float32_array"],"children":[]},{"name":"Float32Array","path":["js","typed_array","float32array"],"children":[]},{"name":"Uint32Array","path":["js","typed_array","uint32array"],"children":[]},{"name":"Int32_array","path":["js","typed_array","int32_array"],"children":[]},{"name":"Int32Array","path":["js","typed_array","int32array"],"children":[]},{"name":"Uint16Array","path":["js","typed_array","uint16array"],"children":[]},{"name":"Int16Array","path":["js","typed_array","int16array"],"children":[]},{"name":"Uint8ClampedArray","path":["js","typed_array","uint8clampedarray"],"children":[]},{"name":"Uint8Array","path":["js","typed_array","uint8array"],"children":[]},{"name":"Int8Array","path":["js","typed_array","int8array"],"children":[]},{"name":"S","path":["js","typed_array","s"],"children":[]},{"name":"ArrayBuffer","path":["js","typed_array","arraybuffer"],"children":[]},{"name":"Type","path":["js","typed_array","type"],"children":[]}]},{"name":"Obj","path":["js","obj"],"children":[]},{"name":"Math","path":["js","math"],"children":[]},{"name":"Json","path":["js","json"],"children":[{"name":"Kind","path":["js","json","kind"],"children":[]}]},{"name":"Global","path":["js","global"],"children":[]},{"name":"Dict","path":["js","dict"],"children":[]},{"name":"Date","path":["js","date"],"children":[]},{"name":"Promise2","path":["js","promise2"],"children":[]},{"name":"Promise","path":["js","promise"],"children":[]},{"name":"Re","path":["js","re"],"children":[]},{"name":"String2","path":["js","string2"],"children":[]},{"name":"String","path":["js","string"],"children":[]},{"name":"Array2","path":["js","array2"],"children":[]},{"name":"Array","path":["js","array"],"children":[]},{"name":"Exn","path":["js","exn"],"children":[]},{"name":"Null_undefined","path":["js","null_undefined"],"children":[]},{"name":"Nullable","path":["js","nullable"],"children":[]},{"name":"Undefined","path":["js","undefined"],"children":[]},{"name":"Null","path":["js","null"],"children":[]}]},"belt":{"name":"Belt","path":["belt"],"children":[{"name":"Float","path":["belt","float"],"children":[]},{"name":"Int","path":["belt","int"],"children":[]},{"name":"Result","path":["belt","result"],"children":[]},{"name":"Option","path":["belt","option"],"children":[]},{"name":"HashMap","path":["belt","hashmap"],"children":[{"name":"String","path":["belt","hashmap","string"],"children":[]},{"name":"Int","path":["belt","hashmap","int"],"children":[]}]},{"name":"HashSet","path":["belt","hashset"],"children":[{"name":"String","path":["belt","hashset","string"],"children":[]},{"name":"Int","path":["belt","hashset","int"],"children":[]}]},{"name":"MutableMap","path":["belt","mutablemap"],"children":[{"name":"String","path":["belt","mutablemap","string"],"children":[]},{"name":"Int","path":["belt","mutablemap","int"],"children":[]}]},{"name":"MutableSet","path":["belt","mutableset"],"children":[{"name":"String","path":["belt","mutableset","string"],"children":[]},{"name":"Int","path":["belt","mutableset","int"],"children":[]}]},{"name":"Map","path":["belt","map"],"children":[{"name":"Dict","path":["belt","map","dict"],"children":[]},{"name":"String","path":["belt","map","string"],"children":[]},{"name":"Int","path":["belt","map","int"],"children":[]}]},{"name":"Set","path":["belt","set"],"children":[{"name":"Dict","path":["belt","set","dict"],"children":[]},{"name":"String","path":["belt","set","string"],"children":[]},{"name":"Int","path":["belt","set","int"],"children":[]}]},{"name":"Range","path":["belt","range"],"children":[]},{"name":"List","path":["belt","list"],"children":[]},{"name":"MutableStack","path":["belt","mutablestack"],"children":[]},{"name":"MutableQueue","path":["belt","mutablequeue"],"children":[]},{"name":"SortArray","path":["belt","sortarray"],"children":[{"name":"String","path":["belt","sortarray","string"],"children":[]},{"name":"Int","path":["belt","sortarray","int"],"children":[]}]},{"name":"Array","path":["belt","array"],"children":[]},{"name":"Id","path":["belt","id"],"children":[{"name":"MakeHashable","path":["belt","id","makehashable"],"children":[]},{"name":"MakeHashableU","path":["belt","id","makehashableu"],"children":[]},{"name":"MakeComparable","path":["belt","id","makecomparable"],"children":[]},{"name":"MakeComparableU","path":["belt","id","makecomparableu"],"children":[]}]}]},"dom":{"name":"Dom","path":["dom"],"children":[{"name":"Storage2","path":["dom","storage2"],"children":[]},{"name":"Storage","path":["dom","storage"],"children":[]}]},"core":{"name":"Core","path":["core"],"children":[{"name":"Result","path":["core","result"],"children":[]},{"name":"List","path":["core","list"],"children":[]},{"name":"Option","path":["core","option"],"children":[]},{"name":"Exn","path":["core","exn"],"children":[]},{"name":"Intl","path":["core","intl"],"children":[{"name":"Segments","path":["core","intl","segments"],"children":[]},{"name":"Segmenter","path":["core","intl","segmenter"],"children":[]},{"name":"RelativeTimeFormat","path":["core","intl","relativetimeformat"],"children":[]},{"name":"PluralRules","path":["core","intl","pluralrules"],"children":[]},{"name":"NumberFormat","path":["core","intl","numberformat"],"children":[{"name":"Grouping","path":["core","intl","numberformat","grouping"],"children":[]}]},{"name":"Locale","path":["core","intl","locale"],"children":[]},{"name":"ListFormat","path":["core","intl","listformat"],"children":[]},{"name":"DateTimeFormat","path":["core","intl","datetimeformat"],"children":[]},{"name":"Collator","path":["core","intl","collator"],"children":[]},{"name":"Common","path":["core","intl","common"],"children":[]}]},{"name":"BigUint64Array","path":["core","biguint64array"],"children":[{"name":"Constants","path":["core","biguint64array","constants"],"children":[]}]},{"name":"BigInt64Array","path":["core","bigint64array"],"children":[{"name":"Constants","path":["core","bigint64array","constants"],"children":[]}]},{"name":"Uint8ClampedArray","path":["core","uint8clampedarray"],"children":[{"name":"Constants","path":["core","uint8clampedarray","constants"],"children":[]}]},{"name":"Uint32Array","path":["core","uint32array"],"children":[{"name":"Constants","path":["core","uint32array","constants"],"children":[]}]},{"name":"Uint16Array","path":["core","uint16array"],"children":[{"name":"Constants","path":["core","uint16array","constants"],"children":[]}]},{"name":"Uint8Array","path":["core","uint8array"],"children":[{"name":"Constants","path":["core","uint8array","constants"],"children":[]}]},{"name":"Int32Array","path":["core","int32array"],"children":[{"name":"Constants","path":["core","int32array","constants"],"children":[]}]},{"name":"Int16Array","path":["core","int16array"],"children":[{"name":"Constants","path":["core","int16array","constants"],"children":[]}]},{"name":"Int8Array","path":["core","int8array"],"children":[{"name":"Constants","path":["core","int8array","constants"],"children":[]}]},{"name":"Float64Array","path":["core","float64array"],"children":[{"name":"Constants","path":["core","float64array","constants"],"children":[]}]},{"name":"Float32Array","path":["core","float32array"],"children":[{"name":"Constants","path":["core","float32array","constants"],"children":[]}]},{"name":"TypedArray","path":["core","typedarray"],"children":[]},{"name":"ArrayBuffer","path":["core","arraybuffer"],"children":[]},{"name":"WeakSet","path":["core","weakset"],"children":[]},{"name":"Set","path":["core","set"],"children":[]},{"name":"WeakMap","path":["core","weakmap"],"children":[]},{"name":"Map","path":["core","map"],"children":[]},{"name":"AsyncIterator","path":["core","asynciterator"],"children":[]},{"name":"Iterator","path":["core","iterator"],"children":[]},{"name":"JSON","path":["core","json"],"children":[{"name":"Decode","path":["core","json","decode"],"children":[]},{"name":"Encode","path":["core","json","encode"],"children":[]},{"name":"Classify","path":["core","json","classify"],"children":[]}]},{"name":"Type","path":["core","type"],"children":[{"name":"Classify","path":["core","type","classify"],"children":[]}]},{"name":"Symbol","path":["core","symbol"],"children":[]},{"name":"String","path":["core","string"],"children":[]},{"name":"RegExp","path":["core","regexp"],"children":[{"name":"Result","path":["core","regexp","result"],"children":[]}]},{"name":"Promise","path":["core","promise"],"children":[]},{"name":"Ordering","path":["core","ordering"],"children":[]},{"name":"Object","path":["core","object"],"children":[]},{"name":"Nullable","path":["core","nullable"],"children":[]},{"name":"Null","path":["core","null"],"children":[]},{"name":"Math","path":["core","math"],"children":[{"name":"Int","path":["core","math","int"],"children":[]},{"name":"Constants","path":["core","math","constants"],"children":[]}]},{"name":"BigInt","path":["core","bigint"],"children":[]},{"name":"Int","path":["core","int"],"children":[{"name":"Constants","path":["core","int","constants"],"children":[]}]},{"name":"Float","path":["core","float"],"children":[{"name":"Constants","path":["core","float","constants"],"children":[]}]},{"name":"Error","path":["core","error"],"children":[{"name":"URIError","path":["core","error","urierror"],"children":[]},{"name":"TypeError","path":["core","error","typeerror"],"children":[]},{"name":"SyntaxError","path":["core","error","syntaxerror"],"children":[]},{"name":"ReferenceError","path":["core","error","referenceerror"],"children":[]},{"name":"RangeError","path":["core","error","rangeerror"],"children":[]},{"name":"EvalError","path":["core","error","evalerror"],"children":[]}]},{"name":"Dict","path":["core","dict"],"children":[]},{"name":"Date","path":["core","date"],"children":[{"name":"UTC","path":["core","date","utc"],"children":[]}]},{"name":"DataView","path":["core","dataview"],"children":[]},{"name":"Console","path":["core","console"],"children":[]},{"name":"Array","path":["core","array"],"children":[]}]}} \ No newline at end of file +{"belt":{"name":"Belt","path":["belt"],"children":[{"name":"Float","path":["belt","float"],"children":[]},{"name":"Int","path":["belt","int"],"children":[]},{"name":"Result","path":["belt","result"],"children":[]},{"name":"Option","path":["belt","option"],"children":[]},{"name":"HashMap","path":["belt","hashmap"],"children":[{"name":"String","path":["belt","hashmap","string"],"children":[]},{"name":"Int","path":["belt","hashmap","int"],"children":[]}]},{"name":"HashSet","path":["belt","hashset"],"children":[{"name":"String","path":["belt","hashset","string"],"children":[]},{"name":"Int","path":["belt","hashset","int"],"children":[]}]},{"name":"MutableMap","path":["belt","mutablemap"],"children":[{"name":"String","path":["belt","mutablemap","string"],"children":[]},{"name":"Int","path":["belt","mutablemap","int"],"children":[]}]},{"name":"MutableSet","path":["belt","mutableset"],"children":[{"name":"String","path":["belt","mutableset","string"],"children":[]},{"name":"Int","path":["belt","mutableset","int"],"children":[]}]},{"name":"Map","path":["belt","map"],"children":[{"name":"Dict","path":["belt","map","dict"],"children":[]},{"name":"String","path":["belt","map","string"],"children":[]},{"name":"Int","path":["belt","map","int"],"children":[]}]},{"name":"Set","path":["belt","set"],"children":[{"name":"Dict","path":["belt","set","dict"],"children":[]},{"name":"String","path":["belt","set","string"],"children":[]},{"name":"Int","path":["belt","set","int"],"children":[]}]},{"name":"Range","path":["belt","range"],"children":[]},{"name":"List","path":["belt","list"],"children":[]},{"name":"MutableStack","path":["belt","mutablestack"],"children":[]},{"name":"MutableQueue","path":["belt","mutablequeue"],"children":[]},{"name":"SortArray","path":["belt","sortarray"],"children":[{"name":"String","path":["belt","sortarray","string"],"children":[]},{"name":"Int","path":["belt","sortarray","int"],"children":[]}]},{"name":"Array","path":["belt","array"],"children":[]},{"name":"Id","path":["belt","id"],"children":[{"name":"MakeHashable","path":["belt","id","makehashable"],"children":[]},{"name":"MakeHashableU","path":["belt","id","makehashableu"],"children":[]},{"name":"MakeComparable","path":["belt","id","makecomparable"],"children":[]},{"name":"MakeComparableU","path":["belt","id","makecomparableu"],"children":[]}]}]},"dom":{"name":"Dom","path":["dom"],"children":[{"name":"Storage2","path":["dom","storage2"],"children":[]},{"name":"Storage","path":["dom","storage"],"children":[]}]},"js":{"name":"Js","path":["js"],"children":[{"name":"WeakMap","path":["js","weakmap"],"children":[]},{"name":"Map","path":["js","map"],"children":[]},{"name":"WeakSet","path":["js","weakset"],"children":[]},{"name":"Set","path":["js","set"],"children":[]},{"name":"Console","path":["js","console"],"children":[]},{"name":"Result","path":["js","result"],"children":[]},{"name":"Option","path":["js","option"],"children":[]},{"name":"Blob","path":["js","blob"],"children":[]},{"name":"File","path":["js","file"],"children":[]},{"name":"BigInt","path":["js","bigint"],"children":[]},{"name":"Int","path":["js","int"],"children":[]},{"name":"Float","path":["js","float"],"children":[]},{"name":"Types","path":["js","types"],"children":[]},{"name":"TypedArray2","path":["js","typedarray2"],"children":[{"name":"DataView","path":["js","typedarray2","dataview"],"children":[]},{"name":"Float64Array","path":["js","typedarray2","float64array"],"children":[]},{"name":"Float32Array","path":["js","typedarray2","float32array"],"children":[]},{"name":"Uint32Array","path":["js","typedarray2","uint32array"],"children":[]},{"name":"Int32Array","path":["js","typedarray2","int32array"],"children":[]},{"name":"Uint16Array","path":["js","typedarray2","uint16array"],"children":[]},{"name":"Int16Array","path":["js","typedarray2","int16array"],"children":[]},{"name":"Uint8ClampedArray","path":["js","typedarray2","uint8clampedarray"],"children":[]},{"name":"Uint8Array","path":["js","typedarray2","uint8array"],"children":[]},{"name":"Int8Array","path":["js","typedarray2","int8array"],"children":[]},{"name":"ArrayBuffer","path":["js","typedarray2","arraybuffer"],"children":[]}]},{"name":"Typed_array","path":["js","typed_array"],"children":[{"name":"DataView","path":["js","typed_array","dataview"],"children":[]},{"name":"Float64_array","path":["js","typed_array","float64_array"],"children":[]},{"name":"Float64Array","path":["js","typed_array","float64array"],"children":[]},{"name":"Float32_array","path":["js","typed_array","float32_array"],"children":[]},{"name":"Float32Array","path":["js","typed_array","float32array"],"children":[]},{"name":"Uint32Array","path":["js","typed_array","uint32array"],"children":[]},{"name":"Int32_array","path":["js","typed_array","int32_array"],"children":[]},{"name":"Int32Array","path":["js","typed_array","int32array"],"children":[]},{"name":"Uint16Array","path":["js","typed_array","uint16array"],"children":[]},{"name":"Int16Array","path":["js","typed_array","int16array"],"children":[]},{"name":"Uint8ClampedArray","path":["js","typed_array","uint8clampedarray"],"children":[]},{"name":"Uint8Array","path":["js","typed_array","uint8array"],"children":[]},{"name":"Int8Array","path":["js","typed_array","int8array"],"children":[]},{"name":"S","path":["js","typed_array","s"],"children":[]},{"name":"ArrayBuffer","path":["js","typed_array","arraybuffer"],"children":[]},{"name":"Type","path":["js","typed_array","type"],"children":[]}]},{"name":"Obj","path":["js","obj"],"children":[]},{"name":"Math","path":["js","math"],"children":[]},{"name":"Json","path":["js","json"],"children":[{"name":"Kind","path":["js","json","kind"],"children":[]}]},{"name":"Global","path":["js","global"],"children":[]},{"name":"Dict","path":["js","dict"],"children":[]},{"name":"Date","path":["js","date"],"children":[]},{"name":"Promise2","path":["js","promise2"],"children":[]},{"name":"Promise","path":["js","promise"],"children":[]},{"name":"Re","path":["js","re"],"children":[]},{"name":"String2","path":["js","string2"],"children":[]},{"name":"String","path":["js","string"],"children":[]},{"name":"Array2","path":["js","array2"],"children":[]},{"name":"Array","path":["js","array"],"children":[]},{"name":"Exn","path":["js","exn"],"children":[]},{"name":"Null_undefined","path":["js","null_undefined"],"children":[]},{"name":"Nullable","path":["js","nullable"],"children":[]},{"name":"Undefined","path":["js","undefined"],"children":[]},{"name":"Null","path":["js","null"],"children":[]}]},"stdlib":{"name":"Stdlib","path":["stdlib"],"children":[{"name":"BigUint64Array","path":["stdlib","biguint64array"],"children":[{"name":"Constants","path":["stdlib","biguint64array","constants"],"children":[]}]},{"name":"BigInt64Array","path":["stdlib","bigint64array"],"children":[{"name":"Constants","path":["stdlib","bigint64array","constants"],"children":[]}]},{"name":"Uint8ClampedArray","path":["stdlib","uint8clampedarray"],"children":[{"name":"Constants","path":["stdlib","uint8clampedarray","constants"],"children":[]}]},{"name":"Uint32Array","path":["stdlib","uint32array"],"children":[{"name":"Constants","path":["stdlib","uint32array","constants"],"children":[]}]},{"name":"Uint16Array","path":["stdlib","uint16array"],"children":[{"name":"Constants","path":["stdlib","uint16array","constants"],"children":[]}]},{"name":"Uint8Array","path":["stdlib","uint8array"],"children":[{"name":"Constants","path":["stdlib","uint8array","constants"],"children":[]}]},{"name":"Int32Array","path":["stdlib","int32array"],"children":[{"name":"Constants","path":["stdlib","int32array","constants"],"children":[]}]},{"name":"Int16Array","path":["stdlib","int16array"],"children":[{"name":"Constants","path":["stdlib","int16array","constants"],"children":[]}]},{"name":"Int8Array","path":["stdlib","int8array"],"children":[{"name":"Constants","path":["stdlib","int8array","constants"],"children":[]}]},{"name":"Float64Array","path":["stdlib","float64array"],"children":[{"name":"Constants","path":["stdlib","float64array","constants"],"children":[]}]},{"name":"Float32Array","path":["stdlib","float32array"],"children":[{"name":"Constants","path":["stdlib","float32array","constants"],"children":[]}]},{"name":"TypedArray","path":["stdlib","typedarray"],"children":[]},{"name":"ArrayBuffer","path":["stdlib","arraybuffer"],"children":[]},{"name":"WeakSet","path":["stdlib","weakset"],"children":[]},{"name":"Set","path":["stdlib","set"],"children":[]},{"name":"WeakMap","path":["stdlib","weakmap"],"children":[]},{"name":"Map","path":["stdlib","map"],"children":[]},{"name":"AsyncIterator","path":["stdlib","asynciterator"],"children":[]},{"name":"Iterator","path":["stdlib","iterator"],"children":[]},{"name":"Type","path":["stdlib","type"],"children":[{"name":"Classify","path":["stdlib","type","classify"],"children":[]}]},{"name":"Symbol","path":["stdlib","symbol"],"children":[]},{"name":"String","path":["stdlib","string"],"children":[]},{"name":"Result","path":["stdlib","result"],"children":[]},{"name":"RegExp","path":["stdlib","regexp"],"children":[{"name":"Result","path":["stdlib","regexp","result"],"children":[]}]},{"name":"Promise","path":["stdlib","promise"],"children":[]},{"name":"Pair","path":["stdlib","pair"],"children":[]},{"name":"Ordering","path":["stdlib","ordering"],"children":[]},{"name":"Option","path":["stdlib","option"],"children":[]},{"name":"Object","path":["stdlib","object"],"children":[]},{"name":"Nullable","path":["stdlib","nullable"],"children":[]},{"name":"Null","path":["stdlib","null"],"children":[]},{"name":"Math","path":["stdlib","math"],"children":[{"name":"Int","path":["stdlib","math","int"],"children":[]},{"name":"Constants","path":["stdlib","math","constants"],"children":[]}]},{"name":"List","path":["stdlib","list"],"children":[]},{"name":"Lazy","path":["stdlib","lazy"],"children":[]},{"name":"JSON","path":["stdlib","json"],"children":[{"name":"Decode","path":["stdlib","json","decode"],"children":[]},{"name":"Encode","path":["stdlib","json","encode"],"children":[]},{"name":"Classify","path":["stdlib","json","classify"],"children":[]}]},{"name":"JsExn","path":["stdlib","jsexn"],"children":[]},{"name":"JsError","path":["stdlib","jserror"],"children":[{"name":"URIError","path":["stdlib","jserror","urierror"],"children":[]},{"name":"TypeError","path":["stdlib","jserror","typeerror"],"children":[]},{"name":"SyntaxError","path":["stdlib","jserror","syntaxerror"],"children":[]},{"name":"ReferenceError","path":["stdlib","jserror","referenceerror"],"children":[]},{"name":"RangeError","path":["stdlib","jserror","rangeerror"],"children":[]},{"name":"EvalError","path":["stdlib","jserror","evalerror"],"children":[]}]},{"name":"Intl","path":["stdlib","intl"],"children":[{"name":"Segments","path":["stdlib","intl","segments"],"children":[]},{"name":"Segmenter","path":["stdlib","intl","segmenter"],"children":[]},{"name":"RelativeTimeFormat","path":["stdlib","intl","relativetimeformat"],"children":[]},{"name":"PluralRules","path":["stdlib","intl","pluralrules"],"children":[]},{"name":"NumberFormat","path":["stdlib","intl","numberformat"],"children":[{"name":"Grouping","path":["stdlib","intl","numberformat","grouping"],"children":[]}]},{"name":"Locale","path":["stdlib","intl","locale"],"children":[]},{"name":"ListFormat","path":["stdlib","intl","listformat"],"children":[]},{"name":"DateTimeFormat","path":["stdlib","intl","datetimeformat"],"children":[]},{"name":"Collator","path":["stdlib","intl","collator"],"children":[]},{"name":"Common","path":["stdlib","intl","common"],"children":[]}]},{"name":"Int","path":["stdlib","int"],"children":[{"name":"Ref","path":["stdlib","int","ref"],"children":[]},{"name":"Constants","path":["stdlib","int","constants"],"children":[]}]},{"name":"Float","path":["stdlib","float"],"children":[{"name":"Constants","path":["stdlib","float","constants"],"children":[]}]},{"name":"Error","path":["stdlib","error"],"children":[{"name":"URIError","path":["stdlib","error","urierror"],"children":[]},{"name":"TypeError","path":["stdlib","error","typeerror"],"children":[]},{"name":"SyntaxError","path":["stdlib","error","syntaxerror"],"children":[]},{"name":"ReferenceError","path":["stdlib","error","referenceerror"],"children":[]},{"name":"RangeError","path":["stdlib","error","rangeerror"],"children":[]},{"name":"EvalError","path":["stdlib","error","evalerror"],"children":[]}]},{"name":"Exn","path":["stdlib","exn"],"children":[]},{"name":"Dict","path":["stdlib","dict"],"children":[]},{"name":"Date","path":["stdlib","date"],"children":[{"name":"UTC","path":["stdlib","date","utc"],"children":[]}]},{"name":"DataView","path":["stdlib","dataview"],"children":[]},{"name":"Console","path":["stdlib","console"],"children":[]},{"name":"Bool","path":["stdlib","bool"],"children":[]},{"name":"BigInt","path":["stdlib","bigint"],"children":[]},{"name":"Array","path":["stdlib","array"],"children":[]},{"name":"IntervalId","path":["stdlib","intervalid"],"children":[]},{"name":"TimeoutId","path":["stdlib","timeoutid"],"children":[]}]}} \ No newline at end of file diff --git a/pages/docs/manual/v12.0.0/api.mdx b/pages/docs/manual/v12.0.0/api.mdx index 0fa1a42a2..b1030fcba 100644 --- a/pages/docs/manual/v12.0.0/api.mdx +++ b/pages/docs/manual/v12.0.0/api.mdx @@ -1,14 +1,20 @@ # Overview -## ReScript Core +## Stdlib -[Core](api/core) is ReScript's new standard library. It replaces the complete `Js` module as well as some of the more frequently used modules from `Belt` and is recommended to use with uncurried mode. +[Stdlib](api/stdlib) is ReScript's new standard library. It replaces the complete `Js` module as well as some of the more frequently used modules from `Belt` and is recommended to use with uncurried mode. -In ReScript 11, it is shipped as a separate npm package `@rescript/core` that is added to your project as per the [installation instructions](/docs/manual/next/installation). In future ReScript versions, it will be included with the `rescript` npm package itself. +In ReScript 11, it was shipped as a separate npm package `@rescript/core`. + +Since Rescript 12, it is now included with the `rescript` npm package itself. ## Additional Libraries ReScript ships with these two additional modules in its standard library: -- [Belt](api/belt): immutable collections and extra helpers not available in [Core](api/core). -- [Dom](api/dom): Dom related types and modules. Contains our standardized types used by various userland DOM bindings. \ No newline at end of file +- [Belt](api/belt): immutable collections and extra helpers not available in JavaScript / [Stdlib](api/stdlib). +- [Dom](api/dom): Dom related types and modules. Contains our standardized types used by various userland DOM bindings. + +## Legacy Modules + +The [Js](api/js) module is superseded by [Stdlib](api/stdlib). diff --git a/src/ApiDocs.res b/src/ApiDocs.res index c3be8314b..5f253dcfe 100644 --- a/src/ApiDocs.res +++ b/src/ApiDocs.res @@ -62,7 +62,7 @@ module RightSidebar = { } let title = `${Option.isSome(deprecatedIcon) ? "Deprecated " : ""}` ++ name let result = -
  • +
  • let open_ = - node.path->Array.join("/") === + href === moduleRoute ->Array.slice(~start=0, ~end=Array.length(moduleRoute) - 1) ->Array.join("/") -
    +
    {node.name->React.string} @@ -148,7 +148,7 @@ module SidebarTree = { }}
    | false => -
  • +
  • {node.name->React.string} @@ -172,6 +172,15 @@ module SidebarTree = { ReactEvent.Form.preventDefault(evt) let version = (evt->ReactEvent.Form.target)["value"] let url = Url.parse(router.asPath) + switch url.pagepath[1] { + | Some("core") | Some("stdlib") => + if version < "v12.0.0" { + url.pagepath[1] = "core" + } else { + url.pagepath[1] = "stdlib" + } + | _ => () + } let targetUrl = "/" ++ @@ -184,9 +193,10 @@ module SidebarTree = { + | None => React.null }} @@ -309,21 +319,21 @@ let default = (props: props) => { | Value({name, signature, docstrings, deprecated}) => let code = String.replaceRegExp(signature, /\\n/g, "\n") let slugPrefix = "value-" ++ name - <> +

    {name->React.string}

    - +
    | Type({name, signature, docstrings, deprecated}) => let code = String.replaceRegExp(signature, /\\n/g, "\n") let slugPrefix = "type-" ++ name - <> +

    {name->React.string}

    - +
    } }) diff --git a/src/bindings/Node.res b/src/bindings/Node.res index 44bcd522b..c6133d6ff 100644 --- a/src/bindings/Node.res +++ b/src/bindings/Node.res @@ -35,6 +35,7 @@ module Buffer = { } module ChildProcess = { + type options = {maxBuffer?: float} @module("child_process") - external execSync: string => Buffer.t = "execSync" + external execSync: (string, ~options: options=?) => Buffer.t = "execSync" } diff --git a/src/common/Constants.res b/src/common/Constants.res index 80af04d4f..cb69e1547 100644 --- a/src/common/Constants.res +++ b/src/common/Constants.res @@ -25,7 +25,8 @@ let nextVersion = ? None : Some(versions.next, versions.next->Semver.tryGetMajorString) -let coreVersions = [latestVersion] +let stdlibVersions = + versions.latest === "v11.0.0" ? [latestVersion] : [("v11.0.0", "v11"), latestVersion] let allReactVersions = [("latest", "v0.12.0"), ("v0.11.0", "v0.11.0"), ("v0.10.0", "v0.10.0")] diff --git a/src/components/VersionSelect.res b/src/components/VersionSelect.res index 696f064a9..e6ce5d0d4 100644 --- a/src/components/VersionSelect.res +++ b/src/components/VersionSelect.res @@ -26,7 +26,10 @@ let make = ( <> - + {switch availableVersions { + | [] => React.null + | _ => + }} }} {React.array(children)} diff --git a/src/layouts/ApiOverviewLayout.res b/src/layouts/ApiOverviewLayout.res index f24b183cc..ebfc2087e 100644 --- a/src/layouts/ApiOverviewLayout.res +++ b/src/layouts/ApiOverviewLayout.res @@ -5,7 +5,11 @@ let makeCategories: string => array = version => [ name: "", items: [ {name: "Overview", href: `/docs/manual/${version}/api`}, - {name: "Core", href: `/docs/manual/${version}/api/core`}, + if version >= "v12.0.0" { + {name: "Stdlib", href: `/docs/manual/${version}/api/stdlib`} + } else { + {name: "Core", href: `/docs/manual/${version}/api/core`} + }, ], }, {