Skip to content

Commit 64a4ab0

Browse files
authored
Update docs api (#894)
* update docs api Core: 1.5.2 Compiler: 11.0_release branch (64dbabdfd) * fix tests
1 parent cc5fbee commit 64a4ab0

File tree

5 files changed

+11
-206
lines changed

5 files changed

+11
-206
lines changed

data/api/latest/belt.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3687,7 +3687,7 @@
36873687
"name": "String",
36883688
"docstrings": [
36893689
"Specialized when value type is `string`, more efficient than the generic type,\nits compare behavior is fixed using the built-in comparison",
3690-
"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`]()"
3690+
"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`]()"
36913691
],
36923692
"items": [
36933693
{
@@ -3867,7 +3867,7 @@
38673867
"kind": "value",
38683868
"name": "every",
38693869
"docstrings": [
3870-
"`every(p, s)` checks if all elements of the set satisfy the predicate `p`.\nOrder unspecified."
3870+
"`every(p, s)` checks if all elements of the set satisfy the predicate `p`. Order\nunspecified."
38713871
],
38723872
"signature": "let every: (t, value => bool) => bool"
38733873
},
@@ -3915,7 +3915,7 @@
39153915
"kind": "value",
39163916
"name": "partition",
39173917
"docstrings": [
3918-
"`partition(p, s)` returns a pair of sets `(s1, s2)`, where\n`s1` is the set of all the elements of `s` that satisfy the\npredicate `p`, and `s2` is the set of all the elements of\n`s` that do not satisfy `p`."
3918+
"`partition(p, s)` returns a pair of sets `(s1, s2)`, where `s1` is the set of\nall the elements of `s` that satisfy the predicate `p`, and `s2` is the set of\nall the elements of `s` that do not satisfy `p`."
39193919
],
39203920
"signature": "let partition: (t, value => bool) => (t, t)"
39213921
},
@@ -3996,7 +3996,7 @@
39963996
"kind": "value",
39973997
"name": "split",
39983998
"docstrings": [
3999-
"`split(x, s)` returns a triple `(l, present, r)`, where\n`l` is the set of elements of `s` that are\nstrictly less than `x`;\n`r` is the set of elements of `s` that are\nstrictly greater than `x`;\n`present` is `false` if `s` contains no element equal to `x`,\nor `true` if `s` contains an element equal to `x`."
3999+
"`split(x, s)` returns a triple `(l, present, r)`, where `l` is the set of\nelements of `s` that are strictly less than `x`;`r` is the set of elements of\n`s` that are strictly greater than `x`; `present` is `false` if `s` contains no\nelement equal to `x`, or `true` if `s` contains an element equal to `x`."
40004000
],
40014001
"signature": "let split: (t, value) => ((t, t), bool)"
40024002
},
@@ -4016,7 +4016,7 @@
40164016
"name": "Int",
40174017
"docstrings": [
40184018
"Specialized when value type is `int`, more efficient than the generic type, its\ncompare behavior is fixed using the built-in comparison",
4019-
"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`]()"
4019+
"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`]()"
40204020
],
40214021
"items": [
40224022
{
@@ -4077,7 +4077,7 @@
40774077
"kind": "value",
40784078
"name": "add",
40794079
"docstrings": [
4080-
"`add(s, x)` if `x` was already in `s`, `s` is returned unchanged."
4080+
"`add(s, x)` If `x` was already in `s`, `s` is returned unchanged."
40814081
],
40824082
"signature": "let add: (t, value) => t"
40834083
},
@@ -4093,7 +4093,7 @@
40934093
"kind": "value",
40944094
"name": "remove",
40954095
"docstrings": [
4096-
"`remove(m, x)` if `x` was not in `m`, `m` is returned reference unchanged."
4096+
"`remove(m, x)` If `x` was not in `m`, `m` is returned reference unchanged."
40974097
],
40984098
"signature": "let remove: (t, value) => t"
40994099
},
@@ -4325,7 +4325,7 @@
43254325
"kind": "value",
43264326
"name": "split",
43274327
"docstrings": [
4328-
"`split(x, s)` returns a triple `(l, present, r)`, where\n`l` is the set of elements of `s` that are\nstrictly less than `x`;\n`r` is the set of elements of `s` that are\nstrictly greater than `x`;\n`present` is `false` if `s` contains no element equal to `x`,\nor `true` if `s` contains an element equal to `x`."
4328+
"`split(x, s)` returns a triple `(l, present, r)`, where `l` is the set of\nelements of `s` that are strictly less than `x`;`r` is the set of elements of\n`s` that are strictly greater than `x`; `present` is `false` if `s` contains no\nelement equal to `x`, or `true` if `s` contains an element equal to `x`."
43294329
],
43304330
"signature": "let split: (t, value) => ((t, t), bool)"
43314331
},

data/api/latest/core.json

