Skip to content
Open
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Fix code example to utilise max parameter
  • Loading branch information
hhandoko committed Aug 31, 2017
commit 4220c8327ad420cc4736c3232ecb60d8e356c0a5
4 changes: 2 additions & 2 deletions intro/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ def isEven(x: Int): Boolean = x % 2 == 0
def square(x: Int): Int = x * x

def sumOfEvenSquares(max: Int): Int = {
sum(map(filter(iterate(10))(isEven))(square))
sum(map(filter(iterate(max))(isEven))(square))
}
```

Expand All @@ -513,7 +513,7 @@ def isEven(x: Int): Boolean = x % 2 == 0
def square(x: Int): Int = x * x

def sumOfEvenSquares(max: Int): Int = {
(1 to 10)
(1 to max)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch 👍

.filter(isEven)
.map(square)
.sum
Expand Down