johnynek / bosatsu

A python-ish pure and total functional programming language
Apache License 2.0
224 stars 11 forks source link

Improve error messages in DefRecursionCheck, Eval example #1046

Closed johnynek closed 11 months ago

johnynek commented 11 months ago

I wanted to try implementing cats.Eval now that we have polymorphic recursion #1041 .

I couldn't see a way to do it without a poor version of the fuel pattern: promise up front how many recursions you would do at most.

But along the way, I noticed that we are only returning one error message from any branch in the code in DefRecursionCheck, so I implemented a version of the idea in #1044 which allowed me to see all the error messages at once (when they are on parts of the code I was already traversing).

codecov-commenter commented 11 months ago

Codecov Report

Patch coverage: 93.54% and project coverage change: +0.16% :tada:

Comparison is base (7890b7b) 91.81% compared to head (ccab783) 91.97%.

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1046 +/- ## ========================================== + Coverage 91.81% 91.97% +0.16% ========================================== Files 91 92 +1 Lines 9533 9549 +16 Branches 2195 2255 +60 ========================================== + Hits 8753 8783 +30 + Misses 780 766 -14 ``` | [Files Changed](https://app.codecov.io/gh/johnynek/bosatsu/pull/1046?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=P.+Oscar+Boykin) | Coverage Δ | | |---|---|---| | [...in/scala/org/bykn/bosatsu/ParallelViaProduct.scala](https://app.codecov.io/gh/johnynek/bosatsu/pull/1046?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=P.+Oscar+Boykin#diff-Y29yZS9zcmMvbWFpbi9zY2FsYS9vcmcvYnlrbi9ib3NhdHN1L1BhcmFsbGVsVmlhUHJvZHVjdC5zY2FsYQ==) | `85.71% <85.71%> (ø)` | | | [...ain/scala/org/bykn/bosatsu/DefRecursionCheck.scala](https://app.codecov.io/gh/johnynek/bosatsu/pull/1046?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=P.+Oscar+Boykin#diff-Y29yZS9zcmMvbWFpbi9zY2FsYS9vcmcvYnlrbi9ib3NhdHN1L0RlZlJlY3Vyc2lvbkNoZWNrLnNjYWxh) | `97.66% <95.83%> (-0.39%)` | :arrow_down: | ... and [7 files with indirect coverage changes](https://app.codecov.io/gh/johnynek/bosatsu/pull/1046/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=P.+Oscar+Boykin)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.