Introduction to Basic Haskell Components (In Chinese)ChengHui Weng
In 2012, we had the first Chinese functional meetup about general functional programming techniques in Taipei. I gave this talk to introduce several classes in the famous Typeclassesopedia article.
Introduction to Basic Haskell Components (In Chinese)ChengHui Weng
In 2012, we had the first Chinese functional meetup about general functional programming techniques in Taipei. I gave this talk to introduce several classes in the famous Typeclassesopedia article.
Jamie Allen, Björn Antonsson and Patrik Nordwall discuss patterns of building Akka systems, including the Sentinel for handling failure above a supervisor, flow control and distributed workers. Patrik also built a template for Typesafe Activator v0.2.1 allowing you to try out this distributed workers pattern on your own machine.
30. Scala里的高阶函数
第二种:产生的结果是一个函数的函数。eg:
scala>
def
hf():Int=>Int
=
x=>x+1
hf:
()Int
=>
Int
scala>
val
fun
=
hf
fun:
Int
=>
Int
=
<funcfon1>
scala>
fun(2)
res0:
Int
=
3
35. 柯里化(currying)
scala>
sum2(1)(2)
res1:
Int
=
3
//
上面的调用相当于下面的几个步骤
scala>
def
first(x:Int)
=
(y:Int)=>x+y
first:
(x:
Int)Int
=>
Int
scala>
first(1)
res2:
Int
=>
Int
=
<funcfon1>
scala>
val
second
=
first(1)
second:
Int
=>
Int
=
<funcfon1>
scala>
second(2)
res3:
Int
=
3