SHARE
TWEET

Currying Scala

Lusien_Lashans Mar 17th, 2019 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package exercises
  2.  
  3. //  while, return и var запрещены
  4. //  0.5 балла
  5. object Currying {
  6.  
  7.   def curry[A, B, C](f: (A, B) => C): A => (B => C) = {
  8.     f.curried
  9.   }
  10.  
  11.   def uncurry[A, B, C](f: A => B => C): (A, B) => C = {
  12.     Function.uncurried(f)
  13.   }
  14. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top