provide more helpful error message when running an improperly-typed term - #1814
Merged
aryairani merged 2 commits intoFeb 25, 2021
Merged
Conversation
Member
|
This is great, a nice little usability improvement! Can you add yourself to |
This was referenced Mar 11, 2021
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
Endeavoring to fix #1747 - see the output of the new transcript for what the new error message is and when it is shown.
Implementation notes
Instead of
HandleInput.addRunMainjust returning aMaybe(I could do it, or I couldn't), it now returns a type that disambiguates whether it couldn't due to not being able to find the term, or whether the term has a bad type. That new case is subsequently handled in the error reporting moduleOutputMessages.hsto produce the new error message.Interesting/controversial decisions
Test coverage
I've included a new transcript
run.mdthat attempts torunproperly-typed, improperly-typed, and nonexistent terms to show the differences in behavior / error messages.Loose ends
run- fails to find the function to run #1800, and I've confirmed that without my changes thatrunnablefunction still fails to be found. I wanted to put this PR up optimistically to gather feedback while that issue is resolved.Execute.hsto provide this distinction (partly due to my lack of familiarity of what experience that file is part of..)In general, this being my first contribution, I'm not confident at all that the changes I've provided are idiomatic / sufficient. I'd be more than happy to add tests, move code, rename types. Thank you!