error-message-catalog icon indicating copy to clipboard operation
error-message-catalog copied to clipboard

Possible improvement for misuse of (::) operator

Open gamebox opened this issue 8 years ago • 0 comments

When getting started, a user may incorrectly use the (::) operator like List.append, trying to join two lists. The error messaging is very vague, and may cause as much confusion as it diffuses. See the following SSCCE:

See on ellie

Maybe when we see a situation where a function or operator is of the shape:

a -> Collection a -> Collection a

And the left side is Collection a, we can emit an error like

This operator looks to be looking for a single element of type a for the left side, but you are passing a Collection of type a.

Either the left side should be:

a

Or the right side should be:

Collection (Collection a)

Is this possible, or does it make sense?

gamebox avatar Nov 25 '17 18:11 gamebox