9

I only found several methods which were all unaccessible - intersperseList.

Why isn't it accessible? Or is there somewhere a function which does the intersperse operation?

Example of functionality from ScalaZ:

scala> intersperse(List(1, 2, 3), 7)
res3: List[Int] = List(1, 7, 2, 7, 3)
monnef
  • 3,903
  • 5
  • 30
  • 50

1 Answers1

6

Intercalate is the closest thing in cats I think: https://github.com/typelevel/cats/blob/882a67387f3c538237b0afbf9f0389ad5f34a648/core/src/main/scala/cats/Foldable.scala#L469-L498

Haspemulator
  • 11,050
  • 9
  • 49
  • 76