Skip to content

Commit a045da6

Browse files
author
github-actions[bot]
committed
Update API docs for v12.0.0-alpha.14
1 parent 7126df0 commit a045da6

File tree

1 file changed

+78
-8
lines changed

1 file changed

+78
-8
lines changed

data/api/api-docs/v12.0.0/stdlib.json

Lines changed: 78 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5525,7 +5525,17 @@
55255525
"docstrings": [
55265526
"`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 ```"
55275527
],
5528-
"signature": "let getExn: result<'a, 'b> => 'a"
5528+
"signature": "let getExn: result<'a, 'b> => 'a",
5529+
"deprecated": "Use 'getOrThrow' instead"
5530+
},
5531+
{
5532+
"id": "Stdlib.Result.getOrThrow",
5533+
"kind": "value",
5534+
"name": "getOrThrow",
5535+
"docstrings": [
5536+
"`getOrThrow(res)`: when `res` is `Ok(n)`, returns `n` when `res` is `Error(m)`, raise an exception\n\n ```res example\n Result.getOrThrow(Result.Ok(42)) == 42\n\n switch Result.getOrThrow(Error(\"Invalid data\")) {\n | exception Not_found => assert(true)\n | _ => assert(false)\n }\n ```"
5537+
],
5538+
"signature": "let getOrThrow: result<'a, 'b> => 'a"
55295539
},
55305540
{
55315541
"id": "Stdlib.Result.mapOr",
@@ -6271,7 +6281,17 @@
62716281
"docstrings": [
62726282
"`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`"
62736283
],
6274-
"signature": "let getExn: (option<'a>, ~message: string=?) => 'a"
6284+
"signature": "let getExn: (option<'a>, ~message: string=?) => 'a",
6285+
"deprecated": "Use `getOrThrow` instead"
6286+
},
6287+
{
6288+
"id": "Stdlib.Option.getOrThrow",
6289+
"kind": "value",
6290+
"name": "getOrThrow",
6291+
"docstrings": [
6292+
"`getOrThrow(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.getOrThrow(Some(3))->assertEqual(3)\n\nswitch Option.getOrThrow(None) {\n| exception _ => assert(true)\n| _ => assert(false)\n}\n\nswitch Option.getOrThrow(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`"
6293+
],
6294+
"signature": "let getOrThrow: (option<'a>, ~message: string=?) => 'a"
62756295
},
62766296
{
62776297
"id": "Stdlib.Option.getUnsafe",
@@ -6754,7 +6774,17 @@
67546774
"docstrings": [
67556775
"`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`"
67566776
],
6757-
"signature": "let getExn: t<'a> => 'a"
6777+
"signature": "let getExn: t<'a> => 'a",
6778+
"deprecated": "Use `getOrThrow` instead"
6779+
},
6780+
{
6781+
"id": "Stdlib.Nullable.getOrThrow",
6782+
"kind": "value",
6783+
"name": "getOrThrow",
6784+
"docstrings": [
6785+
"`getOrThrow(value)` raises an exception if `null` or `undefined`, otherwise returns the value.\n\n```rescript\nswitch Nullable.getOrThrow(%raw(\"'Hello'\")) {\n| exception Invalid_argument(_) => assert(false)\n| value => assertEqual(value, \"Hello\")\n}\n\nswitch Nullable.getOrThrow(%raw(\"null\")) {\n| exception Invalid_argument(_) => assert(true)\n| _ => assert(false)\n}\n\nswitch Nullable.getOrThrow(%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`"
6786+
],
6787+
"signature": "let getOrThrow: t<'a> => 'a"
67586788
},
67596789
{
67606790
"id": "Stdlib.Nullable.getUnsafe",
@@ -6917,9 +6947,19 @@
69176947
"kind": "value",
69186948
"name": "getExn",
69196949
"docstrings": [
6920-
"`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`,"
6950+
"`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`"
69216951
],
6922-
"signature": "let getExn: t<'a> => 'a"
6952+
"signature": "let getExn: t<'a> => 'a",
6953+
"deprecated": "Use `getOrThrow` instead"
6954+
},
6955+
{
6956+
"id": "Stdlib.Null.getOrThrow",
6957+
"kind": "value",
6958+
"name": "getOrThrow",
6959+
"docstrings": [
6960+
"`getOrThrow(value)` raises an exception if `null`, otherwise returns the value.\n\n```rescript\nNull.getOrThrow(Null.make(3))->assertEqual(3)\n\nswitch Null.getOrThrow(%raw(\"'ReScript'\")) {\n| exception Invalid_argument(_) => assert(false)\n| value => assertEqual(value, \"ReScript\")\n}\n\nswitch Null.getOrThrow(%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`"
6961+
],
6962+
"signature": "let getOrThrow: t<'a> => 'a"
69236963
},
69246964
{
69256965
"id": "Stdlib.Null.getUnsafe",
@@ -7366,7 +7406,17 @@
73667406
"docstrings": [
73677407
"`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."
73687408
],
7369-
"signature": "let headExn: list<'a> => 'a"
7409+
"signature": "let headExn: list<'a> => 'a",
7410+
"deprecated": "Use `headOrThrow` instead"
7411+
},
7412+
{
7413+
"id": "Stdlib.List.headOrThrow",
7414+
"kind": "value",
7415+
"name": "headOrThrow",
7416+
"docstrings": [
7417+
"`headOrThrow(list)` same as [`head`](#head).\n\n## Examples\n\n```rescript\nList.headOrThrow(list{1, 2, 3})->assertEqual(1)\n\nswitch List.headOrThrow(list{}) {\n| exception Not_found => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Raises an Error if list is empty."
7418+
],
7419+
"signature": "let headOrThrow: list<'a> => 'a"
73707420
},
73717421
{
73727422
"id": "Stdlib.List.tail",
@@ -7384,7 +7434,17 @@
73847434
"docstrings": [
73857435
"`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."
73867436
],
7387-
"signature": "let tailExn: list<'a> => list<'a>"
7437+
"signature": "let tailExn: list<'a> => list<'a>",
7438+
"deprecated": "Use `tailOrThrow` instead"
7439+
},
7440+
{
7441+
"id": "Stdlib.List.tailOrThrow",
7442+
"kind": "value",
7443+
"name": "tailOrThrow",
7444+
"docstrings": [
7445+
"`tailOrThrow(list)` same as [`tail`](#tail).\n\n## Examples\n\n```rescript\nList.tailOrThrow(list{1, 2, 3})->assertEqual(list{2, 3})\n\nswitch List.tailOrThrow(list{}) {\n| exception Not_found => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Raises an Error if list is empty."
7446+
],
7447+
"signature": "let tailOrThrow: list<'a> => list<'a>"
73887448
},
73897449
{
73907450
"id": "Stdlib.List.add",
@@ -7411,7 +7471,17 @@
74117471
"docstrings": [
74127472
"`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."
74137473
],
7414-
"signature": "let getExn: (list<'a>, int) => 'a"
7474+
"signature": "let getExn: (list<'a>, int) => 'a",
7475+
"deprecated": "Use `getOrThrow` instead"
7476+
},
7477+
{
7478+
"id": "Stdlib.List.getOrThrow",
7479+
"kind": "value",
7480+
"name": "getOrThrow",
7481+
"docstrings": [
7482+
"`getOrThrow(list, index)` same as [`get`](#get).\n\n## Examples\n\n```rescript\nlet abc = list{\"A\", \"B\", \"C\"}\n\nabc\n->List.getOrThrow(1)\n->assertEqual(\"B\")\n\nswitch abc->List.getOrThrow(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."
7483+
],
7484+
"signature": "let getOrThrow: (list<'a>, int) => 'a"
74157485
},
74167486
{
74177487
"id": "Stdlib.List.make",

0 commit comments

Comments
 (0)