We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 2e778c7 + 90d9e5a commit 7b05adeCopy full SHA for 7b05ade
pages/docs/manual/latest/function.mdx
@@ -409,6 +409,27 @@ add(1, 2);
409
410
</CodeTab>
411
412
+If you need to call a curried function with a single unit `()` argument, you can use the `ignore()` function:
413
+
414
+<CodeTab labels={["ReScript", "JS Output"]}>
415
416
+```res example
417
+let echo = (. a) => a
418
419
+echo(. ignore())
420
+```
421
422
+```js
423
+function echo(a) {
424
+ return a;
425
+}
426
427
+echo(undefined);
428
429
430
+</CodeTab>
431
432
433
If you write down the uncurried function's type, you'll add a dot there as well.
434
435
**Note**: both the declaration site and the call site need to have the uncurry annotation. That's part of the guarantee/requirement.
0 commit comments