|
4151 | 4151 | ],
|
4152 | 4152 | "signature": "let size: t<'a> => int"
|
4153 | 4153 | },
|
| 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 | + }, |
4154 | 4163 | {
|
4155 | 4164 | "id": "Stdlib.Set.clear",
|
4156 | 4165 | "kind": "value",
|
|
4398 | 4407 | ],
|
4399 | 4408 | "signature": "let size: t<'k, 'v> => int"
|
4400 | 4409 | },
|
| 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 | + }, |
4401 | 4419 | {
|
4402 | 4420 | "id": "Stdlib.Map.clear",
|
4403 | 4421 | "kind": "value",
|
|
5344 | 5362 | ],
|
5345 | 5363 | "signature": "let searchOpt: (string, RegExp.t) => option<int>"
|
5346 | 5364 | },
|
| 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 | + }, |
5347 | 5383 | {
|
5348 | 5384 | "id": "Stdlib.String.slice",
|
5349 | 5385 | "kind": "value",
|
|
9327 | 9363 | ],
|
9328 | 9364 | "signature": "let keysToArray: dict<'a> => array<string>"
|
9329 | 9365 | },
|
| 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 | + }, |
9330 | 9384 | {
|
9331 | 9385 | "id": "Stdlib.Dict.valuesToArray",
|
9332 | 9386 | "kind": "value",
|
|
11303 | 11357 | ],
|
11304 | 11358 | "signature": "let length: array<'a> => int"
|
11305 | 11359 | },
|
| 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 | + }, |
11306 | 11369 | {
|
11307 | 11370 | "id": "Stdlib.Array.copyAllWithin",
|
11308 | 11371 | "kind": "value",
|
|
11785 | 11848 | "kind": "value",
|
11786 | 11849 | "name": "reduce",
|
11787 | 11850 | "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```" |
11789 | 11852 | ],
|
11790 | 11853 | "signature": "let reduce: (array<'a>, 'b, ('b, 'a) => 'b) => 'b"
|
11791 | 11854 | },
|
|
11794 | 11857 | "kind": "value",
|
11795 | 11858 | "name": "reduceWithIndex",
|
11796 | 11859 | "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```" |
11798 | 11861 | ],
|
11799 | 11862 | "signature": "let reduceWithIndex: (array<'a>, 'b, ('b, 'a, int) => 'b) => 'b"
|
11800 | 11863 | },
|
|
0 commit comments