Permalink
Browse files

Merge pull request #20 from davidallsopp/patch-1

Corrected definition of cube function in response to progfun-003 student
  • Loading branch information...
2 parents ab7d770 + b5d10f7 commit 1c5080771cec48fefc285b7c54634fa9028a5ab1 @lrytz lrytz committed Sep 23, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 CheatSheet.md
View
@@ -46,7 +46,7 @@ These are functions that take a function as a parameter or return functions.
sum((x: Int) => x * x * x) // Anonymous function, i.e. does not have a name
sum(x => x * x * x) // Same anonymous function with type inferred
- def cube(x: Int) => x * x * x
+ def cube(x: Int) = x * x * x
sum(x => x * x * x)(1, 10) // sum of cubes from 1 to 10
sum(cube)(1, 10) // same as above
```

0 comments on commit 1c50807

Please sign in to comment.