Advertisement
Guest User

Untitled

a guest
Nov 5th, 2014
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scala 0.49 KB | None | 0 0
  1. Welcome to Scala version 2.10.4 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_25).
  2. Type in expressions to have them evaluated.
  3. Type :help for more information.
  4.  
  5. scala> def trzyArgsy(a: Int, b: Int, c: Int): Int = a*b/c
  6. trzyArgsy: (a: Int, b: Int, c: Int)Int
  7.  
  8. scala> def curry[A,B,C,D](f: (A, B, C) => D): A=>B=>C=>D = { (a:A) => (b:B) => (c:C) => f (a,b,c) }
  9. curry: [A, B, C, D](f: (A, B, C) => D)A => (B => (C => D))
  10.  
  11. scala> curry(trzyArgsy)
  12. res3: Int => (Int => (Int => Int)) = <function1>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement