All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cats.compat.FoldableCompat.scala Maven / Gradle / Ivy

The newest version!
package cats
package compat

private[cats] object FoldableCompat {

  def toIterable[F[_], A](fa: F[A])(F: Foldable[F]): Iterable[A] =
    F.foldRight[A, Stream[A]](fa, Eval.now(Stream.empty)) { (a, eb) =>
        eb.map(Stream.cons(a, _))
      }
      .value
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy