Stream: beginners

Topic: ✔ expects 1 argument, but it got only 1


view this post on Zulip Michał Łępicki (Oct 16 2022 at 12:34):

Any idea what could have gone wrong here?

This function expects 1 argument, but it got only 1:

10│      Task.attempt ((File.readUtf8 (Path.fromStr "../../1")) \result ->
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

view this post on Zulip Michał Łępicki (Oct 16 2022 at 12:39):

I had an unnecessary set of parens around all arguments for Task.attempt, but the error was confusing

view this post on Zulip Folkert de Vries (Oct 16 2022 at 12:41):

hah, that must parse incorrectly somehow

view this post on Zulip Richard Feldman (Oct 16 2022 at 13:40):

would you mind opening an issue for this?

view this post on Zulip Michał Łępicki (Oct 16 2022 at 13:57):

Opened issue #4335

view this post on Zulip Notification Bot (Oct 16 2022 at 14:33):

Michał Łępicki has marked this topic as resolved.

view this post on Zulip Luke Boswell (Oct 16 2022 at 19:53):

It looks to me like you have one extra (

view this post on Zulip Brian Carroll (Oct 17 2022 at 07:07):

Luke Boswell said:

It looks to me like you have one extra (

I suspect the closing paren is after the body of the callback function. Otherwise we would have seen a syntax error, rather than a semantic error like this.


Last updated: Jul 06 2025 at 12:14 UTC