Lines changed: 0 additions & 195 deletions
Original file line numberDiff line numberDiff line change
@@ -163,13 +163,6 @@
163163
],
164164
"signature": "let import: 'a => promise<'a>"
165165
},
166-
{
167-
"id": "Core.t",
168-
"kind": "type",
169-
"name": "t",
170-
"docstrings": [],
171-
"signature": "type t<'a> = Js.t<'a>\n constraint 'a = {..}"
172-
},
173166
{
174167
"id": "Core.null",
175168
"kind": "type",
@@ -242,56 +235,6 @@
242235
}
243236
]
244237
},
245-
"core/re/result": {
246-
"id": "Core.Re.Result",
247-
"name": "Result",
248-
"docstrings": [],
249-
"items": [
250-
{
251-
"id": "Core.Re.Result.t",
252-
"kind": "type",
253-
"name": "t",
254-
"docstrings": [
255-
"Type representing the result of a `RegExp` execution."
256-
],
257-
"signature": "type t = array<option<string>>"
258-
},
259-
{
260-
"id": "Core.Re.Result.fullMatch",
261-
"kind": "value",
262-
"name": "fullMatch",
263-
"docstrings": [
264-
"`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 ```"
265-
],
266-
"signature": "let fullMatch: t => string"
267-
},
268-
{
269-
"id": "Core.Re.Result.matches",
270-
"kind": "value",
271-
"name": "matches",
272-
"docstrings": [
273-
"`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 ```"
274-
],
275-
"signature": "let matches: t => array<string>"
276-
},
277-
{
278-
"id": "Core.Re.Result.index",
279-
"kind": "value",
280-
"name": "index",
281-
"docstrings": [],
282-
"signature": "let index: t => int"
283-
},
284-
{
285-
"id": "Core.Re.Result.input",
286-
"kind": "value",
287-
"name": "input",
288-
"docstrings": [
289-
"`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 ```"
290-
],
291-
"signature": "let input: t => string"
292-
}
293-
]
294-
},
295238
"core/intl/segments": {
296239
"id": "Core.Intl.Segments",
297240
"name": "Segments",
@@ -3124,144 +3067,6 @@
31243067
"docstrings": [],
31253068
"items": []
31263069
},
3127-
"core/re": {
3128-
"id": "Core.Re",
3129-
"name": "Re",
3130-
"docstrings": [
3131-
"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."
3132-
],
3133-
"items": [
3134-
{
3135-
"id": "Core.Re.t",
3136-
"kind": "type",
3137-
"name": "t",
3138-
"docstrings": [
3139-
"Type representing an instantiated `RegExp`."
3140-
],
3141-
"signature": "type t = Js.Re.t"
3142-
},
3143-
{
3144-
"id": "Core.Re.fromString",
3145-
"kind": "value",
3146-
"name": "fromString",
3147-
"docstrings": [
3148-
"`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```"
3149-
],
3150-
"signature": "let fromString: string => t"
3151-
},
3152-
{
3153-
"id": "Core.Re.fromStringWithFlags",
3154-
"kind": "value",
3155-
"name": "fromStringWithFlags",
3156-
"docstrings": [
3157-
"`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```"
3158-
],
3159-
"signature": "let fromStringWithFlags: (string, ~flags: string) => t"
3160-
},
3161-
{
3162-
"id": "Core.Re.test",
3163-
"kind": "value",
3164-
"name": "test",
3165-
"docstrings": [
3166-
"`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```"
3167-
],
3168-
"signature": "let test: (t, string) => bool"
3169-
},
3170-
{
3171-
"id": "Core.Re.exec",
3172-
"kind": "value",
3173-
"name": "exec",
3174-
"docstrings": [
3175-
"`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```"
3176-
],
3177-
"signature": "let exec: (t, string) => option<Result.t>"
3178-
},
3179-
{
3180-
"id": "Core.Re.lastIndex",
3181-
"kind": "value",
3182-
"name": "lastIndex",
3183-
"docstrings": [
3184-
"`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```"
3185-
],
3186-
"signature": "let lastIndex: t => int"
3187-
},
3188-
{
3189-
"id": "Core.Re.setLastIndex",
3190-
"kind": "value",
3191-
"name": "setLastIndex",
3192-
"docstrings": [
3193-
"`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```"
3194-
],
3195-
"signature": "let setLastIndex: (t, int) => unit"
3196-
},
3197-
{
3198-
"id": "Core.Re.ignoreCase",
3199-
"kind": "value",
3200-
"name": "ignoreCase",
3201-
"docstrings": [
3202-
"`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```"
3203-
],
3204-
"signature": "let ignoreCase: t => bool"
3205-
},
3206-
{
3207-
"id": "Core.Re.global",
3208-
"kind": "value",
3209-
"name": "global",
3210-
"docstrings": [
3211-
"`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```"
3212-
],
3213-
"signature": "let global: t => bool"
3214-
},
3215-
{
3216-
"id": "Core.Re.multiline",
3217-
"kind": "value",
3218-
"name": "multiline",
3219-
"docstrings": [
3220-
"`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```"
3221-
],
3222-
"signature": "let multiline: t => bool"
3223-
},
3224-
{
3225-
"id": "Core.Re.source",
3226-
"kind": "value",
3227-
"name": "source",
3228-
"docstrings": [
3229-
"`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```"
3230-
],
3231-
"signature": "let source: t => string"
3232-
},
3233-
{
3234-
"id": "Core.Re.sticky",
3235-
"kind": "value",
3236-
"name": "sticky",
3237-
"docstrings": [
3238-
"`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```"
3239-
],
3240-
"signature": "let sticky: t => bool"
3241-
},
3242-
{
3243-
"id": "Core.Re.unicode",
3244-
"kind": "value",
3245-
"name": "unicode",
3246-
"docstrings": [
3247-
"`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```"
3248-
],
3249-
"signature": "let unicode: t => bool"
3250-
}
3251-
]
3252-
},
3253-
"core/internal": {
3254-
"id": "Core.Internal",
3255-
"name": "Internal",
3256-
"docstrings": [],
3257-
"items": []
3258-
},
3259-
"core/mapperrt": {
3260-
"id": "Core.MapperRt",
3261-
"name": "MapperRt",
3262-
"docstrings": [],
3263-
"items": []
3264-
},
32653070
"core/intl": {
32663071
"id": "Core.Intl",
32673072
"name": "Intl",

0 commit comments

Comments
 (0)