79698194

Date: 2025-07-11 10:41:48
Score: 0.5
Natty:
Report link

This has been available if you use https://typelevel.org/cats/ on Foldables for a while, for example:

import cats.syntax.foldable._

val list = List(1, 2, 3, 4, 5)
println(list.sliding2)
// List((1,2), (2,3), (3,4), (4,5))

sliding3, sliding4, etc are also defined, see the scaladoc for more information.

Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: C4ffeine Add1ct