evilsoft / crocks

A collection of well known Algebraic Data Types for your utter enjoyment.
https://crocks.dev
ISC License
1.59k stars 102 forks source link

Rewording Errors #405

Closed bennypowers closed 3 years ago

bennypowers commented 5 years ago

This PR is a WIP, not intended to merge yet. Rather it's intended to demonstrate the direction I intend to head in and to seek review and critique before committing to these changes on a larger scale.

Closes #404

Rationales

These new error messages follow an SVO word order, which is likely to be easier to understand. While more verbose, it is also clearer, explaining that the function argument is the thing that is required to be the ${REQUIRED_THING}

In the case of unary functions I opted for brevity, so not "Unary argument must be..." or "The single argument..." etc.

I opted to capitalize type names like Async and Function, even in the plural case like Function and even for types which don't exist in either JavaScript or Crocks like Integer

I also noticed a few regexps in the tests that were underspecified, and corrected them. No big shakes there, really, but why not.

coveralls commented 5 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling 5ee77220d57b41bce5c75db3b91ddd6672d0f2e1 on error-reword into 7fd28d25c3b7a2822690616de2a178cf3e4de329 on master.

coveralls commented 5 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling bc71c2e7bd53eb78fc3f11d52858a55f4e094d56 on error-reword into 1ff50f7583212f04cd16c7f267d93f55d84da67b on master.

dalefrancis88 commented 5 years ago

I think this is a good direction to go in and a good tone

dalefrancis88 commented 3 years ago

@bennypowers can you think of a reason this was never merged other than a lack of review?

bennypowers commented 3 years ago

nope should still be GTG