trait Functor[F[_]] extends InvariantFunctor[F]
Functors, covariant by nature if not by Scala type. Their key
operation is map
, whose behavior is constrained only by type and
the functor laws.
Many useful functors also have natural scalaz.Apply or scalaz.Bind operations. Many also support scalaz.Traverse.
- Self Type
- Functor[F]
- Source
- Functor.scala
- See also
- Alphabetic
- By Inheritance
- Functor
- InvariantFunctor
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- trait FunctorLaw extends InvariantFunctorLaw
- trait InvariantFunctorLaw extends AnyRef
- Definition Classes
- InvariantFunctor
Abstract Value Members
- abstract def map[A, B](fa: F[A])(f: (A) => B): F[B]
Lift
f
intoF
and apply toF[A]
.
Concrete Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def apply[A, B](fa: F[A])(f: (A) => B): F[B]
Alias for
map
. - final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def bicompose[G[_, _]](implicit arg0: Bifunctor[G]): Bifunctor[[α, β]F[G[α, β]]]
The composition of Functor
F
and BifunctorG
,[x, y]F[G[x, y]]
, is a Bifunctor - def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def compose[G[_]](implicit G0: Functor[G]): Functor[[α]F[G[α]]]
The composition of Functors
F
andG
,[x]F[G[x]]
, is a Functor - def counzip[A, B](a: \/[F[A], F[B]]): F[\/[A, B]]
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- def fpair[A](fa: F[A]): F[(A, A)]
Twin all
A
s infa
. - def fproduct[A, B](fa: F[A])(f: (A) => B): F[(A, B)]
Pair all
A
s infa
with the result of function application. - def functorLaw: FunctorLaw
- val functorSyntax: FunctorSyntax[F]
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def icompose[G[_]](implicit G0: Contravariant[G]): Contravariant[[α]F[G[α]]]
The composition of Functor F and Contravariant G,
[x]F[G[x]]
, is contravariant. - def invariantFunctorLaw: InvariantFunctorLaw
- Definition Classes
- InvariantFunctor
- val invariantFunctorSyntax: InvariantFunctorSyntax[F]
- Definition Classes
- InvariantFunctor
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def lift[A, B](f: (A) => B): (F[A]) => F[B]
Lift
f
intoF
. - def mapply[A, B](a: A)(f: F[(A) => B]): F[B]
Lift
apply(a)
, and apply the result tof
. - final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def product[G[_]](implicit G0: Functor[G]): Functor[[α](F[α], G[α])]
The product of Functors
F
andG
,[x](F[x], G[x]])
, is a Functor - def strengthL[A, B](a: A, f: F[B]): F[(A, B)]
Inject
a
to the left ofB
s inf
. - def strengthR[A, B](f: F[A], b: B): F[(A, B)]
Inject
b
to the right ofA
s inf
. - final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- def void[A](fa: F[A]): F[Unit]
Empty
fa
of meaningful pure values, preserving its structure. - final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- def widen[A, B](fa: F[A])(implicit ev: <~<[A, B]): F[B]
Functors are covariant by nature, so we can treat an
F[A]
as anF[B]
ifA
is a subtype ofB
. - def xmap[A, B](fa: F[A], f: (A) => B, g: (B) => A): F[B]
Converts
ma
to a value of typeF[B]
using the provided functionsf
andg
.Converts
ma
to a value of typeF[B]
using the provided functionsf
andg
.- Definition Classes
- Functor → InvariantFunctor
- def xmapb[A, B](ma: F[A])(b: Bijection[A, B]): F[B]
Converts
ma
to a value of typeF[B]
using the provided bijection.Converts
ma
to a value of typeF[B]
using the provided bijection.- Definition Classes
- InvariantFunctor
- def xmapi[A, B](ma: F[A])(iso: Isomorphism.<=>[A, B]): F[B]
Converts
ma
to a value of typeF[B]
using the provided isomorphism.Converts
ma
to a value of typeF[B]
using the provided isomorphism.- Definition Classes
- InvariantFunctor