summaryrefslogtreecommitdiffstats
path: root/Scala/sandbox
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2013-04-03 22:25:53 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2016-11-10 18:03:22 +0100
commit95d1672c121f15c64b616124f778554ab9a85b77 (patch)
treee9f8de5f0394f3ed6785eb9d145cb18cbbff00f6 /Scala/sandbox
parentd5a5fec4802f98ccb93a692285112382fd6f34cb (diff)
downloadcoursera-95d1672c121f15c64b616124f778554ab9a85b77.zip
coursera-95d1672c121f15c64b616124f778554ab9a85b77.tar.gz
Scala : curry and explicite call
Diffstat (limited to 'Scala/sandbox')
-rw-r--r--Scala/sandbox/curry.scala3
1 files changed, 3 insertions, 0 deletions
diff --git a/Scala/sandbox/curry.scala b/Scala/sandbox/curry.scala
index 21f287a..84b00ee 100644
--- a/Scala/sandbox/curry.scala
+++ b/Scala/sandbox/curry.scala
@@ -17,12 +17,15 @@ object Curry {
sumF
}
+ def cube (x: Int): Int = x * x * x
+
def sumInts = sumCurry(x => x)
def sumCubes = sumCurry(x => x * x * x)
def run = {
println("Curry")
println(sum(x => x * x, 3, 5))
+ println(sumCurry(cube)(3, 5))
println(sumInts(3, 5))
println(sumCubes(3, 5))
}