Packages

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( ... ) @typeclass( ... , ... )
Source
Align.scala
Linear Supertypes
Serializable, Serializable, AnyRef, Any
Type Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Align
  2. Serializable
  3. Serializable
  4. AnyRef
  5. 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]

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → 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 alignMergeWith[A](fa1: F[A], fa2: F[A])(f: (A, A) ⇒ A): F[A]

    Align two structures with the same element, combining results according to the given function.

    Align two structures with the same element, combining results according to the given function.

    Example:

    scala> import cats.implicits._
    scala> Align[List].alignMergeWith(List(1, 2), List(10, 11, 12))(_ + _)
    res0: List[Int] = List(11, 13, 12)
  6. 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)
  7. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  8. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native() @IntrinsicCandidate()
  9. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  10. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  11. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @IntrinsicCandidate()
  12. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @IntrinsicCandidate()
  13. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  14. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  15. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @IntrinsicCandidate()
  16. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @IntrinsicCandidate()
  17. 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))
  18. 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))
  19. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  20. def toString(): String
    Definition Classes
    AnyRef → Any
  21. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  22. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  23. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  24. def zipAll[A, B](fa: F[A], fb: F[B], a: A, b: B): F[(A, B)]

    Pairs elements of two structures along the union of their shapes, using placeholders for missing values.

    Pairs elements of two structures along the union of their shapes, using placeholders for missing values.

    Example:

    scala> import cats.implicits._
    scala> Align[List].zipAll(List(1, 2), List(10, 11, 12), 20, 21)
    res0: List[(Int, Int)] = List((1,10), (2,11), (20,12))

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] ) @Deprecated
    Deprecated

Inherited from Serializable

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped