-
Notifications
You must be signed in to change notification settings - Fork 107
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
feat: generalized imports supporting pattern matching and selective field import #3076
Merged
Merged
Changes from 14 commits
Commits
Show all changes
56 commits
Select commit
Hold shift + click to select a range
b46e72a
first shot at #2354
ggreif e6e9915
add test
ggreif 67500bf
improve a bit
ggreif 2d40582
unit grooming
ggreif 1556274
cleaner
ggreif 3b120ee
resolve the type error at the access site
ggreif bcf3fcb
resolve the module vs. field of module ambiguity
ggreif 59efd68
thread the module note through
ggreif 957f912
clean up
ggreif a1ee29c
get the module `VarE`'s type right
ggreif 91c3708
cleanup
ggreif 8d7fb3c
make it `'import' <pat_nullary> '='? <text>`
ggreif 8fe6866
pointless
ggreif ddcef0f
also pointless
ggreif f581947
Update src/mo_frontend/parser.mly
ggreif 0eff5af
capture the entire pattern
ggreif 999d654
cleanups
ggreif c32448f
make `comp_unit_of_prog` linear-time
ggreif 58c629c
Revert "pointless"
ggreif ad314b7
Revert "also pointless"
ggreif 2e9df25
use modern syntax
ggreif 7293902
fix repl tests
ggreif 93dcc88
a few dodgy imports
ggreif 1a0a069
accept
ggreif e72ce22
more failure modes
ggreif d43c7ab
ignore explicit imports for now
ggreif 3669465
ocamlformat
ggreif 6efb5f6
mention explicit imports
ggreif b109d6d
typo
ggreif 4c94e00
teach IR typechecker to reject refutable import patterns
ggreif 1eef8dc
document the new syntax for imports
ggreif e3ee5f1
show how specific bindings can be imported
ggreif 968cadc
demonstrate renaming on import
ggreif 9c911ca
it is `<pat>` now
ggreif 2c3f4aa
Update doc/modules/language-guide/pages/overview.adoc
ggreif 2503343
DRY
ggreif 0e0b65a
Update src/docs/extract.ml
ggreif 656b48c
Update doc/modules/language-guide/pages/language-manual.adoc
ggreif 9dc287a
Update doc/modules/language-guide/pages/language-manual.adoc
ggreif c59e85a
Update doc/modules/language-guide/pages/language-manual.adoc
ggreif a2aeae4
Update src/ir_def/check_ir.ml
ggreif d0dff31
remove cruft
ggreif 2d9b797
use the coverage checker to reject refutable import patterns
ggreif 37b2838
Update doc/modules/language-guide/pages/language-manual.adoc
ggreif c763ff8
Update src/ir_def/check_ir.ml
ggreif feec77b
back
ggreif 988c27f
forgotten
ggreif c98c798
add example
ggreif a3ac786
ooops
ggreif 2ae3cbb
Update doc/modules/language-guide/pages/language-manual.adoc
ggreif 3e8226c
Update language-manual.adoc
ggreif b5ed7d0
reindent
ggreif 1ddcf93
tweak again
ggreif 95a93a8
Merge branch 'master' into gabor/deconstruct-import
ggreif ca01c14
move an item
ggreif af6941a
demonstrate that actor methods cannot be imported explicitly
ggreif 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
This file contains 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 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 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 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 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 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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { cons; nil } = "lib/ListM"; | ||
|
||
//type stack = List<Int>; | ||
let s = cons(1, nil()); | ||
let u = cons<Int>(2, nil<Int>()); |
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.
Is there any reason this isn't just
<pat>
as forlet
?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.
We don't want
(?(#foo))
here, do we?<pat>
just doesn't have any sensible use-case in this place.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.
Yes, but I don't think we should enforce typing properties using the grammar.
Also, it keeps the grammar closer to the informal language reference.
Plus, you might want a type annotation on the pattern without having to parenthesize it.
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.
Can I do this tomorrow in a new PR? I am totally burnt out, sorry.
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.
Of course.
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.
Tomorrow is saturday. Monday!
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.
It doesn't work: #3076 (comment)