-
Notifications
You must be signed in to change notification settings - Fork 442
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updates builtin type Map so that it stores Maybes in its nodes.
- Loading branch information
1 parent
e195a55
commit 0ad7503
Showing
22 changed files
with
192 additions
and
125 deletions.
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
8 changes: 4 additions & 4 deletions
8
tests/golden_tests/compile_file_o_all/match_adt_non_exhaustive.bend
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 |
---|---|---|
@@ -1,9 +1,9 @@ | ||
type Maybe = (Some val) | None | ||
type Maybe_ = (Some val) | None | ||
|
||
main = @maybe | ||
match maybe { | ||
Maybe/None: 0 | ||
Maybe/Some: match maybe.val { | ||
Maybe/None: 0 | ||
Maybe_/None: 0 | ||
Maybe_/Some: match maybe.val { | ||
Maybe_/None: 0 | ||
} | ||
} |
8 changes: 4 additions & 4 deletions
8
tests/golden_tests/encode_pattern_match/match_adt_unscoped_lambda.bend
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
type Maybe = None | (Some val) | ||
type Maybe_ = None | (Some val) | ||
|
||
main = (match x = (Maybe/Some 1) { | ||
Maybe/None: @$x * | ||
Maybe/Some: x.val | ||
main = (match x = (Maybe_/Some 1) { | ||
Maybe_/None: @$x * | ||
Maybe_/Some: x.val | ||
} $x) |
14 changes: 7 additions & 7 deletions
14
tests/golden_tests/encode_pattern_match/match_adt_unscoped_var.bend
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 |
---|---|---|
@@ -1,13 +1,13 @@ | ||
type Maybe = None | (Some val) | ||
type Maybe_ = None | (Some val) | ||
|
||
Foo = @$x match x = (Maybe/Some 1) { | ||
Maybe/None: $x | ||
Maybe/Some: x.val | ||
Foo = @$x match x = (Maybe_/Some 1) { | ||
Maybe_/None: $x | ||
Maybe_/Some: x.val | ||
} | ||
|
||
Bar = (match x = (Maybe/Some 1) { | ||
Maybe/None: $x | ||
Maybe/Some: x.val | ||
Bar = (match x = (Maybe_/Some 1) { | ||
Maybe_/None: $x | ||
Maybe_/Some: x.val | ||
} @$x *) | ||
|
||
main = * |
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 |
---|---|---|
@@ -1,10 +1,6 @@ | ||
type Point: | ||
Point { x, y } | ||
|
||
type Bool: | ||
True | ||
False | ||
|
||
|
||
def symbols(): | ||
x = { `x`: 5, 2: 3 }; | ||
|
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 |
---|---|---|
@@ -1,10 +1,10 @@ | ||
type Maybe = (Some x) | None | ||
type Maybe_ = (Some x) | None | ||
|
||
Maybe/bind val nxt = match val { | ||
Maybe/Some: (nxt val.x) | ||
Maybe/None: Maybe/None | ||
Maybe_/bind val nxt = match val { | ||
Maybe_/Some: (nxt val.x) | ||
Maybe_/None: Maybe/None | ||
} | ||
|
||
main = with Maybe { | ||
main = with Maybe_ { | ||
(wrap 1) | ||
} |
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
# We want to make sure that the default value is not mistakenly erased in the first level of flattening. | ||
type Maybe = (Some x) | None | ||
type Maybe_ = (Some x) | None | ||
|
||
(DoubleUnwrap (Maybe/Some (Maybe/Some x)) *) = x | ||
(DoubleUnwrap (Maybe_/Some (Maybe_/Some x)) *) = x | ||
(DoubleUnwrap * x) = x | ||
|
||
Main = (DoubleUnwrap (Maybe/Some Maybe/None) 5) | ||
Main = (DoubleUnwrap (Maybe_/Some Maybe_/None) 5) |
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.