FoldableNFunctions

cats.FoldableNFunctions
trait FoldableNFunctions[F[_]]

Attributes

Source
FoldableNFunctions.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait Foldable[F]
trait Reducible[F]
class NonEmptyReducible[F, G]
trait NonEmptyTraverse[F]
trait Traverse[F]
Self type

Members list

Grouped members

foldable arity

Group sequential elements into fixed sized tuples by passing a "sliding window" over them. A foldable with fewer elements than the window size will return an empty list unlike Iterable#sliding(size: Int). Example:

import cats.Foldable
scala> Foldable[List].sliding2((1 to 10).toList)
val res0: List[(Int, Int)] = List((1,2), (2,3), (3,4), (4,5), (5,6), (6,7), (7,8), (8,9), (9,10))
scala> Foldable[List].sliding4((1 to 10).toList)
val res1: List[(Int, Int, Int, Int)] = List((1,2,3,4), (2,3,4,5), (3,4,5,6), (4,5,6,7), (5,6,7,8), (6,7,8,9), (7,8,9,10))
scala> Foldable[List].sliding4((1 to 2).toList)
val res2: List[(Int, Int, Int, Int)] = List()
def sliding10[A](fa: F[A]): List[(A, A, A, A, A, A, A, A, A, A)]

Attributes

Source
FoldableNFunctions.scala
def sliding11[A](fa: F[A]): List[(A, A, A, A, A, A, A, A, A, A, A)]

Attributes

Source
FoldableNFunctions.scala
def sliding12[A](fa: F[A]): List[(A, A, A, A, A, A, A, A, A, A, A, A)]

Attributes

Source
FoldableNFunctions.scala
def sliding13[A](fa: F[A]): List[(A, A, A, A, A, A, A, A, A, A, A, A, A)]

Attributes

Source
FoldableNFunctions.scala
def sliding14[A](fa: F[A]): List[(A, A, A, A, A, A, A, A, A, A, A, A, A, A)]

Attributes

Source
FoldableNFunctions.scala
def sliding15[A](fa: F[A]): List[(A, A, A, A, A, A, A, A, A, A, A, A, A, A, A)]

Attributes

Source
FoldableNFunctions.scala
def sliding16[A](fa: F[A]): List[(A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A)]

Attributes

Source
FoldableNFunctions.scala
def sliding17[A](fa: F[A]): List[(A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A)]

Attributes

Source
FoldableNFunctions.scala
def sliding18[A](fa: F[A]): List[(A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A)]

Attributes

Source
FoldableNFunctions.scala
def sliding19[A](fa: F[A]): List[(A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A)]

Attributes

Source
FoldableNFunctions.scala
def sliding2[A](fa: F[A]): List[(A, A)]

Attributes

Source
FoldableNFunctions.scala
def sliding20[A](fa: F[A]): List[(A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A)]

Attributes

Source
FoldableNFunctions.scala
def sliding21[A](fa: F[A]): List[(A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A)]

Attributes

Source
FoldableNFunctions.scala
def sliding22[A](fa: F[A]): List[(A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A)]

Attributes

Source
FoldableNFunctions.scala
def sliding3[A](fa: F[A]): List[(A, A, A)]

Attributes

Source
FoldableNFunctions.scala
def sliding4[A](fa: F[A]): List[(A, A, A, A)]

Attributes

Source
FoldableNFunctions.scala
def sliding5[A](fa: F[A]): List[(A, A, A, A, A)]

Attributes

Source
FoldableNFunctions.scala
def sliding6[A](fa: F[A]): List[(A, A, A, A, A, A)]

Attributes

Source
FoldableNFunctions.scala
def sliding7[A](fa: F[A]): List[(A, A, A, A, A, A, A)]

Attributes

Source
FoldableNFunctions.scala
def sliding8[A](fa: F[A]): List[(A, A, A, A, A, A, A, A)]

Attributes

Source
FoldableNFunctions.scala
def sliding9[A](fa: F[A]): List[(A, A, A, A, A, A, A, A, A)]

Attributes

Source
FoldableNFunctions.scala