回答編集履歴
2
修正
answer
CHANGED
@@ -7,7 +7,10 @@
|
|
7
7
|
f: (Int, Int) => String = <function2>
|
8
8
|
```
|
9
9
|
|
10
|
-
`f: (Int, Int) => String = <function2>`の意味は
|
11
|
-
|
10
|
+
---
|
12
11
|
|
12
|
+
`Function2`の`ToString()`は`"<function2>"`を返すようになっています。
|
13
|
+
[scala/Function2.scala at v2.12.9 · scala/scala](https://github.com/scala/scala/blob/v2.12.9/src/library/scala/Function2.scala#L55)
|
14
|
+
したがって`f: (Int, Int) => String = <function2>`の意図するところは、
|
15
|
+
|
13
16
|
「`f`の型は `(Int, Int) => String)`で、`Function2`トレイトのインスタンスだよ」ということです。
|
1
追記
answer
CHANGED
@@ -5,4 +5,9 @@
|
|
5
5
|
scala> val f = getFunc("result is ")
|
6
6
|
|
7
7
|
f: (Int, Int) => String = <function2>
|
8
|
-
```
|
8
|
+
```
|
9
|
+
|
10
|
+
`f: (Int, Int) => String = <function2>`の意味は
|
11
|
+
`変数名 : 型 = 値`で
|
12
|
+
|
13
|
+
「`f`の型は `(Int, Int) => String)`で、`Function2`トレイトのインスタンスだよ」ということです。
|