2017-07-19 12 views

答えて

8

知る方法は2つあります。あなたが式に入力したら、それはタイプを伝えます:

scala> val f: Int => Int => Int = a => b => a + b 
f: Int => (Int => Int) = $$Lambda$1143/[email protected] 

既存の値を持っており、その種類をお知りになりたい場合は、あなたが:type

scala> :type f 
Int => (Int => Int) 

等として言及を使用し、:tも動作しますHaskellに似て:

scala> :t f 
Int => (Int => Int) 
+0

'scala>:tf'も動作します。 – chunjef

+0

@chunjef更新。 –

関連する問題