-
Notifications
You must be signed in to change notification settings - Fork 211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
+ in front of Naturals is not at all natural #2
Comments
Good point. I should pick a different type for the first exercise until the tutorial explains |
Also, to answer your question: yes you do need the |
It does lead to some confusing errors for newbies. #:global-project hephaestus$ echo "1 + 1" | dhall
Use "dhall --explain" for detailed errors
Error: ❰+❱ only works on ❰Natural❱s
1 + 1
(stdin):1:1
#:global-project hephaestus$ echo "1+1" | dhall
Use "dhall --explain" for detailed errors
Error: Not a function
1+1
(stdin):1:1
#:global-project hephaestus$ echo "+1++1" | dhall
Use "dhall --explain" for detailed errors
Error: ❰++❱ only works on ❰Text❱
+1++1
(stdin):1:1
#:global-project hephaestus$ echo "+1+ +1" | dhall
Natural
+2 Not sure what would be better. I'd say to require |
@echatav: So in the first case, the
The contract for error messages is that I can improve the error message for the second case by special-casing the error to notice if the function is an For the third case, I think the error message is clear even without |
I nearly stumbled over the very first exercise because it was not at all clear to me that I need to annotate even naturals with
+
.And the error message thrown is simply:
I’m sure the explicit
+
has some deeper reasons, but do we need it for naturals? If yes, the tutorial should be very clear of this upfront.The text was updated successfully, but these errors were encountered: