-
Notifications
You must be signed in to change notification settings - Fork 167
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
allow operator id's in fields (issue #557)
- Loading branch information
Showing
17 changed files
with
56 additions
and
6 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
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
struct num<a> | ||
(+) : ( x : a, y : a ) -> a | ||
(*) : (a,a) -> a | ||
|
||
val int/num : num<int> | ||
= Num( (+), (*) ) | ||
|
||
pub fun main() | ||
(num.(+))(1,2).println |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
3 |
File renamed without changes.
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
f(2, [1], Just([2, 3])) -> 6 | ||
f(1, [1], Just([1])) -> cgen/pattern-match-in-param(1,34): f: pattern match failure | ||
g(1, 2) -> 1 | ||
h([2,3]) -> 2 | ||
h() -> 1 | ||
i(0) -> 1 | ||
j(0) -> 1 | ||
k([]) -> cgen/pattern-match-in-param(23,12): k: pattern match failure | ||
l((1, 2, 3)) -> 1 |
File renamed without changes.
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
0@25 |
File renamed without changes.
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
0@25 |
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
struct num<a> | ||
plus : (a,a) -> a | ||
zero : a | ||
|
||
fun num/(+)( x : a, y : a, ?num : num<a> ) : a | ||
(?num.plus)(x,y) | ||
|
||
fun list/(+)( xs : list<a>, ys : list<a>, ?num : num<a> ) : a | ||
zipwith(xs,ys,num/(+)).foldl(num.zero,num/(+)) | ||
|
||
|
||
val bool/num : num<bool> = Num( xor, False ) | ||
val int/num : num<int> = Num( int/(+), 0 ) | ||
|
||
|
||
pub fun main() | ||
([1] + [2], True + False).println |
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
(3,True) | ||
|
||
overload/num1/bool/num: num<bool> | ||
overload/num1/int/num: num<int> | ||
overload/num1/(+): forall<a> (xs : list<a>, ys : list<a>, ?num : num<a>) -> a | ||
overload/num1/num/(+): forall<a> (x : a, y : a, ?num : num<a>) -> a | ||
overload/num1/num/plus: forall<a> (num : num<a>) -> ((a, a) -> a) | ||
overload/num1/num/zero: forall<a> (num : num<a>) -> a | ||
overload/num1/Num: forall<a> (plus : (a, a) -> a, zero : a) -> num<a> | ||
overload/num1/main: () -> console () |
This file was deleted.
Oops, something went wrong.
Empty file.
Empty file.
Empty file.