F
- The outer applicativeG
- The inner applicativeA
- The carrier typepublic final class Compose<F extends Applicative<?,F>,G extends Applicative<?,G>,A> extends Object implements Applicative<A,Compose<F,G,?>>
Applicative
functors; useful for preserving nested
type-level transformations during traversal of a Traversable
.Constructor and Description |
---|
Compose(Applicative<? extends Applicative<A,G>,F> fga) |
Modifier and Type | Method and Description |
---|---|
<B> Compose<F,G,B> |
discardL(Applicative<B,Compose<F,G,?>> appB)
Sequence both this
Applicative and appB , discarding this Applicative's
result and returning appB . |
<B> Compose<F,G,A> |
discardR(Applicative<B,Compose<F,G,?>> appB)
Sequence both this
Applicative and appB , discarding appB's result and
returning this Applicative . |
boolean |
equals(Object other) |
<B> Compose<F,G,B> |
fmap(Fn1<? super A,? extends B> fn)
Covariantly transmute this functor's parameter using the given mapping function.
|
<GA extends Applicative<A,G>,FGA extends Applicative<GA,F>> |
getCompose() |
int |
hashCode() |
<B> Lazy<Compose<F,G,B>> |
lazyZip(Lazy<? extends Applicative<Fn1<? super A,? extends B>,Compose<F,G,?>>> lazyAppFn)
Given a
lazy instance of this applicative over a mapping function, "zip" the two instances together
using whatever application semantics the current applicative supports. |
<B> Compose<F,G,B> |
pure(B b)
Lift the value
b into this applicative functor. |
static <F extends Applicative<?,F>,G extends Applicative<?,G>> |
pureCompose(Pure<F> pureF,
Pure<G> pureG)
|
String |
toString() |
<B> Compose<F,G,B> |
zip(Applicative<Fn1<? super A,? extends B>,Compose<F,G,?>> appFn)
Given another instance of this applicative over a mapping function, "zip" the two instances together using
whatever application semantics the current applicative supports.
|
public Compose(Applicative<? extends Applicative<A,G>,F> fga)
public <GA extends Applicative<A,G>,FGA extends Applicative<GA,F>> FGA getCompose()
public <B> Compose<F,G,B> fmap(Fn1<? super A,? extends B> fn)
fmap
in interface Applicative<A,Compose<F extends Applicative<?,F>,G extends Applicative<?,G>,?>>
fmap
in interface Functor<A,Compose<F extends Applicative<?,F>,G extends Applicative<?,G>,?>>
B
- the new parameter typefn
- the mapping functionpublic <B> Compose<F,G,B> pure(B b)
b
into this applicative functor.pure
in interface Applicative<A,Compose<F extends Applicative<?,F>,G extends Applicative<?,G>,?>>
B
- the type of the returned applicative's parameterb
- the valuepublic <B> Compose<F,G,B> zip(Applicative<Fn1<? super A,? extends B>,Compose<F,G,?>> appFn)
zip
in interface Applicative<A,Compose<F extends Applicative<?,F>,G extends Applicative<?,G>,?>>
B
- the resulting applicative parameter typeappFn
- the other applicative instancepublic <B> Lazy<Compose<F,G,B>> lazyZip(Lazy<? extends Applicative<Fn1<? super A,? extends B>,Compose<F,G,?>>> lazyAppFn)
lazy
instance of this applicative over a mapping function, "zip" the two instances together
using whatever application semantics the current applicative supports. This is useful for applicatives that
support lazy evaluation and early termination.lazyZip
in interface Applicative<A,Compose<F extends Applicative<?,F>,G extends Applicative<?,G>,?>>
B
- the resulting applicative parameter typelazyAppFn
- the lazy other applicative instanceMaybe
,
Either
public <B> Compose<F,G,B> discardL(Applicative<B,Compose<F,G,?>> appB)
Applicative
and appB
, discarding this Applicative's
result and returning appB
. This is generally useful for sequentially performing side-effects.discardL
in interface Applicative<A,Compose<F extends Applicative<?,F>,G extends Applicative<?,G>,?>>
B
- the type of the returned Applicative's parameterappB
- the other Applicativepublic <B> Compose<F,G,A> discardR(Applicative<B,Compose<F,G,?>> appB)
Applicative
and appB
, discarding appB's
result and
returning this Applicative
. This is generally useful for sequentially performing side-effects.discardR
in interface Applicative<A,Compose<F extends Applicative<?,F>,G extends Applicative<?,G>,?>>
B
- the type of appB's parameterappB
- the other Applicativepublic static <F extends Applicative<?,F>,G extends Applicative<?,G>> Pure<Compose<F,G,?>> pureCompose(Pure<F> pureF, Pure<G> pureG)
F
- the outer Applicative
typeG
- the inner Applicative
typepureF
- the Pure
constructor for the outer Applicative
pureG
- the Pure
constructor for the inner Applicative
Pure
instance