You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{"contents": "```rescript\n(Belt.List.t<'a>, 'a => 'b) => Belt.List.t<'b>\n```\n\n\n `map xs f`\n\n **return** the list obtained by applying `f` to each element of `xs`\n\n ```\n map [1;2] (fun x-> x + 1) = [3;4]\n ```\n"}
2
+
{"contents": "```rescript\n(Belt.List.t<'a>, 'a => 'b) => Belt.List.t<'b>\n```\n\n\n Returns a new list with `f` applied to each element of `someList`.\n\n ```res example\n list{1, 2}->Belt.List.map(x => x + 1) // list{3, 4}\n ```\n"}
"documentation": {"kind": "markdown", "value": "\n `makeBy n f`\n\n **return** a list of length `n` with element `i` initialized with `f i`\n\n **return** the empty list if `n` is negative\n\n```\n makeBy 5 (fun i -> i) = [0;1;2;3;4];;\n makeBy 5 (fun i -> i * i) = [0;1;4;9;16];;\n ```\n"}
16
+
"documentation": {"kind": "markdown", "value": "\nReturn a list of length `numItems` with element `i` initialized with `f(i)`.\nReturns an empty list if `numItems` is negative.\n\n```res example\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```\n"}
17
17
}, {
18
18
"label": "make",
19
19
"kind": 12,
20
20
"tags": [],
21
21
"detail": "(int, 'a) => t<'a>",
22
-
"documentation": {"kind": "markdown", "value": "\n `make n v`\n\n **return** a list of length `n` with each element filled with value `v`\n\n **return** the empty list if `n` is negative\n\n ```\n make 3 1 = [1;1;1]\n ```\n"}
22
+
"documentation": {"kind": "markdown", "value": "\n Returns a list of length `numItems` with each element filled with value `v`. Returns an empty list if `numItems` is negative.\n\n ```res example\n Belt.List.make(3, 1) // list{1, 1, 1}\n ```\n"}
"documentation": {"kind": "markdown", "value": " Uncurried version of [mapReverse2](#mapReverse2). "}
29
29
}, {
30
30
"label": "map",
31
31
"kind": 12,
32
32
"tags": [],
33
33
"detail": "(t<'a>, 'a => 'b) => t<'b>",
34
-
"documentation": {"kind": "markdown", "value": "\n `map xs f`\n\n **return** the list obtained by applying `f` to each element of `xs`\n\n ```\n map [1;2] (fun x-> x + 1) = [3;4]\n ```\n"}
34
+
"documentation": {"kind": "markdown", "value": "\n Returns a new list with `f` applied to each element of `someList`.\n\n ```res example\n list{1, 2}->Belt.List.map(x => x + 1) // list{3, 4}\n ```\n"}
35
35
}, {
36
36
"label": "mapWithIndexU",
37
37
"kind": 12,
38
38
"tags": [],
39
39
"detail": "(t<'a>, (. int, 'a) => 'b) => t<'b>",
40
-
"documentation": null
40
+
"documentation": {"kind": "markdown", "value": " Uncurried version of [mapWithIndex](#mapWithIndex). "}
41
41
}, {
42
42
"label": "mapU",
43
43
"kind": 12,
44
44
"tags": [],
45
45
"detail": "(t<'a>, (. 'a) => 'b) => t<'b>",
46
-
"documentation": null
46
+
"documentation": {"kind": "markdown", "value": " Uncurried version of [map](#map). "}
47
47
}, {
48
48
"label": "makeByU",
49
49
"kind": 12,
50
50
"tags": [],
51
51
"detail": "(int, (. int) => 'a) => t<'a>",
52
-
"documentation": null
52
+
"documentation": {"kind": "markdown", "value": " Uncurried version of [makeBy](#makeBy) "}
"documentation": {"kind": "markdown", "value": "\n Equivalent to: `zipBy(xs, ys, f)->reverse`\n\n ```res example\n\n Belt.List.mapReverse2(list{1, 2, 3}, list{1, 2}, (a, b) => a + b) // list{4, 2}\n ```\n"}
59
59
}, {
60
60
"label": "mapWithIndex",
61
61
"kind": 12,
62
62
"tags": [],
63
63
"detail": "(t<'a>, (int, 'a) => 'b) => t<'b>",
64
-
"documentation": {"kind": "markdown", "value": "\n `mapWithIndex xs f` applies `f` to each element of `xs`. Function `f` takes two arguments:\n the index starting from 0 and the element from `xs`.\n\n ```\n mapWithIndex [1;2;3] (fun i x -> i + x) =\n [0 + 1; 1 + 2; 2 + 3 ]\n ```\n"}
64
+
"documentation": {"kind": "markdown", "value": "\n Applies `f` to each element of `someList`.\n Function `f` takes two arguments:the index starting from 0 and the element from `someList`, in that order.\n\n ```res example\n list{1, 2, 3}->Belt.List.mapWithIndex((index, x) => index + x) // list{1, 3, 5}\n ```\n"}
65
65
}, {
66
66
"label": "mapReverseU",
67
67
"kind": 12,
68
68
"tags": [],
69
69
"detail": "(t<'a>, (. 'a) => 'b) => t<'b>",
70
-
"documentation": null
70
+
"documentation": {"kind": "markdown", "value": " Uncurried version of [mapReverse](#mapReverse). "}
71
71
}]
72
72
73
73
Complete src/Completion.res 3:9
@@ -385,13 +385,13 @@ Completable: Cpath array->m
385
385
"kind": 12,
386
386
"tags": [],
387
387
"detail": "(t<'a>, ('a, int) => 'b) => t<'b>",
388
-
"documentation": null
388
+
"documentation": {"kind": "markdown", "value": "\nApplies the function (the second argument) to each item in the array, returning\na new array. The function acceps two arguments: an item from the array and its\nindex number. The result array does not have to have elements of the same type\nas 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```res example\n// multiply each item in array by its position\nlet product = (item, index) => item * index\nJs.Array2.mapi([10, 11, 12], product) == [0, 11, 24]\n```\n"}
389
389
}, {
390
390
"label": "Js.Array2.map",
391
391
"kind": 12,
392
392
"tags": [],
393
393
"detail": "(t<'a>, 'a => 'b) => t<'b>",
394
-
"documentation": null
394
+
"documentation": {"kind": "markdown", "value": "\nApplies the function (the second argument) to each item in the array, returning\na new array. The result array does not have to have elements of the same type\nas 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```res example\nJs.Array2.map([12, 4, 8], x => x * x) == [144, 16, 64]\nJs.Array2.map([\"animal\", \"vegetable\", \"mineral\"], Js.String.length) == [6, 9, 7]\n```\n"}
"documentation": {"kind": "markdown", "value": "\n`toUpperCasestr` converts `str` to upper case using the locale-insensitive case mappings in the Unicode Character Database. Notice that the conversion can expand the number of letters in the result; for example the German `ß` capitalizes to two `S`es in a row.\n\n ```\n toUpperCase\"abc\" = \"ABC\";;\n toUpperCase {js|Straße|js} = {js|STRASSE|js};;\n toLowerCase {js|πς|js} = {js|ΠΣ|js};;\n ```\n"}
405
+
"documentation": {"kind": "markdown", "value": "\n`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.\n\nSee [`String.toUpperCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toUpperCase)\non MDN.\n\n```res example\nJs.String2.toUpperCase(\"abc\") == \"ABC\"\nJs.String2.toUpperCase(`Straße`) == `STRASSE`\nJs.String2.toUpperCase(`πς`) == `ΠΣ`\n```\n"}
"documentation": {"kind": "markdown", "value": "\n `eq optValue1 optvalue2 predicate`\n\n Evaluates two optional values for equality with respect to a predicate function.\n\n If both `optValue1` and `optValue2` are `None`, returns `true`.\n\n If one of the arguments is `Somevalue` and the other is `None`, returns`false`\n\n If arguments are `Somevalue1` and `Somevalue2`, returns the result of`predicatevalue1 value2`;\n the `predicate` function must return a `bool`\n\n ```\n let clockEqual = (fun a b -> a mod 12 = b mod 12);;\neq (Some 3) (Some15) clockEqual = true;;\n eq(Some 3) None clockEqual = false;;\n eqNone (Some 3) clockEqual = false;;\n eqNone None clockEqual = true;;\n ```\n"}
422
+
"documentation": {"kind": "markdown", "value": "\n Evaluates two optional values for equality with respect to a predicate\nfunction. If both `optValue1` and `optValue2` are `None`, returns `true`.\n If one of the arguments is `Some(value)` and the other is `None`, returns\n `false`.\n\n If arguments are `Some(value1)` and `Some(value2)`, returns the result of\n `predicate(value1, value2)`; the predicate function must return a bool.\n\n ```res example\n let clockEqual = (a, b) => mod(a, 12) == mod(b, 12)\n\nopen Belt.Option\n\n eq(Some(3), Some(15), clockEqual) /* true */\n\n eq(Some(3), None, clockEqual) /* false */\n\n eq(None, Some(3), clockEqual) /* false */\n\n eq(None, None, clockEqual) /* true */\n ```\n"}
"documentation": {"kind": "markdown", "value": "\n `unsafeGet dict key` return the value if the `key` exists,\n otherwise an **undefined** value is returned. Must be used only\n when the existence of a key is certain. (i.e. when having called `keys`\n function previously.\n\n```\n Array.iter (fun key -> Js.log (Js_dict.unsafeGet dic key)) (Js_dict.keys dict)\n ```\n"}
454
+
"documentation": {"kind": "markdown", "value": "\n`Js.Dict.unsafeGet(key)` returns the value if the key exists,otherwise an `undefined` value is returned. Use this onlywhen you are sure the key exists (i.e. when having used the `keys()` function to check that the key is valid).\n\n```res example\nJs.Dict.unsafeGet(ages, \"Fred\") == 49\nJs.Dict.unsafeGet(ages, \"Paul\") // returns undefined\n```\n"}
"documentation": {"kind": "markdown", "value": "value of this type can be [undefined], [null] or ['a]\n this type is the same as type [t] n {!Null_undefined} "}
774
+
"documentation": {"kind": "markdown", "value": "\n A value of this type can be undefined, null or 'a. This type is equivalent to Js.Null_undefined.t.\n"}
775
775
}, {
776
776
"label": "null",
777
777
"kind": 22,
778
778
"tags": [],
779
779
"detail": "type null<+'a>",
780
-
"documentation": {"kind": "markdown", "value": " nullable, value of this type can be either [null] or ['a]\n this type is the same as type [t] in {!Null}\n"}
780
+
"documentation": {"kind": "markdown", "value": "\n Nullable value of this type can be either null or 'a. This type is equivalent to Js.Null.t.\n"}
"documentation": {"kind": "markdown", "value": "\nApplies the function (the second argument) to each item in the array, returning\na new array. The function acceps two arguments: an item from the array and its\nindex number. The result array does not have to have elements of the same type\nas 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```res example\n// multiply each item in array by its position\nlet product = (item, index) => item * index\nJs.Array2.mapi([10, 11, 12], product) == [0, 11, 24]\n```\n"}
1513
1507
}, {
1514
1508
"label": "Array2.map",
1515
1509
"kind": 12,
1516
1510
"tags": [],
1517
1511
"detail": "(t<'a>, 'a => 'b) => t<'b>",
1518
-
"documentation": null
1512
+
"documentation": {"kind": "markdown", "value": "\nApplies the function (the second argument) to each item in the array, returning\na new array. The result array does not have to have elements of the same type\nas 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```res example\nJs.Array2.map([12, 4, 8], x => x * x) == [144, 16, 64]\nJs.Array2.map([\"animal\", \"vegetable\", \"mineral\"], Js.String.length) == [6, 9, 7]\n```\n"}
Copy file name to clipboardExpand all lines: analysis/tests/src/expected/Definition.res.txt
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ Hover src/Definition.res 14:14
8
8
{"contents": "```rescript\n('a => 'b, list<'a>) => list<'b>\n```\n\n [List.map f [a1; ...; an]] applies function [f] to [a1, ..., an],\n and builds the list [[f a1; ...; f an]]\n with the results returned by [f]. Not tail-recursive. "}
9
9
10
10
Hover src/Definition.res 18:14
11
-
{"contents": "```rescript\n(Belt.List.t<'a>, 'a => 'b) => Belt.List.t<'b>\n```\n\n\n `map xs f`\n\n **return** the list obtained by applying `f` to each element of `xs`\n\n ```\n map [1;2] (fun x-> x + 1) = [3;4]\n ```\n"}
11
+
{"contents": "```rescript\n(Belt.List.t<'a>, 'a => 'b) => Belt.List.t<'b>\n```\n\n\n Returns a new list with `f` applied to each element of `someList`.\n\n ```res example\n list{1, 2}->Belt.List.map(x => x + 1) // list{3, 4}\n ```\n"}
0 commit comments