-
Notifications
You must be signed in to change notification settings - Fork 439
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/In-Veritas/Bend in order to…
… catch up to current commit
- Loading branch information
Showing
27 changed files
with
66 additions
and
177 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
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
10 changes: 3 additions & 7 deletions
10
tests/golden_tests/compile_file/mismatched_ask_statements.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,12 +1,8 @@ | ||
type Bool: | ||
T | ||
F | ||
|
||
def main: | ||
with IO: | ||
match _ = Bool/T: | ||
case Bool/T: | ||
match _ = Bool/True: | ||
case Bool/False: | ||
x <- wrap(0) | ||
case Bool/F: | ||
case Bool/False: | ||
x = wrap(0) | ||
return wrap(x) |
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,4 +1,3 @@ | ||
type Bool = True | False | ||
type List_ = (Cons head tail) | Nil | ||
|
||
If Bool/True then else = then | ||
|
6 changes: 2 additions & 4 deletions
6
tests/golden_tests/compile_file_o_all/non_exhaustive_and.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,4 @@ | ||
type Bool = T | F | ||
|
||
Bool.and Bool/T Bool/T = Bool/T | ||
Bool.and Bool/F Bool/F = Bool/F | ||
Bool.and Bool/True Bool/True = Bool/True | ||
Bool.and Bool/False Bool/False = Bool/False | ||
|
||
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,12 +1,8 @@ | ||
type Bool: | ||
T | ||
F | ||
|
||
def main: | ||
with IO: | ||
match _ = Bool/T: | ||
case Bool/T: | ||
match _ = Bool/True: | ||
case Bool/True: | ||
x <- wrap(0) | ||
case Bool/F: | ||
case Bool/False: | ||
x <- wrap(0) | ||
return wrap(x) |
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,5 @@ | ||
type Bool = T | F | ||
|
||
And (Bool/T, Bool/T, Bool/T) = Bool/T | ||
And * = Bool/F | ||
And (Bool/True, Bool/True, Bool/True) = Bool/True | ||
And * = Bool/False | ||
|
||
main = (And (Bool/F, Bool/T, Bool/F)) | ||
main = (And (Bool/False, Bool/True, Bool/False)) |
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,4 @@ | ||
type Bool = T | F | ||
foo (Bool/True, x) = x | ||
foo * = Bool/False | ||
|
||
foo (Bool/T, x) = x | ||
foo * = Bool/F | ||
|
||
main = (foo (Bool/F, Bool/T)) | ||
main = (foo (Bool/False, Bool/True)) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
type Bool = True | False | ||
type List_ = (Cons head tail) | Nil | ||
|
||
If Bool/True then else = then | ||
|
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,5 +1,3 @@ | ||
type Bool = False | True | ||
|
||
(Foo a b) = λf (f a) | ||
(Foo a b) = b | ||
|
||
|
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,5 +1,3 @@ | ||
type Bool = True | False | ||
|
||
(if_ 0 then else) = else | ||
(if_ _ then else) = then | ||
|
||
|
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,17 +1,13 @@ | ||
type Bool: | ||
T | ||
F | ||
|
||
def filter(f, ls): | ||
match ls: | ||
case List/Nil: | ||
return List/Nil | ||
case List/Cons: | ||
match f(ls.head): | ||
case Bool/T: | ||
case Bool/True: | ||
return List/Cons(ls.head, filter(f, ls.tail)) | ||
case Bool/F: | ||
case Bool/False: | ||
return filter(f, ls.tail) | ||
|
||
def main: | ||
return filter(lambda x: x, [Bool/T]) | ||
return filter(lambda x: x, [Bool/True]) |
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,3 @@ | ||
type Bool: | ||
True | ||
False | ||
|
||
type MyTree = (node ~lft ~rgt) | (leaf val) | ||
|
||
def tree_xor(tree): | ||
|
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,4 @@ | ||
type Bool = T | F | ||
|
||
main = @x match x { | ||
Bool/T : @$x * | ||
Bool/F : @x * | ||
Bool/True : @$x * | ||
Bool/False : @x * | ||
} |
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.