Trait/Object

cats.arrow

FunctionK

Related Docs: object FunctionK | package arrow

Permalink

trait FunctionK[F[_], G[_]] extends Serializable

FunctionK[F[_], G[_]] is a functor transformation from F to G in the same manner that function A => B is a morphism from values of type A to B. An easy way to create a FunctionK instance is to use the Polymorphic lambdas provided by non/kind-projector v0.9+. E.g.

val listToOption = λ[FunctionK[List, Option]](_.headOption)
Self Type
FunctionK[F, G]
Linear Supertypes
Serializable, Serializable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. FunctionK
  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 apply[A](fa: F[A]): G[A]

    Permalink

    Applies this functor transformation from F to G

Concrete Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. def and[H[_]](h: FunctionK[F, H]): FunctionK[F, [γ$4$]Tuple2K[G, H, γ$4$]]

    Permalink

    Composes two instances of FunctionK into a new FunctionK that transforms one single functor to a cats.data.Tuple2K of two functors.

    Composes two instances of FunctionK into a new FunctionK that transforms one single functor to a cats.data.Tuple2K of two functors.

    scala> import cats.arrow.FunctionK
    scala> val list2option = λ[FunctionK[List, Option]](_.headOption)
    scala> val list2vector = λ[FunctionK[List, Vector]](_.toVector)
    scala> val optionAndVector = list2option and list2vector
    scala> optionAndVector(List(1,2,3))
    res0: cats.data.Tuple2K[Option,Vector,Int] = Tuple2K(Some(1),Vector(1, 2, 3))
  5. def andThen[H[_]](f: FunctionK[G, H]): FunctionK[F, H]

    Permalink

    Composes two instances of FunctionK into a new FunctionK with this transformation applied first.

  6. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  7. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. def compose[E[_]](f: FunctionK[E, F]): FunctionK[E, G]

    Permalink

    Composes two instances of FunctionK into a new FunctionK with this transformation applied last.

  9. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  10. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  11. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  12. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  13. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  14. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  15. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  16. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  17. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  18. def or[H[_]](h: FunctionK[H, G]): FunctionK[[γ$1$]EitherK[F, H, γ$1$], G]

    Permalink

    Composes two instances of FunctionK into a new FunctionK that transforms a cats.data.EitherK to a single functor.

    Composes two instances of FunctionK into a new FunctionK that transforms a cats.data.EitherK to a single functor.

    This transformation will be used to transform left F values while h will be used to transform right H values.

  19. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  20. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  21. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  22. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  23. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Serializable

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped