list - Scala: type mismatch found in mapping -


error: type mismatch; found : list[list[(char, int)]] required: list[(char, int)] @ q<- x

a2 reduceleft ((x,y)=>     for{       q<- x       b<- y     } yield (q::b::nil)   )  

where, a2 : list[list[(char, int)]].

if a2 list[list[(char, int)]], x list[(char, int)], q (char, int), , b, how found list[list[(char, int)]]?

the problem yield returns list[(char, int)] loop returns list[list[(char, int)]].

therefore, reduceleft complains since expects return type list[(char, int)].


Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -