diff --git a/pages/docs/manual/latest/function.mdx b/pages/docs/manual/latest/function.mdx index f4b234e36..c9bac1eb7 100644 --- a/pages/docs/manual/latest/function.mdx +++ b/pages/docs/manual/latest/function.mdx @@ -409,6 +409,27 @@ add(1, 2); +If you need to call a curried function with a single unit `()` argument, you can use the `ignore()` function: + + + +```res example +let echo = (. a) => a + +echo(. ignore()) +``` + +```js +function echo(a) { + return a; +} + +echo(undefined); +``` + + + + If you write down the uncurried function's type, you'll add a dot there as well. **Note**: both the declaration site and the call site need to have the uncurry annotation. That's part of the guarantee/requirement.