-
Notifications
You must be signed in to change notification settings - Fork 108
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
Add var
syntax for convenient access to the state effect
#1137
Comments
Generalization, from discussion with @dougalm: How about adding general syntactic sugar for de-denting continuation lambdas? To wit, introduce a
becomes
Then for the
(and if we want more syntactic sugar to make that medicine go down even easier, we can add it). |
I think this would go a long way towards mitigating indentation hell. It's similar in spirit to Haskell's do notation, which turns
which would desugar to
[EDIT] never mind! I just realized that the former (apart from |
Yeah, I agree that would be nice. I think Koka reserves the |
Another case we don't handle yet:
can't be spelled as
because the expression doesn't recognize that it's opening a block. It might be fixable, but it's also not completely clear how important it is, because there is no indentation difference between these two forms anyway. |
Fixes google-research#1137 in spirit, if not precisely as filed (i.e., this implements the generalization in the comments, not the original ask). Also add `Lexer.debug`, leaning on Megaparsec's `dbg`, which actually turns out to be very helpful for debugging the concrete syntax parser.
Also, I noticed that
is legal Dex now. I hereby suggest that it be bad style to use [*] I say "transparently" because one is of course free to implement the list monad using this syntax; I think it's not bad style to write |
As suggested by @apaszke,
would desugar into
The text was updated successfully, but these errors were encountered: