-
Notifications
You must be signed in to change notification settings - Fork 28
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
Support for GADTs #195
Draft
Meowcolm024
wants to merge
95
commits into
hkust-taco:mlscript
Choose a base branch
from
Meowcolm024:local-gadt
base: mlscript
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+9,070
−2,239
Draft
Support for GADTs #195
Changes from 1 commit
Commits
Show all changes
95 commits
Select commit
Hold shift + click to select a range
c4aa6d1
WIP Start implementing branch-local reasoning
LPTK 261f9e0
refactor
Meowcolm024 816ea20
naive type member lookup
Meowcolm024 e7025e2
WIP type member partially works
Meowcolm024 6b2334e
WIP fixed name mangling ing TypeHelpers
Meowcolm024 5f18602
WIP refactor
Meowcolm024 b7e1bc7
TODO wildcard type and refinement
Meowcolm024 55eaa2a
added `as` keyword
Meowcolm024 270a859
WIP wildcard types
Meowcolm024 e201914
WIP
Meowcolm024 9566694
WIP
Meowcolm024 957b966
WIP added :GADTs flag
Meowcolm024 88b1af4
added GADT examples
Meowcolm024 ce83f9b
WIP update examples
Meowcolm024 cdf0f04
added some GADT examples
Meowcolm024 37a9de7
updated some examples and added some notes
Meowcolm024 570f3d7
WIP update tests
Meowcolm024 cb89a08
WIP
Meowcolm024 5150f53
Add an interesting test
LPTK 28a831c
WIP move cache to ctx
Meowcolm024 aecd07e
Merge branch 'local-gadt' of github.com:Meowcolm024/mlscript into loc…
Meowcolm024 1e5b030
annot to trigger GADTs
Meowcolm024 1e87c13
clean up tests
Meowcolm024 3293b58
Merge remote-tracking branch 'hkust-taco/new-definition-typing' into …
Meowcolm024 a30e27d
clean up
Meowcolm024 a6c5451
fix lift
Meowcolm024 fa04070
add keyword "as" for asc
Meowcolm024 ecfde50
Merge remote-tracking branch 'hkust-taco/new-definition-typing' into …
Meowcolm024 13a0e85
cleanup
Meowcolm024 9f5d9b9
add more test cases
Meowcolm024 53e1352
Merge branch 'new-definition-typing' into local-gadt
Meowcolm024 ac25d4e
small test case change
Meowcolm024 6bfad52
add variance in type members decl
Meowcolm024 3104598
Merge branch 'new-definition-typing' into local-gadt
Meowcolm024 6c5975d
added more tests
Meowcolm024 fbd709f
added some multi param type tests
Meowcolm024 b77b47b
Merge remote-tracking branch 'origin/new-definition-typing' into loca…
Meowcolm024 e7b2c4c
wip
Meowcolm024 9c5e2c5
wip
Meowcolm024 2f193c8
WIP Prepare the grounds for SimpleTypeOrWildcard
LPTK f52774b
Fix bug in extrusion (extruded assigned TV level) and hack around pro…
LPTK 1bb4b2d
wip
Meowcolm024 a017daa
Merge remote-tracking branch 'lptk/local-gadt-wip' into local-gadt-wip
Meowcolm024 61e8319
wip
Meowcolm024 e0c09ca
WIP wildcard
Meowcolm024 7868b3d
add more tests
Meowcolm024 2a633d2
wip: fixed some tests
Meowcolm024 17e8491
Add current type projection unsoundness example
LPTK f0b84c0
Push ascriptions inside branches for better type checking
LPTK 9b73514
fixed parens
Meowcolm024 4f72058
wip err msg
Meowcolm024 80476ef
Minor: remove TODO
LPTK bb437ea
Fix freak condition in freshening
LPTK e4bff8c
Merge branch 'mlscript' into local-gadt (one test now fails)
LPTK dce34e4
Make test green; not sure why it now fails
LPTK 462804a
wip various fixed
Meowcolm024 c6491bd
WIP correct polarity/variance treatment of WildcardArg
Meowcolm024 db7f38a
WIP Move towards a correct handling of WildcardArg
LPTK 8ee5a84
Add alias GADT use case
LPTK 4b129aa
various small fixes
Meowcolm024 79e3f0f
change typing of type member alias
Meowcolm024 8defef6
implement parser for type argument bounds
Meowcolm024 05b68c0
small format fix
Meowcolm024 73d970a
WIP added test case similar to the zip one
Meowcolm024 f8784ac
wip change tag checking in <:< for LhsNf
Meowcolm024 0f9e788
wip: self type sig issue
Meowcolm024 7a0353f
WIP early finish some dnfs
Meowcolm024 cf228b0
wip change extr type args
Meowcolm024 4f24921
add prov for wildcard
Meowcolm024 6e6b9a1
WIP refactor wildcard
Meowcolm024 a7e3b94
WIP fix various crashes
Meowcolm024 625fafe
WIP fix standalone wildcard typing
Meowcolm024 3c05aee
wip expand alias issue
Meowcolm024 e13bff7
wip fix pol
Meowcolm024 71d9232
wip fix alias ty arg extursion
Meowcolm024 0b766ce
wip early finish dnf solving for other tags
Meowcolm024 e667617
wip fix extr for alias and updated some tests
Meowcolm024 2b27281
small fix
Meowcolm024 2bc5cf8
simple level indexed extrusion cache
Meowcolm024 d268965
WIP replace incorrect use of mapTargs and avoid level-mismatched cons…
LPTK 031f611
WW
LPTK 95f4cb7
WWW
LPTK 60c4b74
WWW
LPTK ab4b456
WWW
LPTK 27c2354
WWW
LPTK ab2fe6b
WW
LPTK 03044b8
WW fix extruded compare
LPTK 2f636e5
W simplify YC's mess
LPTK 7b89780
WWW trial
LPTK 95a3620
W
LPTK 54ba6ad
W
LPTK db2fb45
Minor
LPTK e24d01e
Merge remote-tracking branch 'origin/mlscript' into local-gadt
Meowcolm024 064f004
add some test cases
Meowcolm024 9ef9425
fix some test cases
Meowcolm024 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -241,7 +241,14 @@ class NormalForms extends TyperDatatypes { self: Typer => | |
case (LhsTop, _) => false | ||
case (LhsRefined(b1, ts1, rt1, trs1), LhsRefined(b2, ts2, rt2, trs2)) => | ||
b2.forall(b2 => b1.exists(_ <:< b2)) && | ||
ts2.forall(ts1) && rt1 <:< rt2 && | ||
ts2.forall { | ||
case sk: SkolemTag => ts1(sk) | ||
case tt: TraitTag => ts1(tt) | ||
case Extruded(pol, sk) => !pol || ts1.exists { // find ? <: bot | ||
case Extruded(true, _) => true | ||
case _ => false | ||
} | ||
} && rt1 <:< rt2 && | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This thing looks very fishy. What is going on here? Why don't we use the normal set functions? |
||
trs2.valuesIterator.forall(tr2 => trs1.valuesIterator.exists(_ <:< tr2)) | ||
} | ||
def isTop: Bool = isInstanceOf[LhsTop.type] | ||
|
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 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
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.
TODO