タイプの不一致エラーについて昨日からブロックされており、修正方法がわかりません。多分あなたはそれで私を助けることができます。
def combine( head : (Char,Int), xs : Occurrences) : List[Occurrences] =
xs.map { case (x,i) => for ( occu <- 1 to head._2 ) yield List((x,i), (head._1, occu)) }
これが私が得るエラーです:
type mismatch;
found : List[scala.collection.immutable.IndexedSeq[List[(Char, Int)]]]
required: List[forcomp.Anagrams.Occurrences]
タイプOccurrences
は次のように定義されます 。type Occurrences = List[(Char, Int)]
このエラーを修正するにはどうすればよいですか?