Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/main/scala/stdlib/HigherOrderFunctions.scala
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ object HigherOrderFunctions extends FlatSpec with Matchers with org.scalaexercis
*/
def meetLambdaHigherOrderFunctions(res0: Int, res1: Int, res2: Int, res3: Int, res4: Int, res5: Int) {
def lambda = { x: Int ⇒ x + 1 }
def lambda2 = (x: Int) ⇒ x + 1
val lambda3 = (x: Int) ⇒ x + 1
def lambda2 = (x: Int) ⇒ x + 2
val lambda3 = (x: Int) ⇒ x + 3

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

def lambda5(x: Int) = x + 1
Expand Down
2 changes: 1 addition & 1 deletion src/test/scala/stdlib/HigherOrderFunctionsSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class HigherOrderFunctionsSpec extends Spec with Checkers {
check(
Test.testSuccess(
HigherOrderFunctions.meetLambdaHigherOrderFunctions _,
4 :: 4 :: 4 :: 4 :: 4 :: 4 :: HNil
4 :: 4 :: 5 :: 6 :: 2 :: 4 :: HNil
)
)
}
Expand Down