FunctorTuple2Ops

final class FunctorTuple2Ops[F[_], A, B](fab: F[(A, B)]) extends AnyVal
class AnyVal
trait Matchable
class Any

Value members

Concrete methods

def _1F(F: Functor[F]): F[A]

Lifts Tuple2#_1 to Functor

Lifts Tuple2#_1 to Functor

scala> import cats.data.Chain
scala> import cats.syntax.functor._

scala> Chain((1, 2), (3, 4), (5, 6))._1F == Chain(1, 3, 5)
res0: Boolean = true
def _2F(F: Functor[F]): F[B]

Lifts Tuple2#_2 to Functor

Lifts Tuple2#_2 to Functor

scala> import cats.data.Chain
scala> import cats.syntax.functor._

scala> Chain((1, 2), (3, 4), (5, 6))._2F == Chain(2, 4, 6)
res0: Boolean = true
def swapF(F: Functor[F]): F[(B, A)]

Lifts Tuple2#swap to Functor

Lifts Tuple2#swap to Functor

scala> import cats.data.Chain
scala> import cats.syntax.functor._

scala> Chain((1, 2), (3, 4), (5, 6)).swapF == Chain((2, 1), (4, 3), (6, 5))
res0: Boolean = true
def unzip(F: Functor[F]): (F[A], F[B])

Un-zips an F[(A, B)] consisting of element pairs or Tuple2 into two separate F's tupled.

Un-zips an F[(A, B)] consisting of element pairs or Tuple2 into two separate F's tupled.

NOTE: Check for effect duplication, possibly memoize before

scala> import cats.data.Chain
scala> import cats.syntax.functor._

scala> Chain((1, 2), (3, 4), (5, 6)).unzip == ((Chain(1, 3, 5), Chain(2, 4, 6)))
res0: Boolean = true