trait Align[F[_]] extends Serializable

Align supports zipping together structures with different shapes, holding the results from either or both structures in an Ior.

Must obey the laws in cats.laws.AlignLaws

Annotations
@implicitNotFound( ... )
Source
Align.scala
Linear Supertypes
Serializable, Serializable, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Align
  2. Serializable
  3. Serializable
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def align[A, B](fa: F[A], fb: F[B]): F[Ior[A, B]]

    Pairs elements of two structures along the union of their shapes, using Ior to hold the results.

    Pairs elements of two structures along the union of their shapes, using Ior to hold the results.

    Example:

    scala> import cats.implicits._
    scala> import cats.data.Ior
    scala> Align[List].align(List(1, 2), List(10, 11, 12))
    res0: List[Ior[Int, Int]] = List(Both(1,10), Both(2,11), Right(12))
  2. abstract def functor: Functor[F]
  3. abstract def getClass(): Class[_]
    Definition Classes
    Any

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    Any
  2. final def ##(): Int
    Definition Classes
    Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    Any
  4. def alignCombine[A](fa1: F[A], fa2: F[A])(implicit arg0: Semigroup[A]): F[A]

    Align two structures with the same element, combining results according to their semigroup instances.

    Align two structures with the same element, combining results according to their semigroup instances.

    Example:

    scala> import cats.implicits._
    scala> Align[List].alignCombine(List(1, 2), List(10, 11, 12))
    res0: List[Int] = List(11, 13, 12)
  5. def alignWith[A, B, C](fa: F[A], fb: F[B])(f: (Ior[A, B]) ⇒ C): F[C]

    Combines elements similarly to align, using the provided function to compute the results.

    Combines elements similarly to align, using the provided function to compute the results.

    Example:

    scala> import cats.implicits._
    scala> Align[List].alignWith(List(1, 2), List(10, 11, 12))(_.mergeLeft)
    res0: List[Int] = List(1, 2, 12)
  6. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  7. def equals(arg0: Any): Boolean
    Definition Classes
    Any
  8. def hashCode(): Int
    Definition Classes
    Any
  9. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  10. def padZip[A, B](fa: F[A], fb: F[B]): F[(Option[A], Option[B])]

    Same as align, but forgets from the type that one of the two elements must be present.

    Same as align, but forgets from the type that one of the two elements must be present.

    Example:

    scala> import cats.implicits._
    scala> Align[List].padZip(List(1, 2), List(10))
    res0: List[(Option[Int], Option[Int])] = List((Some(1),Some(10)), (Some(2),None))
  11. def padZipWith[A, B, C](fa: F[A], fb: F[B])(f: (Option[A], Option[B]) ⇒ C): F[C]

    Same as alignWith, but forgets from the type that one of the two elements must be present.

    Same as alignWith, but forgets from the type that one of the two elements must be present.

    Example:

    scala> import cats.implicits._
    scala> Align[List].padZipWith(List(1, 2), List(10, 11, 12))(_ |+| _)
    res0: List[Option[Int]] = List(Some(11), Some(13), Some(12))
  12. def toString(): String
    Definition Classes
    Any

Inherited from Serializable

Inherited from Serializable

Inherited from Any

Ungrouped