import cats._
import cats.data._
import cats.implicits._
import cats.instances.all._
...
def test = Foldable[List].intercalate(List("a", "b", "c"), "-")
...
결과 : 그것은cats typeclasses를 사용하는 방법? 에
could not find implicit value for parameter instance: cats.Foldable[List]
작동하지 않는 방법과 그것을 해결하기 위해 왜?
scala> import cats.implicits._
scala> Foldable[List].intercalate(List("a","b","c"), "-")
res0: String = a-b-c
편집 : 1 : 그것은 자신의 문서에서 불과 카피 인 것 같아
에도 여전히 작동하지 않는 제안 import cats.instances.all._
을 제거한 후. 당신은 두 번 Foldable[List]
의 인스턴스를 가져
value intercalate is not a member of cats.Foldable[List]
사용중인 고양이 버전은 무엇입니까? –
@YuvalItzchakov 0.7.2 – monnef