Functor

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.

See also
Companion
object
class Object
trait Matchable
class Any
trait Align[F]
trait Apply[F]
trait Applicative[F]
trait Alt[F]
trait IsomorphismAlt[F, G]
trait ApplicativeError[F, S]
trait MonadError[F, S]
trait MonadPlus[F]
trait IsomorphismMonadTell[F, G, S]
trait Monad[F]
trait MonadReader[F, S]
trait MonadState[F, S]
trait MonadTell[F, S]
trait MonadListen[F, W]
trait Bind[F]
trait BindRec[F]
trait IsomorphismBind[F, G]
trait Cobind[F]
trait Comonad[F]
trait ComonadStore[F, S]
trait Distributive[F]
trait OverrideWiden[F]
trait Traverse[F]
trait Traverse1[F]

Type members

Classlikes

Inherited classlikes

Value members

Abstract methods

def map[A, B](fa: F[A])(f: A => B): F[B]

Lift f into F and apply to F[A].

Lift f into F and apply to F[A].

Concrete methods

def apply[A, B](fa: F[A])(f: A => B): F[B]

Alias for map.

Alias for map.

def bicompose[G[_, _] : Bifunctor]: Bifunctor[[α, β] =>> F[G[α, β]]]

The composition of Functor F and Bifunctor G, [x, y]F[G[x, y]], is a Bifunctor

The composition of Functor F and Bifunctor G, [x, y]F[G[x, y]], is a Bifunctor

def compose[G[_]](implicit G0: Functor[G]): Functor[[α] =>> F[G[α]]]

The composition of Functors F and G, [x]F[G[x]], is a Functor

The composition of Functors F and G, [x]F[G[x]], is a Functor

def counzip[A, B](a: F[A] \/ F[B]): F[A \/ B]
def fpair[A](fa: F[A]): F[(A, A)]

Twin all As in fa.

Twin all As in fa.

def fproduct[A, B](fa: F[A])(f: A => B): F[(A, B)]

Pair all As in fa with the result of function application.

Pair all As in fa with the result of function application.

def icompose[G[_]](implicit G0: Contravariant[G]): Contravariant[[α] =>> F[G[α]]]

The composition of Functor F and Contravariant G, [x]F[G[x]], is contravariant.

The composition of Functor F and Contravariant G, [x]F[G[x]], is contravariant.

def lift[A, B](f: A => B): F[A] => F[B]

Lift f into F.

Lift f into F.

def mapply[A, B](a: A)(f: F[A => B]): F[B]

Lift apply(a), and apply the result to f.

Lift apply(a), and apply the result to f.

def product[G[_]](implicit G0: Functor[G]): Functor[[α] =>> (F[α], G[α])]

The product of Functors F and G, [x](F[x], G[x]]), is a Functor

The product of Functors F and G, [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 of Bs in f.

Inject a to the left of Bs in f.

def strengthR[A, B](f: F[A], b: B): F[(A, B)]

Inject b to the right of As in f.

Inject b to the right of As in f.

def void[A](fa: F[A]): F[Unit]

Empty fa of meaningful pure values, preserving its structure.

Empty fa of meaningful pure values, preserving its structure.

def widen[A, B](fa: F[A])(implicit ev: Liskov[A, B]): F[B]

Functors are covariant by nature, so we can treat an F[A] as an F[B] if A is a subtype of B.

Functors are covariant by nature, so we can treat an F[A] as an F[B] if A is a subtype of B.

def xmap[A, B](fa: F[A], f: A => B, g: B => A): F[B]

Inherited methods

def xmapb[A, B](ma: F[A])(b: Bijection[A, B]): F[B]

Converts ma to a value of type F[B] using the provided bijection.

Converts ma to a value of type F[B] using the provided bijection.

Inherited from
InvariantFunctor
def xmapi[A, B](ma: F[A])(iso: IsoSet[A, B]): F[B]

Converts ma to a value of type F[B] using the provided isomorphism.

Converts ma to a value of type F[B] using the provided isomorphism.

Inherited from
InvariantFunctor

Concrete fields

Inherited fields