feat(parsing): preserve whitespaces on Lam #1980
Merged
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.
This partially solves #1978
Lam
is ready. I caught the whitespace that I thought would make more sense to write comments. Check the haddocks for more information. I did not catch the whitespace between a_lambda
and an open parenthesis because I don't see why would somebody write comments there, but if you want me to handle the whitespace there as well please let me know.An example of running this would be to:
Regarding
Pi
, I noticed that there are two possible ways of creating it:but I feel that using
FunctionBinding
on theA -> B
case isn't right becauseFunctionBinding
should be used for the later caseI see we can do the following to tackle this:
PiFree
, that corresponds toA -> B
. The counterpart of this approach is that we need to handle carefully other usages, although it's not so complicatedEither (NoBinding s a) (FunctionBinding s a)
on the second parameter of thePi
constructor and use theLeft
constructor for theA -> B
.NoBinding
would include the prefix whitespace andA
, although I don't need to handle that case on the jump-to-definition context.Nothing
on theFunctionBinding
'sMaybe Src
s on theA -> B
.Since it looks like preserving whitespace for
Pi
seems like more work than what I thought, I can add it in another PR to keep this one small