-
Notifications
You must be signed in to change notification settings - Fork 847
[WIP, RFC FS-1063] Add let! ... and! ... syntax #5696
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
Closed
Closed
Changes from all commits
Commits
Show all changes
269 commits
Select commit
Hold shift + click to select a range
bd2f21a
List interesting files following match! PR
TD5 9fdd275
Add findings from match! and RFC process
TD5 e82ba1e
Clean up notes about 'letmatch!'
TD5 00f7f2e
Add list of things to explore for let! ... and! ...
TD5 92df296
Ponder `andUse!`-like construct
TD5 5753505
Sketch shonky and! addition to AST
TD5 dc097e2
Sketch shonky lexing and parsing for and!
TD5 5125e44
Comment on and! being its own expression type
TD5 e718b12
Note that and!-sequences are like lists
TD5 670c97a
Add detail about modeling and!s as a list
TD5 bf38ca2
Revert "Sketch shonky lexing and parsing for and!"
TD5 e59e9c3
Revert "Sketch shonky and! addition to AST"
TD5 b58b743
Add alternative and! model in AST
TD5 f26b499
Fix typo in LexFilter comments
TD5 98e8ff4
Mark LexFilter as a key thing to undderstand
TD5 f787bad
Make note to explore role of BINDER after application of lexfilter
TD5 1fb6c76
Add dsymes response about BINDER vs OBINER
TD5 c80fe72
Make and! part of the existing let!/use! expr
TD5 245b3f3
Sketch new parsing and lexing f and! based on existing usages of and
TD5 cd11672
Link to good guides for fslex and fsyacc
TD5 0a22a57
Make pars.fsy build
TD5 7b88781
Fix throwing away of first binding in a let! ... and! .. chain
TD5 77608d7
Try to fix range over and!s
TD5 05222f0
Add note about current high-level questions
TD5 3cee2cf
Note that I think I'll do what let does for ranges for now
TD5 f08d8bd
Structure my EoD thoughts
TD5 a4377c7
Add notes about desugaring let! ... and! ... and the prior art
TD5 fb28e7c
Make note about return for applicatives and yield for alt. applicatives
TD5 082ec6f
Sketch docs for Apply method on a CE builder
TD5 3b40a2c
Note a seemingly undocumented usage of Delay
TD5 86abfda
Define desugaring of apply
TD5 4f84da4
Add operator notation for applicatives desugaring example
TD5 4061267
Note why let! ... and! .. syntax is still useful in a world where the…
TD5 ec41873
Clean up last week's notes
TD5 571b29f
Fill out notes on optimisng desugarings etc
TD5 b4cfa8d
Consider liftA2 vs apply / merge
TD5 d84c9d5
Add notes from f2f discussion with dsyme
TD5 2306813
Compare apply to liftA2
TD5 06fd117
Record decisions from today
TD5 c720b57
Give an example of desugaring with let bindings
TD5 ab3657b
Try to make up to type checking run and stub everything else out with…
TD5 6da5655
Make pars.fs build
TD5 7a934dd
Fix build errors in ServiceLexing and Service ParseTreeWalk
TD5 76a7984
Fix build errors in ServiceUntypedParse
TD5 ec7a4ba
Fix remaining build errors from updating the AST & simplify seq CE us…
TD5 296b505
Add notes on surrounding work to support new feature
TD5 28098ec
Prepare for testing up to and excluding type checking
TD5 d836dba
Fix up SimpleBuilder.fsx
TD5 3122444
Add syntax error msg for and! keyword
TD5 51358d5
Note that we'll want to check both light and verbose syntax
TD5 9e0f937
Add link to docs on different syntaxes
TD5 47ae84f
Add notes on implementing offside rule for and!
TD5 8014dd4
Add clear error msg when we hit the unimplemented and! SeqBlock logic
TD5 40fd692
Point to the spec regarding offside rule
TD5 29e7e78
Add beginnings of offside rule for and!
TD5 426ed0b
Fix offside and! compile issues in parser
TD5 737bac1
Add notes from debugging parsing
TD5 fb5e729
Add braindump when trying to debug mysterious parse fail
TD5 2c56bdb
Move parse fail to and! token by replicating logic for handling and k…
TD5 8a5bdca
Move single defn terminator that follows let! to after all and!s
TD5 7a3238e
Fix broken ref to defn terminator
TD5 e2c9390
Dump more brain-state on parser debugging
TD5 a528ed0
Make at least one example of let! ... and! ... syntax be accepted by …
TD5 4e61ee6
Comment and begin sketching first TypeCheck case for and!
TD5 027aae0
Add first cut of desugaring a particular instance of let! ... and! ...
TD5 af6d91e
Add second and! to example script so I can check ordering of and! bin…
TD5 50ec655
Try to handle var space and add comments for fixing remaining known d…
TD5 13e8186
Refine desugaring of current let! ... and! ... case - a long way to g…
TD5 0bef48e
Add EoD notes to self
TD5 b93258f
Update current project state
TD5 f65173f
Clean up construction of Apply clause in proof-of-concept case
TD5 f2c9c71
Shanpshot status before pulling updates of varSpace outside construct…
TD5 a0d472f
Move varSpace collation up-front
TD5 f1c6847
Add details of recet debugging
TD5 8819168
Make new syntax work under certain conditions (and erroneously doubly…
TD5 13bf70d
Add note on how to fix "double wrapping" of functor
TD5 d7e5ca7
List some more interesting desugaring cases
TD5 fb2386b
Add alternative applicative desugaring
TD5 3d79a28
Add extra notes on semi-groups and active patterns on the LHS
TD5 27035b9
Add desugaring example with normal `let`s interspersed with `yield`s
TD5 4e94f1e
Fix ordering of `let` bindings in applicative CE desugarings
TD5 2b2f75d
Add nested applicative CE & `yield!` example desugarings
TD5 5a98819
Change formatting of today's notes to be clearer (bullets -> headers)
TD5 37ccaab
Show example of `Apply` being used to implement `Map`
TD5 5131035
Touch up whitespace and comments
TD5 5ae38bc
Fix incorrect MD for very strong emphasis
TD5 8755f50
Record my opinion of picking Map vs. Apply vs.Bind in simple CEs
TD5 a40b4e8
Record some key points for when rewriting the desugaring logic
TD5 395336f
Clean up my current shapshot of questions and answers
TD5 504f009
Note that each RHS of a binding should be evaluated at most once
TD5 d349584
Fix desugaring repeatedly evaluating the RHS of bindings
TD5 134575b
Consider the implications for side-effects for various desugarings
TD5 13293a9
Capture argument that facotring out bindings per yield might actually…
TD5 94c4bce
Refine thoughts on what logic should be commonised/duplicated in let!…
TD5 67d03ae
Add desugaring examples for commonising and duplicating approaches to…
TD5 08c6457
Add another option: ban yield inside a let! ... and! ...
TD5 4f7b311
Add some more arguments around possible desugarings
TD5 9d5b591
Make the "duplication" approach more internally consistent
TD5 17f66f1
Appeal to example with loops as prior art for the commising vs. dupli…
TD5 3c1271d
Make the potential side-effects more clear in my examples
TD5 3dd69dd
Add note on `use!`
TD5 16a82c4
Fix let location in desugaring
TD5 d2bb47c
Record @Nick's suggestions and contributions after our discussion
TD5 0ddb19f
Make `let`s slightly more interesting in @Nick's example
TD5 8c3fb51
Clean up comments on Nick's example
TD5 e39ddc5
Fix mistakes in `let! ... and! ...` desugaring
TD5 b5c9e05
Give an example of using `yield` when `Bind` is not implemented
TD5 1666c0a
Add some more comments around new `Apply` syntax
TD5 d401588
Add note on syntax for calling a "wrapped" function
TD5 cbc0f80
Snapshot before separating applies from lambdas
TD5 d48cde9
Separate applies from lambdas
TD5 244aec2
Keep Return along side its expr
TD5 9da6da9
Change creation of match lambdas to happen immediately
TD5 7dc2916
Clean up creation of match lambdas
TD5 f3af277
Make desugaring work for SimpleBuilder.fsx
TD5 7ebe676
Make SimpleBuilder.fsx show off None code path and pattern maching on…
TD5 190674c
Remove bind from builder in SimpleBuilder.fsx to prove it is not needed
TD5 490bb93
Add example let binding inside a return in SimpleBuilder.fsx
TD5 3de3c3d
Make let-bound value in the return actually get used in example CE
TD5 9a303d5
Remove hacky debug printing
TD5 54a9c37
Update Log.md with progress and next steps
TD5 12eca83
Add note about considering moving requirement for `return` after `let…
TD5 66f905d
Add `use! ... anduse! ...` TODO to list
TD5 84363ce
Add first cut for a desugaring of `use! ... anduse! ...`
TD5 29a409d
Add like to scott w's trace builder example
TD5 3209f98
Enhance SimpleBuilder.fsx to show type checking bug
TD5 d2a795a
Add more explicit typings
TD5 a5978e3
Move Apply calls inside translation
TD5 ff11395
Move everything but expr inside return into translation. Broken becau…
TD5 3b4da1d
Move Return back outside this round of translation - I think everythi…
TD5 7dae6d2
Move Return back inside this round of translation, but replace CE key…
TD5 875b900
Fix naming of unused value
TD5 c06c1d7
Add missing check for a Return impl. on the builder
TD5 6a7e80d
Add what I think should be the desugaring of the most simple example,…
TD5 8f2c5dc
Set up type checker for more detailed debugging of desugarings
TD5 7e566e0
Sketch alternative applicatives example
TD5 f75d043
Show example of an alternative applicative with no Bind in sight!
TD5 9e695f6
Give example of mixed inline and bound alternative applicatives
TD5 5f29c47
Make the quux an example of loads of nested stuff for an alternative …
TD5 3a2fd42
Wrap quux example in comments
TD5 8e222ff
Add example of `and! _ = ...` working
TD5 35779a8
Add notes about use! and yield!
TD5 9d2a2d3
Refine in light of feedback
TD5 9d9921b
Fix spelling mistakes etc
TD5 8f2b0e5
Clean up after additional feedback
TD5 afbaafb
Merge branch 'master' into master
TD5 7944098
Delete Log.md
TD5 0171c5d
Add note about order of args to Apply - be consistent with bind, or w…
TD5 1df37ae
Merge branch 'master' of https://github.com/TD5/visualfsharp
TD5 706db99
Fix bad merge
TD5 3bc18fa
Update xlf
TD5 890567e
Sketch out desugaring of use! ... anduse! ... to builder.MapUsing(...)
TD5 f976ff8
Update example to flush out issues in desugaring - probably varSpace
TD5 57ebdfa
Remove varSpace and trans from let! ... and! ... / use! ... anduse! .…
TD5 3ae17d1
Fix up SimpleBuilder to not introduce delay (mainly becaue it has the…
TD5 8133003
Add note to remove call to mkSourceExpr for applicative CEs
TD5 dd27210
Add logging to check order of events for disposal
TD5 120e024
Move `builder.MapUsing` calls inside match lambdas
TD5 6a4ea59
Sketch out an applicative form of Eventually
TD5 a6de7f3
Remove old debugging failwith and comments
TD5 6b6c344
Remove debug printfns and comments
TD5 4a61eaf
Create new error message for applicative CEs that who body isn't an i…
TD5 d49142c
Remove unneeded debug printfn
TD5 f1d3ed7
Add more specific error for pattern matching on the LHS of a use! ...…
TD5 06aa8f0
Sketch new error msg tests for applicative CEs
TD5 56bd67b
Add new applicative CE error messages to FSharp.Compiler.Private
TD5 34b1392
Add new applicative CE tests to main test.lst
TD5 b845f52
Make new applicative CE error msg tests pass locally
TD5 f88bcce
Sketch unit tests which require support for applicative CEs
TD5 9826ea0
Move happy-path applicative CE tests to their own fsharpqa directory
TD5 9816252
Move happy-path applicative CE tests towards a fsx style
TD5 bd93b04
Make new CE tests closer to existing ones
TD5 4256678
Merge branch 'master' into master
TD5 eb6e16e
Reshuffle new tests in somewhat desparate hopes for a cache miss
TD5 a7832b6
Make new applicative CE tests match FSI output correctly
TD5 53f924b
Merge branch 'master' of https://github.com/TD5/visualfsharp
TD5 e4cb70e
Accept empty ine output by FSI
TD5 408b4cd
Move to less noisy Expects syntax
TD5 c2d2ced
Move new applicative CE tests from scripts to normal source files
TD5 dc6be5f
Make new happy-path applicative CE tests pass locally
TD5 155a350
Move new applicative CE tests aling side existing CE tests
TD5 080f856
Merge branch 'master' of https://github.com/Microsoft/visualfsharp
TD5 fb33b7e
Include and! LHS patterns when searching for idents
TD5 c80c216
Include and! LHS patterns when searching for idents
TD5 284df84
Allow break points at and! seq point bindings
TD5 044a59a
Merge branch 'master' of https://github.com/TD5/visualfsharp
TD5 2fc66d5
Tweak vanilla let! ... and! ... test to show two functors "wrapping" …
TD5 a162c67
Speculatively recover from errors a bit earlier when parsing bindings…
TD5 d170402
Merge branch 'master' of https://github.com/Microsoft/visualfsharp
TD5 5819594
Give full completion list when an expected entry cannot be found
TD5 85bf4f6
Don't discard applicative bindings if the later body has an error
TD5 b5010b5
Add TODO note about parse errors somewhere in the middle of an and! s…
TD5 3b1af4a
Comment out older error handling parser case for let! ... and! ... to…
TD5 af288cb
Add legacy language service tests for completion in an applicative CE
TD5 1d0d075
Fix and refine legacy completion tests for applicative CEs
TD5 8fec2ca
Get rid of redundant completion list
TD5 05bc252
rm swap file
TD5 26a5e10
Remove experimental script
TD5 f6097ee
Fix error message that said "return" was expected. "and!"/"anduse!" a…
TD5 7238ab4
Change order of keywords as they appear in FS3243 to match order they…
TD5 b243d33
Expand on applicative error tests so that they map nicely to the exam…
TD5 e6c4e9e
Add missing test definition and comment
TD5 c4cd688
Give test file names with their descriptions
TD5 383aa5c
Make E_MoreAfterReturn a more plausible error case
TD5 cd1ef5f
Add a new error message for yield instead of return in an applicative CE
TD5 a2c8147
Add custom error messages for applicative computation expressions wit…
TD5 3ab2af8
Fix tests for some examples of common applicative CE mistakes
TD5 bc77c64
Give test file names to make locating failing tests easier
TD5 b690bd1
Add new error message for extra expressions being sequenced after ret…
TD5 f675fb7
Change expected error messages for cases which look more monadic than…
TD5 f2c94c2
'Fix' test by chainging expectation: Case is currently somewhat ambig…
TD5 3850eb4
s/MapUsing/ApplyUsing/
TD5 7864b94
Remove some trailing whitespace
TD5 828ab63
Remove trailing newline - will that satisfy CI?
TD5 c1fef16
Remove trailing whitespace
TD5 89e1e0f
Promote error msgs to buildfromsource
TD5 f9e0866
Merge branch 'master' of https://github.com/Microsoft/visualfsharp
TD5 d588f40
Add test for error msgs for missing builder methods
TD5 39ce20a
Fix tests
TD5 b09776a
Generalise Scope.LetOrUseBang given new syntax
TD5 fc9bb61
Add missed file to generalise Scope.LetOrUseBang
TD5 d2d426e
Pull naming of SynExpr and Scope cases into line
TD5 472d856
Reduce guarantees for VS autocomplete
TD5 802e1ce
Remove toy .fsx file
TD5 fa73455
Remove reference to SimpleBuilder.fsx
TD5 ecad993
Simplify pattern matching using named DU case args
TD5 f640c21
Clean up comments and formatting
TD5 25dced3
Merge branch 'master' of https://github.com/TD5/visualfsharp
TD5 f0e67c9
Use more named DU args to make intent clearer
TD5 5d8e0cc
Use new name for let! ... syntax node
TD5 2ed50a5
Fix more let! ... syntax node rename fallout
TD5 d663cf0
Fix do! using old let! ... stntax node name
TD5 95753df
Tidy comments in TypeChecker.fs
TD5 ebfb8a4
Clean up for comments and code style
TD5 7cb2c73
Add test showing Delay and Run working
TD5 a0f13a9
Test Run and Delay translation separately
TD5 1206821
Fix missing punctuation in comment
TD5 03002cf
Remove old TODO
TD5 062d6ef
Add err msg for yield!/return! instead of return
TD5 96f189b
Capture Bind preceding Apply being accepted
TD5 c90e522
Tidy applicative-after-monad CE test
TD5 0796932
Specualtively reintroduce `let! ... and! ... error` case
TD5 9d9d2e3
Merge branch 'master' of https://github.com/Microsoft/visualfsharp
TD5 63a898d
Add missing autogen'd resources
TD5 db519dd
integrate master
dsyme bdfda97
integrate master
dsyme 7e35e8f
Merge branch 'diag4' into TD5-master
dsyme b26d173
merge master
dsyme 0a95da5
merge master
dsyme bffc110
Merge branch 'master' of http://github.com/Microsoft/visualfsharp int…
dsyme File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
5,853 changes: 5,853 additions & 0 deletions
5,853
src/buildfromsource/FSharp.Compiler.Private/FSComp.fs
Large diffs are not rendered by default.
Oops, something went wrong.
4,419 changes: 4,419 additions & 0 deletions
4,419
src/buildfromsource/FSharp.Compiler.Private/FSComp.resx
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
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
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
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
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
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting, I hadn't considered
anduse!.