-
Notifications
You must be signed in to change notification settings - Fork 24
For-Comprehension #879
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
Open
ElieOaks
wants to merge
26
commits into
parapluu:development
Choose a base branch
from
ElieOaks:development
base: development
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.
Open
For-Comprehension #879
Changes from 9 commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
2895d7c
file to try out Encore, and preliminary tests for for-comprehension
ElieOaks 957edcc
Changes to parser to handle the new for-comprehension, toplevel to ad…
ElieOaks ce50299
added funcion to array, further dev. of optimizer, mutable boxes incl…
ElieOaks 97e2549
removed scrap files beofre review PR
ElieOaks 61c15fa
removed translation of for
ElieOaks 979bcb6
changed the names om mutable boxed file names
ElieOaks 8b61939
removed the old named files from git
ElieOaks 067051d
added requirement for functor
ElieOaks 4cb0e56
removed old commented out for-parsing
ElieOaks 17a835d
finally got to the boxing problem
ElieOaks 8a365c9
added another file: TypedDesugaring, which is another pass of the com…
ElieOaks c5204b8
lots of stuff
ElieOaks 0c100a5
for-comprehension works
ElieOaks e2b1f0b
break works
ElieOaks af9141b
writing test cases
ElieOaks 17f1b6b
begnning the clean up of code
ElieOaks 499d158
cleaned up code and worked off of Kiko's comments
ElieOaks ddce7ab
removed stray file
ElieOaks 8a3c951
removed stray file
ElieOaks 5dbc4a9
fixed a space
ElieOaks ba10b39
fixed a space
ElieOaks 308149e
fixed a space
ElieOaks 740946b
fixed a space
ElieOaks 2c13220
fixed a space
ElieOaks 9edd6c4
fixed a space
ElieOaks b475d04
smaller changes
ElieOaks 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,16 @@ | ||
| -- This file was automatically converted by encorec | ||
|
|
||
| module Bool | ||
|
|
||
| read class Bool | ||
| val value : bool | ||
| def init(x : bool) : unit | ||
| this.value = x | ||
| end | ||
| def show() : String | ||
| string_from_bool(this.value) | ||
| end | ||
| def value() : bool | ||
| this.value | ||
| end | ||
| end |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,20 @@ | ||
| -- This file was automatically converted by encorec | ||
|
|
||
| module MutBool | ||
|
|
||
| local class MutBool | ||
| var value : bool | ||
|
|
||
| def init(x : bool) : unit | ||
| this.value = x | ||
| end | ||
|
|
||
| def show() : String | ||
| string_from_bool(this.value) | ||
| end | ||
|
|
||
| def value() : bool | ||
| this.value | ||
| end | ||
|
|
||
| end |
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,20 @@ | ||
| -- This file was automatically converted by encorec | ||
|
|
||
| module MutChar | ||
|
|
||
| local class MutChar | ||
| var value : char | ||
|
|
||
| def init(x : char) : unit | ||
| this.value = x | ||
| end | ||
|
|
||
| def show() : String | ||
| string_from_char(this.value) | ||
| end | ||
|
|
||
| def value() : char | ||
| this.value | ||
| end | ||
|
|
||
| end |
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,20 @@ | ||
| -- This file was automatically converted by encorec | ||
|
|
||
| module MutInteger | ||
|
|
||
| local class MutInteger | ||
| var value : int | ||
|
|
||
| def init(x : int) : unit | ||
| this.value = x | ||
| end | ||
|
|
||
| def show() : String | ||
| string_from_int(this.value) | ||
| end | ||
|
|
||
| def value() : int | ||
| this.value | ||
| end | ||
|
|
||
| end |
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,20 @@ | ||
| -- This file was automatically converted by encorec | ||
|
|
||
| module MutReal | ||
|
|
||
| local class MutReal | ||
| var value : real | ||
|
|
||
| def init(x : real) : unit | ||
| this.value = x | ||
| end | ||
|
|
||
| def show() : String | ||
| string_from_real(this.value) | ||
| end | ||
|
|
||
| def value() : real | ||
| this.value | ||
| end | ||
|
|
||
| end |
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,20 @@ | ||
| -- This file was automatically converted by encorec | ||
|
|
||
| module MutString | ||
|
|
||
| local class MutString | ||
| var value : String | ||
|
|
||
| def init(x : String) : unit | ||
| this.value = x | ||
| end | ||
|
|
||
| def show() : String | ||
| this.value | ||
| end | ||
|
|
||
| def value() : String | ||
| this.value | ||
| end | ||
|
|
||
| end |
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 @@ | ||
|
|
||
| module MutUnit | ||
|
|
||
| local class MutUnit | ||
|
|
||
| def show() : String | ||
| "()" | ||
| end | ||
|
|
||
| def value() : unit | ||
| () | ||
| end | ||
|
|
||
| end |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| -- JOY for-comprehension | ||
| module Functor | ||
|
|
||
| import Collections.Mutable.Collection | ||
|
|
||
| local trait Functor[t] | ||
|
Contributor
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. A functor, as defined in Haskell, is only your |
||
| require def map[u](f : t -> u) : Collection[u] | ||
| require def flatMap[u](f : t -> Functor[u]) : Collection[u] | ||
| require def foreach[u](f : t -> unit) : unit | ||
| end | ||
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.
It is nice to have the name, but I would remove this line :)