t

scalaz

# Functor 

### Companion object 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.

Self Type
Functor[F]
Source
Functor.scala
See also

scalaz.Functor.FunctorLaw

Linear Supertypes
Ordering
1. Alphabetic
2. By Inheritance
Inherited
1. Functor
2. InvariantFunctor
3. AnyRef
4. Any
1. Hide All
2. Show All
Visibility
1. Public
2. All

### Type Members

1. trait FunctorLaw extends InvariantFunctorLaw
2. trait InvariantFunctorLaw extends AnyRef
Definition Classes
InvariantFunctor

### Abstract Value Members

1. abstract def map[A, B](fa: F[A])(f: (A) ⇒ B): F[B]

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

### Concrete Value Members

1. final def !=(arg0: Any)
Definition Classes
AnyRef → Any
2. final def ##(): Int
Definition Classes
AnyRef → Any
3. final def ==(arg0: Any)
Definition Classes
AnyRef → Any
4. def apply[A, B](fa: F[A])(f: (A) ⇒ B): F[B]

Alias for `map`.

5. final def asInstanceOf[T0]: T0
Definition Classes
Any
6. def bicompose[G[_, _]](implicit arg0: Bifunctor[G]): Bifunctor[[α, β]F[G[α, β]]]

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

7. def clone()
Attributes
protected[java.lang]
Definition Classes
AnyRef
Annotations
@native() @throws( ... )
8. def compose[G[_]](implicit G0: Functor[G]): Functor[[α]F[G[α]]]

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

9. def counzip[A, B](a: \/[F[A], F[B]]): F[\/[A, B]]
10. final def eq(arg0: AnyRef)
Definition Classes
AnyRef
11. def equals(arg0: Any)
Definition Classes
AnyRef → Any
12. def finalize(): Unit
Attributes
protected[java.lang]
Definition Classes
AnyRef
Annotations
@throws( classOf[java.lang.Throwable] )
13. def fpair[A](fa: F[A]): F[(A, A)]

Twin all `A`s in `fa`.

14. def fproduct[A, B](fa: F[A])(f: (A) ⇒ B): F[(A, B)]

Pair all `A`s in `fa` with the result of function application.

15. def functorLaw
16. val functorSyntax: FunctorSyntax[F]
17. final def getClass(): Class[_]
Definition Classes
AnyRef → Any
Annotations
@native()
18. def hashCode(): Int
Definition Classes
AnyRef → Any
Annotations
@native()
19. def icompose[G[_]](implicit G0: Contravariant[G]): Contravariant[[α]F[G[α]]]

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

20. def invariantFunctorLaw
Definition Classes
InvariantFunctor
21. val invariantFunctorSyntax
Definition Classes
InvariantFunctor
22. final def isInstanceOf[T0]
Definition Classes
Any
23. def lift[A, B](f: (A) ⇒ B): (F[A]) ⇒ F[B]

Lift `f` into `F`.

24. def mapply[A, B](a: A)(f: F[(A) ⇒ B]): F[B]

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

25. final def ne(arg0: AnyRef)
Definition Classes
AnyRef
26. final def notify(): Unit
Definition Classes
AnyRef
Annotations
@native()
27. final def notifyAll(): Unit
Definition Classes
AnyRef
Annotations
@native()
28. 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

29. def strengthL[A, B](a: A, f: F[B]): F[(A, B)]

Inject `a` to the left of `B`s in `f`.

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

Inject `b` to the right of `A`s in `f`.

31. final def synchronized[T0](arg0: ⇒ T0): T0
Definition Classes
AnyRef
32. def toString()
Definition Classes
AnyRef → Any
33. def void[A](fa: F[A]): F[Unit]

Empty `fa` of meaningful pure values, preserving its structure.

34. final def wait(): Unit
Definition Classes
AnyRef
Annotations
@throws( ... )
35. final def wait(arg0: Long, arg1: Int): Unit
Definition Classes
AnyRef
Annotations
@throws( ... )
36. final def wait(arg0: Long): Unit
Definition Classes
AnyRef
Annotations
@native() @throws( ... )
37. 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 an `F[B]` if `A` is a subtype of `B`.

38. def xmap[A, B](fa: F[A], f: (A) ⇒ B, g: (B) ⇒ A): F[B]

Converts `ma` to a value of type `F[B]` using the provided functions `f` and `g`.

Converts `ma` to a value of type `F[B]` using the provided functions `f` and `g`.

Definition Classes
FunctorInvariantFunctor
39. 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.

Definition Classes
InvariantFunctor
40. def xmapi[A, B](ma: F[A])(iso: Isomorphism.<=>[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.

Definition Classes
InvariantFunctor