roc icon indicating copy to clipboard operation
roc copied to clipboard

WIP better error msg

Open dadhi opened this issue 1 year ago • 1 comments

TL;DR;

The PR adds the usage examples into the error message for TOO FEW ARGS and adjusts the tests.

Explanation

The PR is improving the error message for the too few arguments to a function by adding the examples into the message, specifically in the piping context.

I am learning the Roc language and trying to find analogs from my background (C# and a bit of F#, Java, Scala). Trying the pipe operator to replicate C# LINQ (collection processing), I was confused by the error message:

Roc does not allow functions to be partially applied. Use a closure to
make partial application explicit.

I know what the closure is generally, but what does it mean to make partial application explicit. There are too many arbitrary words glued together with the meaning lost on me, sorry :) And what should I do practically to move on?

So the examples may help me to unblock and illustrate explicit closures/lambdas and partial application. Like this:

    Roc does not allow functions to be partially applied. Use a closure to
    make partial application explicit.

    For example: ["a", "b"] |> \list -> Str.joinWith list ", "

    or simplier: ["a", "b"] |> Str.joinWith ", "

dadhi avatar May 15 '24 12:05 dadhi

Thank you for your contribution! Sometimes PRs end up staying open for a long time without activity, which can make the list of open PRs get long and time-consuming to review. To keep things manageable for reviewers, this bot automatically closes PRs that haven’t had activity in 60 days. This PR hasn’t had activity in 30 days, so it will be automatically closed if there is no more activity in the next 30 days. Keep in mind that PRs marked Closed are not deleted, so no matter what, the PR will still be right here in the repo. You can always access it and reopen it anytime you like!

github-actions[bot] avatar Jul 23 '24 01:07 github-actions[bot]

This PR has no changes. Maybe close?

JRI98 avatar Nov 23 '24 19:11 JRI98