scalaz

# Applicative

#### trait Applicative[F[_]] extends Apply[F]

Applicative Functor, described in Applicative Programming with Effects

Whereas a scalaz.Functor allows application of a pure function to a value in a context, an Applicative also allows application of a function in a context to a value in a context (`ap`).

It follows that a pure function can be applied to arguments in a context. (See `map2`, `map3`, ... )

Applicative instances come in a few flavours:

• All scalaz.Monads are also `Applicative`
• Any scalaz.Monoid can be treated as an Applicative (see scalaz.Monoid#applicative)
• Zipping together corresponding elements of Naperian data structures (those of of a fixed, possibly infinite shape)
Self Type
Applicative[F]
Source
Applicative.scala
Linear Supertypes
Apply[F], Functor[F], AnyRef, Any
Ordering
1. Alphabetic
2. By inheritance
Inherited
1. Applicative
2. Apply
3. Functor
4. AnyRef
5. Any
1. Hide All
2. Show all
Visibility
1. Public
2. All

### Type Members

2. #### trait FunctorLaw extends AnyRef

Definition Classes
Functor

### Abstract Value Members

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

Definition Classes
Apply

### Concrete Value Members

1. #### final def !=(arg0: AnyRef): Boolean

Definition Classes
AnyRef
2. #### final def !=(arg0: Any): Boolean

Definition Classes
Any
3. #### final def ##(): Int

Definition Classes
AnyRef → Any
4. #### final def ==(arg0: AnyRef): Boolean

Definition Classes
AnyRef
5. #### final def ==(arg0: Any): Boolean

Definition Classes
Any
6. #### def ap2[A, B, C](fa: ⇒ F[A], fb: ⇒ F[B])(f: F[(A, B) ⇒ C]): F[C]

Definition Classes
Apply
7. #### def ap3[A, B, C, D](fa: ⇒ F[A], fb: ⇒ F[B], fc: ⇒ F[C])(f: F[(A, B, C) ⇒ D]): F[D]

Definition Classes
Apply
8. #### def ap4[A, B, C, D, E](fa: ⇒ F[A], fb: ⇒ F[B], fc: ⇒ F[C], fd: ⇒ F[D])(f: F[(A, B, C, D) ⇒ E]): F[E]

Definition Classes
Apply
9. #### def ap5[A, B, C, D, E, R](fa: ⇒ F[A], fb: ⇒ F[B], fc: ⇒ F[C], fd: ⇒ F[D], fe: ⇒ F[E])(f: F[(A, B, C, D, E) ⇒ R]): F[R]

Definition Classes
Apply
10. #### def ap6[A, B, C, D, E, FF, R](fa: ⇒ F[A], fb: ⇒ F[B], fc: ⇒ F[C], fd: ⇒ F[D], fe: ⇒ F[E], ff: ⇒ F[FF])(f: F[(A, B, C, D, E, FF) ⇒ R]): F[R]

Definition Classes
Apply
11. #### def ap7[A, B, C, D, E, FF, G, R](fa: ⇒ F[A], fb: ⇒ F[B], fc: ⇒ F[C], fd: ⇒ F[D], fe: ⇒ F[E], ff: ⇒ F[FF], fg: ⇒ F[G])(f: F[(A, B, C, D, E, FF, G) ⇒ R]): F[R]

Definition Classes
Apply
12. #### def ap8[A, B, C, D, E, FF, G, H, R](fa: ⇒ F[A], fb: ⇒ F[B], fc: ⇒ F[C], fd: ⇒ F[D], fe: ⇒ F[E], ff: ⇒ F[FF], fg: ⇒ F[G], fh: ⇒ F[H])(f: F[(A, B, C, D, E, FF, G, H) ⇒ R]): F[R]

Definition Classes
Apply
13. #### def apF[A, B](f: ⇒ F[(A) ⇒ B]): (F[A]) ⇒ F[B]

Flipped variant of `ap`.

Flipped variant of `ap`.

Definition Classes
Apply

16. #### def apply[A, B](fa: F[A])(f: (A) ⇒ B): F[B]

Alias for `map`.

Alias for `map`.

Definition Classes
Functor
17. #### def apply10[A, B, C, D, E, FF, G, H, I, J, R](fa: ⇒ F[A], fb: ⇒ F[B], fc: ⇒ F[C], fd: ⇒ F[D], fe: ⇒ F[E], ff: ⇒ F[FF], fg: ⇒ F[G], fh: ⇒ F[H], fi: ⇒ F[I], fj: ⇒ F[J])(f: (A, B, C, D, E, FF, G, H, I, J) ⇒ R): F[R]

Definition Classes
Apply
18. #### def apply11[A, B, C, D, E, FF, G, H, I, J, K, R](fa: ⇒ F[A], fb: ⇒ F[B], fc: ⇒ F[C], fd: ⇒ F[D], fe: ⇒ F[E], ff: ⇒ F[FF], fg: ⇒ F[G], fh: ⇒ F[H], fi: ⇒ F[I], fj: ⇒ F[J], fk: ⇒ F[K])(f: (A, B, C, D, E, FF, G, H, I, J, K) ⇒ R): F[R]

Definition Classes
Apply
19. #### def apply12[A, B, C, D, E, FF, G, H, I, J, K, L, R](fa: ⇒ F[A], fb: ⇒ F[B], fc: ⇒ F[C], fd: ⇒ F[D], fe: ⇒ F[E], ff: ⇒ F[FF], fg: ⇒ F[G], fh: ⇒ F[H], fi: ⇒ F[I], fj: ⇒ F[J], fk: ⇒ F[K], fl: ⇒ F[L])(f: (A, B, C, D, E, FF, G, H, I, J, K, L) ⇒ R): F[R]

Definition Classes
Apply
20. #### def apply2[A, B, C](fa: ⇒ F[A], fb: ⇒ F[B])(f: (A, B) ⇒ C): F[C]

Definition Classes
ApplicativeApply
21. #### def apply3[A, B, C, D](fa: ⇒ F[A], fb: ⇒ F[B], fc: ⇒ F[C])(f: (A, B, C) ⇒ D): F[D]

Definition Classes
Apply
22. #### def apply4[A, B, C, D, E](fa: ⇒ F[A], fb: ⇒ F[B], fc: ⇒ F[C], fd: ⇒ F[D])(f: (A, B, C, D) ⇒ E): F[E]

Definition Classes
Apply
23. #### def apply5[A, B, C, D, E, R](fa: ⇒ F[A], fb: ⇒ F[B], fc: ⇒ F[C], fd: ⇒ F[D], fe: ⇒ F[E])(f: (A, B, C, D, E) ⇒ R): F[R]

Definition Classes
Apply
24. #### def apply6[A, B, C, D, E, FF, R](fa: ⇒ F[A], fb: ⇒ F[B], fc: ⇒ F[C], fd: ⇒ F[D], fe: ⇒ F[E], ff: ⇒ F[FF])(f: (A, B, C, D, E, FF) ⇒ R): F[R]

Definition Classes
Apply
25. #### def apply7[A, B, C, D, E, FF, G, R](fa: ⇒ F[A], fb: ⇒ F[B], fc: ⇒ F[C], fd: ⇒ F[D], fe: ⇒ F[E], ff: ⇒ F[FF], fg: ⇒ F[G])(f: (A, B, C, D, E, FF, G) ⇒ R): F[R]

Definition Classes
Apply
26. #### def apply8[A, B, C, D, E, FF, G, H, R](fa: ⇒ F[A], fb: ⇒ F[B], fc: ⇒ F[C], fd: ⇒ F[D], fe: ⇒ F[E], ff: ⇒ F[FF], fg: ⇒ F[G], fh: ⇒ F[H])(f: (A, B, C, D, E, FF, G, H) ⇒ R): F[R]

Definition Classes
Apply
27. #### def apply9[A, B, C, D, E, FF, G, H, I, R](fa: ⇒ F[A], fb: ⇒ F[B], fc: ⇒ F[C], fd: ⇒ F[D], fe: ⇒ F[E], ff: ⇒ F[FF], fg: ⇒ F[G], fh: ⇒ F[H], fi: ⇒ F[I])(f: (A, B, C, D, E, FF, G, H, I) ⇒ R): F[R]

Definition Classes
Apply
28. #### val applySyntax: ApplySyntax[F]

Definition Classes
Apply
29. #### final def asInstanceOf[T0]: T0

Definition Classes
Any
30. #### def clone(): AnyRef

Attributes
protected[java.lang]
Definition Classes
AnyRef
Annotations
@throws( ... )
31. #### def compose[G[_]](implicit G0: Applicative[G]): Applicative[[α]F[G[α]]]

The composition of Applicatives `F` and `G`, `[x]F[G[x]]`, is an Applicative

32. #### def compose[G[_]](implicit G0: Apply[G]): Apply[[α]F[G[α]]]

The composition of Applys `F` and `G`, `[x]F[G[x]]`, is a Apply

The composition of Applys `F` and `G`, `[x]F[G[x]]`, is a Apply

Definition Classes
Apply
33. #### 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

Definition Classes
Functor
34. #### def counzip[A, B](a: \/[F[A], F[B]]): F[\/[A, B]]

Definition Classes
Functor
35. #### final def eq(arg0: AnyRef): Boolean

Definition Classes
AnyRef
36. #### def equals(arg0: Any): Boolean

Definition Classes
AnyRef → Any
37. #### def filterM[A](l: List[A])(f: (A) ⇒ F[Boolean]): F[List[A]]

Filter `l` according to an applicative predicate.

38. #### def finalize(): Unit

Attributes
protected[java.lang]
Definition Classes
AnyRef
Annotations
@throws( classOf[java.lang.Throwable] )
39. #### def flip: Applicative[F]

An `Applicative` for `F` in which effects happen in the opposite order.

40. #### def fpair[A](fa: F[A]): F[(A, A)]

Twin all `A`s in `fa`.

Twin all `A`s in `fa`.

Definition Classes
Functor
41. #### 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.

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

Definition Classes
Functor
42. #### def functorLaw: FunctorLaw

Definition Classes
Functor
43. #### val functorSyntax: FunctorSyntax[F]

Definition Classes
Functor
44. #### final def getClass(): Class[_]

Definition Classes
AnyRef → Any
45. #### def hashCode(): Int

Definition Classes
AnyRef → Any
46. #### final def isInstanceOf[T0]: Boolean

Definition Classes
Any
47. #### def lift[A, B](f: (A) ⇒ B): (F[A]) ⇒ F[B]

Lift `f` into `F`.

Lift `f` into `F`.

Definition Classes
Functor
48. #### def lift10[A, B, C, D, E, FF, G, H, I, J, R](f: (A, B, C, D, E, FF, G, H, I, J) ⇒ R): (F[A], F[B], F[C], F[D], F[E], F[FF], F[G], F[H], F[I], F[J]) ⇒ F[R]

Definition Classes
Apply
49. #### def lift11[A, B, C, D, E, FF, G, H, I, J, K, R](f: (A, B, C, D, E, FF, G, H, I, J, K) ⇒ R): (F[A], F[B], F[C], F[D], F[E], F[FF], F[G], F[H], F[I], F[J], F[K]) ⇒ F[R]

Definition Classes
Apply
50. #### def lift12[A, B, C, D, E, FF, G, H, I, J, K, L, R](f: (A, B, C, D, E, FF, G, H, I, J, K, L) ⇒ R): (F[A], F[B], F[C], F[D], F[E], F[FF], F[G], F[H], F[I], F[J], F[K], F[L]) ⇒ F[R]

Definition Classes
Apply
51. #### def lift2[A, B, C](f: (A, B) ⇒ C): (F[A], F[B]) ⇒ F[C]

Definition Classes
Apply
52. #### def lift3[A, B, C, D](f: (A, B, C) ⇒ D): (F[A], F[B], F[C]) ⇒ F[D]

Definition Classes
Apply
53. #### def lift4[A, B, C, D, E](f: (A, B, C, D) ⇒ E): (F[A], F[B], F[C], F[D]) ⇒ F[E]

Definition Classes
Apply
54. #### def lift5[A, B, C, D, E, R](f: (A, B, C, D, E) ⇒ R): (F[A], F[B], F[C], F[D], F[E]) ⇒ F[R]

Definition Classes
Apply
55. #### def lift6[A, B, C, D, E, FF, R](f: (A, B, C, D, E, FF) ⇒ R): (F[A], F[B], F[C], F[D], F[E], F[FF]) ⇒ F[R]

Definition Classes
Apply
56. #### def lift7[A, B, C, D, E, FF, G, R](f: (A, B, C, D, E, FF, G) ⇒ R): (F[A], F[B], F[C], F[D], F[E], F[FF], F[G]) ⇒ F[R]

Definition Classes
Apply
57. #### def lift8[A, B, C, D, E, FF, G, H, R](f: (A, B, C, D, E, FF, G, H) ⇒ R): (F[A], F[B], F[C], F[D], F[E], F[FF], F[G], F[H]) ⇒ F[R]

Definition Classes
Apply
58. #### def lift9[A, B, C, D, E, FF, G, H, I, R](f: (A, B, C, D, E, FF, G, H, I) ⇒ R): (F[A], F[B], F[C], F[D], F[E], F[FF], F[G], F[H], F[I]) ⇒ F[R]

Definition Classes
Apply
59. #### 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]`.

Definition Classes
ApplicativeFunctor
60. #### 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`.

Definition Classes
Functor
61. #### final def ne(arg0: AnyRef): Boolean

Definition Classes
AnyRef
62. #### final def notify(): Unit

Definition Classes
AnyRef
63. #### final def notifyAll(): Unit

Definition Classes
AnyRef
64. #### def product[G[_]](implicit G0: Applicative[G]): Applicative[[α](F[α], G[α])]

The product of Applicatives `F` and `G`, `[x](F[x], G[x]])`, is an Applicative

65. #### def product[G[_]](implicit G0: Apply[G]): Apply[[α](F[α], G[α])]

The product of Applys `F` and `G`, `[x](F[x], G[x]])`, is a Apply

The product of Applys `F` and `G`, `[x](F[x], G[x]])`, is a Apply

Definition Classes
Apply
66. #### 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

Definition Classes
Functor

68. #### def replicateM[A](n: Int, fa: F[A]): F[List[A]]

Performs the action `n` times, returning the list of results.

69. #### def replicateM_[A](n: Int, fa: F[A]): F[Unit]

Performs the action `n` times, returning nothing.

71. #### def sequence1[A, G[_]](as: G[F[A]])(implicit arg0: Traverse1[G]): F[G[A]]

Definition Classes
Apply
72. #### def strengthL[A, B](a: A, f: F[B]): F[(A, B)]

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

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

Definition Classes
Functor
73. #### def strengthR[A, B](f: F[A], b: B): F[(A, B)]

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

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

Definition Classes
Functor
74. #### final def synchronized[T0](arg0: ⇒ T0): T0

Definition Classes
AnyRef
75. #### def toString(): String

Definition Classes
AnyRef → Any

77. #### def traverse1[A, G[_], B](value: G[A])(f: (A) ⇒ F[B])(implicit G: Traverse1[G]): F[G[B]]

Definition Classes
Apply
78. #### def tuple2[A, B](fa: ⇒ F[A], fb: ⇒ F[B]): F[(A, B)]

Definition Classes
Apply
79. #### def tuple3[A, B, C](fa: ⇒ F[A], fb: ⇒ F[B], fc: F[C]): F[(A, B, C)]

Definition Classes
Apply
80. #### def tuple4[A, B, C, D](fa: ⇒ F[A], fb: ⇒ F[B], fc: ⇒ F[C], fd: ⇒ F[D]): F[(A, B, C, D)]

Definition Classes
Apply
81. #### def tuple5[A, B, C, D, E](fa: ⇒ F[A], fb: ⇒ F[B], fc: ⇒ F[C], fd: ⇒ F[D], fe: ⇒ F[E]): F[(A, B, C, D, E)]

Definition Classes
Apply
82. #### 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.

Definition Classes
Functor
83. #### final def wait(): Unit

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

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

Definition Classes
AnyRef
Annotations
@throws( ... )
86. #### def zip: Zip[F]

scalaz.Zip derived from `tuple2`.

scalaz.Zip derived from `tuple2`.

Definition Classes
Apply

### Deprecated Value Members

1. #### def map2[A, B, C](fa: ⇒ F[A], fb: ⇒ F[B])(f: (A, B) ⇒ C): F[C]

Definition Classes
Apply
Annotations
@deprecated
Deprecated

(Since version 7) given `F: Apply[F]` use `F(a,b)(f)` instead, or given `implicitly[Apply[F]]`, use `^(a,b)(f)`

2. #### def map3[A, B, C, D](fa: ⇒ F[A], fb: ⇒ F[B], fc: ⇒ F[C])(f: (A, B, C) ⇒ D): F[D]

Definition Classes
Apply
Annotations
@deprecated
Deprecated

(Since version 7) given `F: Apply[F]` use `F(a,b,c)(f)` instead, or given `implicitly[Apply[F]]`, use `^(a,b,c)(f)`

3. #### def map4[A, B, C, D, E](fa: ⇒ F[A], fb: ⇒ F[B], fc: ⇒ F[C], fd: ⇒ F[D])(f: (A, B, C, D) ⇒ E): F[E]

Definition Classes
Apply
Annotations
@deprecated
Deprecated

(Since version 7) given `F: Apply[F]` use `F(a,b,c,d)(f)` instead, or given `implicitly[Apply[F]]`, use `^(a,b,c,d)(f)`