次のコードScalaのため、理解型推論
def f(chars: List[Char]): List[List[Char]] = chars match {
case Nil => List(Nil)
case x :: xs => for {
v <- f(xs)
} yield List(x) :: v
}
は、エラーメッセージ
- type mismatch; found : List[List[Any]] required: List[List[Char]]
を与えるには、「の」のここでの任意の代わりにシャアの最も一般的に選択した理由を私は理解して助けてください?言語仕様のどのトピックを読んでください。ありがとう。