Skip to content

Commit d630038

Browse files
author
github-actions[bot]
committed
Update API docs for v12.0.0-beta.6
1 parent f70031c commit d630038

File tree

1 file changed

+65
-2
lines changed

1 file changed

+65
-2
lines changed

data/api/v12.0.0/stdlib.json

Lines changed: 65 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4151,6 +4151,15 @@
41514151
],
41524152
"signature": "let size: t<'a> => int"
41534153
},
4154+
{
4155+
"id": "Stdlib.Set.isEmpty",
4156+
"kind": "value",
4157+
"name": "isEmpty",
4158+
"docstrings": [
4159+
"`isEmpty(set)` returns `true` if the set has no values, `false` otherwise.\n\n## Examples\n```rescript\nlet emptySet = Set.make()\nemptySet->Set.isEmpty->assertEqual(true)\n\nlet set = Set.make()\nset->Set.add(\"someValue\")\nset->Set.isEmpty->assertEqual(false)\n\n// After clearing the set\nset->Set.clear\nset->Set.isEmpty->assertEqual(true)\n```"
4160+
],
4161+
"signature": "let isEmpty: t<'a> => bool"
4162+
},
41544163
{
41554164
"id": "Stdlib.Set.clear",
41564165
"kind": "value",
@@ -4398,6 +4407,15 @@
43984407
],
43994408
"signature": "let size: t<'k, 'v> => int"
44004409
},
4410+
{
4411+
"id": "Stdlib.Map.isEmpty",
4412+
"kind": "value",
4413+
"name": "isEmpty",
4414+
"docstrings": [
4415+
"`isEmpty(map)` returns `true` if the map has no key/value pairs, `false` otherwise.\n\n## Examples\n```rescript\nlet emptyMap = Map.make()\nemptyMap->Map.isEmpty->assertEqual(true)\n\nlet map = Map.make()\nmap->Map.set(\"someKey\", \"someValue\")\nmap->Map.isEmpty->assertEqual(false)\n\n// After clearing the map\nmap->Map.clear\nmap->Map.isEmpty->assertEqual(true)\n```"
4416+
],
4417+
"signature": "let isEmpty: t<'k, 'v> => bool"
4418+
},
44014419
{
44024420
"id": "Stdlib.Map.clear",
44034421
"kind": "value",
@@ -5344,6 +5362,24 @@
53445362
],
53455363
"signature": "let searchOpt: (string, RegExp.t) => option<int>"
53465364
},
5365+
{
5366+
"id": "Stdlib.String.isEmpty",
5367+
"kind": "value",
5368+
"name": "isEmpty",
5369+
"docstrings": [
5370+
"`isEmpty(str)` returns `true` if the string is empty (has zero length), \n`false` otherwise.\n\n## Examples\n\n```rescript\nString.isEmpty(\"\") == true\nString.isEmpty(\"hello\") == false\nString.isEmpty(\" \") == false\n```"
5371+
],
5372+
"signature": "let isEmpty: string => bool"
5373+
},
5374+
{
5375+
"id": "Stdlib.String.capitalize",
5376+
"kind": "value",
5377+
"name": "capitalize",
5378+
"docstrings": [
5379+
"`capitalize(str)` returns a new string with the first character converted to \nuppercase and the remaining characters unchanged. If the string is empty, \nreturns the empty string.\n\n## Examples\n\n```rescript\nString.capitalize(\"hello\") == \"Hello\"\nString.capitalize(\"HELLO\") == \"HELLO\"\nString.capitalize(\"hello world\") == \"Hello world\"\nString.capitalize(\"\") == \"\"\n```"
5380+
],
5381+
"signature": "let capitalize: string => string"
5382+
},
53475383
{
53485384
"id": "Stdlib.String.slice",
53495385
"kind": "value",
@@ -9327,6 +9363,24 @@
93279363
],
93289364
"signature": "let keysToArray: dict<'a> => array<string>"
93299365
},
9366+
{
9367+
"id": "Stdlib.Dict.size",
9368+
"kind": "value",
9369+
"name": "size",
9370+
"docstrings": [
9371+
"`size(dictionary)` returns the number of key/value pairs in the dictionary.\n\n## Examples\n```rescript\nlet dict = Dict.make()\ndict->Dict.size->assertEqual(0)\n\ndict->Dict.set(\"someKey\", 1)\ndict->Dict.set(\"someKey2\", 2)\ndict->Dict.size->assertEqual(2)\n\n// After deleting a key\ndict->Dict.delete(\"someKey\")\ndict->Dict.size->assertEqual(1)\n```"
9372+
],
9373+
"signature": "let size: dict<'a> => int"
9374+
},
9375+
{
9376+
"id": "Stdlib.Dict.isEmpty",
9377+
"kind": "value",
9378+
"name": "isEmpty",
9379+
"docstrings": [
9380+
"`isEmpty(dictionary)` returns `true` if the dictionary is empty (has no key/value pairs), `false` otherwise.\n\n## Examples\n```rescript\nlet emptyDict = Dict.make()\nemptyDict->Dict.isEmpty->assertEqual(true)\n\nlet dict = Dict.make()\ndict->Dict.set(\"someKey\", 1)\ndict->Dict.isEmpty->assertEqual(false)\n\n// After clearing all keys\ndict->Dict.delete(\"someKey\")\ndict->Dict.isEmpty->assertEqual(true)\n```"
9381+
],
9382+
"signature": "let isEmpty: dict<'a> => bool"
9383+
},
93309384
{
93319385
"id": "Stdlib.Dict.valuesToArray",
93329386
"kind": "value",
@@ -11303,6 +11357,15 @@
1130311357
],
1130411358
"signature": "let length: array<'a> => int"
1130511359
},
11360+
{
11361+
"id": "Stdlib.Array.isEmpty",
11362+
"kind": "value",
11363+
"name": "isEmpty",
11364+
"docstrings": [
11365+
"`isEmpty(array)` returns `true` if the array is empty (has length 0), `false` otherwise.\n\n## Examples\n\n```rescript\n[]->Array.isEmpty->assertEqual(true)\n[1, 2, 3]->Array.isEmpty->assertEqual(false)\n\nlet emptyArray = []\nemptyArray->Array.isEmpty->assertEqual(true)\n\nlet nonEmptyArray = [\"hello\"]\nnonEmptyArray->Array.isEmpty->assertEqual(false)\n```"
11366+
],
11367+
"signature": "let isEmpty: array<'a> => bool"
11368+
},
1130611369
{
1130711370
"id": "Stdlib.Array.copyAllWithin",
1130811371
"kind": "value",
@@ -11785,7 +11848,7 @@
1178511848
"kind": "value",
1178611849
"name": "reduce",
1178711850
"docstrings": [
11788-
"`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) == 10\n\nArray.reduce([\"a\", \"b\", \"c\", \"d\"], \"\", (a, b) => a ++ b) == \"abcd\"\n\n[1, 2, 3]->Array.reduce(list{}, List.add) == list{3, 2, 1}\n\nArray.reduce([], list{}, List.add) == list{}\n```"
11851+
"`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) == 10\n\nArray.reduce([\"a\", \"b\", \"c\", \"d\"], \"\", (a, b) => a ++ b) == \"abcd\"\n\n[1, 2, 3]->Array.reduce(list{}, List.add) == list{3, 2, 1}\n\nArray.reduce([], list{}, List.add) == list{}\n```"
1178911852
],
1179011853
"signature": "let reduce: (array<'a>, 'b, ('b, 'a) => 'b) => 'b"
1179111854
},
@@ -11794,7 +11857,7 @@
1179411857
"kind": "value",
1179511858
"name": "reduceWithIndex",
1179611859
"docstrings": [
11797-
"`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) == 16\n\nArray.reduceWithIndex([1, 2, 3], list{}, (acc, v, i) => list{v + i, ...acc}) == list{5, 3, 1}\n\nArray.reduceWithIndex([], list{}, (acc, v, i) => list{v + i, ...acc}) == list{}\n```"
11860+
"`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) == 16\n\nArray.reduceWithIndex([1, 2, 3], list{}, (acc, v, i) => list{v + i, ...acc}) == list{5, 3, 1}\n\nArray.reduceWithIndex([], list{}, (acc, v, i) => list{v + i, ...acc}) == list{}\n```"
1179811861
],
1179911862
"signature": "let reduceWithIndex: (array<'a>, 'b, ('b, 'a, int) => 'b) => 'b"
1180011863
},

0 commit comments

Comments
 (0)