tofu.syntax.streams.chunks.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of tofu-streams_2.13 Show documentation
Show all versions of tofu-streams_2.13 Show documentation
Opinionated set of tools for functional programming in Scala
The newest version!
package tofu.syntax.streams
import tofu.streams.Chunks
private[syntax] final class ChunksOps[F[_], C[_], A](fa: F[A])(implicit ch: Chunks[F, C]) {
def cons(ca: C[A]): F[A] = ch.cons(fa)(ca)
def chunks: F[C[A]] = ch.chunks(fa)
def chunksN(n: Int): F[C[A]] = ch.chunkN(fa)(n)
def mapChunks[B](f: C[A] => C[B]): F[B] = ch.mapChunks(fa)(f)
}
private[syntax] trait ChunkSyntax {
implicit def toChunkOps[F[_], C[_], A](fa: F[A])(implicit ch: Chunks[F, C]): ChunksOps[F, C, A] = new ChunksOps(fa)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy