看起来 scalaz
为 List
提供了一个 Functor
实例,但是没有为 Array
(或 Seq
)提供。
scala> val fa = Functor[Array]
<console>:17: error: could not find implicit value for parameter F: scalaz.Functor[Array]
val fa = Functor[Array]
^
scala> val fl = Functor[List]
fl: scalaz.Functor[List] = scalaz.std.ListInstances$$anon$1@20c4b59
scala> val fl = Functor[Seq]
<console>:17: error: could not find implicit value for parameter F: scalaz.Functor[Seq]
val fl = Functor[Seq]
^
为什么呢?它们不是函数对象吗?
Seq
情况。 - Travis Brown