Skip to content

Commit

Permalink
Improves examples
Browse files Browse the repository at this point in the history
  • Loading branch information
MattisKra committed Oct 18, 2023
1 parent 7f8b7cf commit 8976dd7
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 50 deletions.
11 changes: 0 additions & 11 deletions examples/pts/defWithTypeParam.effekt

This file was deleted.

6 changes: 0 additions & 6 deletions examples/pts/example.effekt

This file was deleted.

10 changes: 0 additions & 10 deletions examples/pts/functionReturnType.effekt

This file was deleted.

File renamed without changes.
8 changes: 0 additions & 8 deletions examples/pts/overloaded.effekt

This file was deleted.

21 changes: 11 additions & 10 deletions examples/pts/pos/boxInference.effekt
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,21 @@ def f(x: Int): Int = x + 1
def g(x: Int): Int = x * 2

def func1(boxedParam: _): Int = {
(unbox boxedParam)(1)
def f = unbox boxedParam
f(1)
}

def func2(boxedParams: List[_]): Int = {
var sum = 0
foreach(boxedParams) {
func => sum = sum + (unbox func)(1)
}

sum
}
//def func2(boxedParams: List[_]): Int = {
// var sum = 0
// foreach(boxedParams) {
// func => sum = sum + (unbox func)(1)
// }
//
// sum
//}

def main() = {
val a = func1(box f)
val b = func2(Cons(box f, Cons(box g, Nil())))
// val b = func2(Cons(box f, Cons(box g, Nil())))
1
}
File renamed without changes.
File renamed without changes.
5 changes: 0 additions & 5 deletions examples/pts/recursion.effekt

This file was deleted.

0 comments on commit 8976dd7

Please sign in to comment.