Skip to content

Commit d3684cf

Browse files
author
Rafa Paradela
committed
Merge pull request scala-exercises#54 from kpashka/master
Update partialfunctions.json
2 parents 6e16325 + 76c29ba commit d3684cf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/json/partialfunctions.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"postparagraph": ""
1212
},
1313
{
14-
"preparagraph": "Case statements are a quick way to create partial functions. When you create a case statement, the apply and `isDefinedAt` is created for you.",
14+
"preparagraph": "Case statements are a quick way to create partial functions. When you create a case statement, the `apply` and `isDefinedAt` is created for you.",
1515
"code": "//These case statements are called case statements with guards\nval doubleEvens: PartialFunction[Int, Int] = {\n case x: Int if (x % 2) == 0 => x * 2\n}\nval tripleOdds: PartialFunction[Int, Int] = {\n case x: Int if (x % 2) != 0 => x * 3\n}\n\nval whatToDo = doubleEvens orElse tripleOdds //Here we chain the partial functions together\nwhatToDo(3) should be(__)\nwhatToDo(4) should be(__)",
1616
"solutions": [
1717
"9",

0 commit comments

Comments
 (0)