-
Notifications
You must be signed in to change notification settings - Fork 127
WIP: first stab at 2nd class modules with type components #175
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
Merged
Merged
Changes from 12 commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
c6a62b8
first stab at 2nd class modules with type components
crusso b038fd0
fix path bugs
crusso 5637f0b
revamp typechecker to deal with nested modules
crusso 8217fd1
revamp infer_dec_valdecs to reconstruct entire scope
crusso d0d9bd5
test separation of type/value namespaces
crusso c0132b5
remove debug code; add test module3.as test and refresh expected test…
crusso c0594e1
remove debug again (really, this time)
crusso fccc75b
merget with master, builds but fails tests
crusso 1f80761
merged with master, builds but fails tests
crusso 5254cd3
got it working, but needs fixing
crusso c4e2b8a
working modules (but not the implementation I want)
crusso d4e7239
added a sample
crusso c7a839e
merge with master
crusso ef5eb80
Update samples/modules.as
ggreif 6be253b
Update samples/modules.as
ggreif ac55b62
merge with master
crusso 2427f27
Merge branch 'master' into crusso/modules
crusso 047e6a9
implement importing sequence of decs as module binding, supporting ty…
crusso 0873633
cleanup infer_path
crusso fb59472
add List Library sample; using import
crusso 420badd
update test
crusso b95247b
Merge branch 'master' into crusso/modules
crusso 9a44650
Merge branch 'master' into crusso/modules; handporting necessary chan…
crusso a5b64e7
address (some) of Andreas code review
crusso 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 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| module Collections = { | ||
| module List = { | ||
| type t<T> = ?(T, t<T>); | ||
| func nil<T>() : t<T> = null; | ||
|
crusso marked this conversation as resolved.
Outdated
|
||
| func cons<T>(x : T, l : t<T>) : t<T> = ?(x, l); | ||
|
crusso marked this conversation as resolved.
Outdated
|
||
| }; | ||
| }; | ||
|
|
||
| type Stack = Collections.List.t<Int>; | ||
|
|
||
| func push(x : Int, s : Stack) : Stack = Collections.List.cons<Int>(x, s); | ||
|
|
||
| let empty = Collections.List.nil<Int>(); | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| -- Checking modules.as: | ||
| type Stack = t<Int> | ||
| type t<T> = ?(T, t<T>) | ||
| let Collections : module {List : module {type t<T> = ?(T, t<T>); cons : <T>(T, t<T>) -> t<T>; nil : <T>() -> t<T>}} | ||
| let empty : ?(Int, t<Int>) | ||
| let push : (Int, Stack) -> Stack | ||
| -- Interpreting modules.as: | ||
| nil() | ||
| <= null | ||
| -- Finished modules.as: | ||
| let Collections : module {List : module {type t<T> = ?(T, t<T>); cons : <T>(T, t<T>) -> t<T>; nil : <T>() -> t<T>}} = {List = {cons = func; nil = func}} | ||
| let empty : ?(Int, t<Int>) = null | ||
| let push : (Int, Stack) -> Stack = func | ||
|
|
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
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.
Uh oh!
There was an error while loading. Please reload this page.