Skip to content

Commit 2675780

Browse files
authored
Merge pull request #75 from hellrich/patch-2
made meetLambdaHigherOrderFunctions more interesting
2 parents 9d4a8af + d74c470 commit 2675780

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/main/scala/stdlib/HigherOrderFunctions.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ object HigherOrderFunctions extends FlatSpec with Matchers with org.scalaexercis
1313
*/
1414
def meetLambdaHigherOrderFunctions(res0: Int, res1: Int, res2: Int, res3: Int, res4: Int, res5: Int) {
1515
def lambda = { x: Int x + 1 }
16-
def lambda2 = (x: Int) x + 1
17-
val lambda3 = (x: Int) x + 1
16+
def lambda2 = (x: Int) x + 2
17+
val lambda3 = (x: Int) x + 3
1818

1919
val lambda4 = new Function1[Int, Int] {
20-
def apply(v1: Int): Int = v1 + 1
20+
def apply(v1: Int): Int = v1 - 1
2121
}
2222

2323
def lambda5(x: Int) = x + 1

src/test/scala/stdlib/HigherOrderFunctionsSpec.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class HigherOrderFunctionsSpec extends Spec with Checkers {
1111
check(
1212
Test.testSuccess(
1313
HigherOrderFunctions.meetLambdaHigherOrderFunctions _,
14-
4 :: 4 :: 4 :: 4 :: 4 :: 4 :: HNil
14+
4 :: 4 :: 5 :: 6 :: 2 :: 4 :: HNil
1515
)
1616
)
1717
}

0 commit comments

Comments
 (0)