A
- the output that might fail to be producedB
- the input that guarantees its outputS
- the input that might fail to map to its outputT
- the guaranteed outputpublic final class Market<A,B,S,T> extends Object implements MonadRec<T,Market<A,B,S,?>>, Cocartesian<S,T,Market<A,B,?,?>>
Prism
is composed of.Constructor and Description |
---|
Market(Fn1<? super B,? extends T> bt,
Fn1<? super S,? extends Either<T,A>> sta) |
Modifier and Type | Method and Description |
---|---|
Fn1<? super B,? extends T> |
bt()
Extract the mapping
B -> T . |
<C> Market<A,B,Choice2<C,S>,Choice2<C,T>> |
cocartesian()
Choose some type
C or this profunctor's carrier types. |
<R> Market<A,B,R,T> |
contraMap(Fn1<? super R,? extends S> fn)
Contravariantly map
A <- B . |
<R,U> Market<A,B,R,U> |
diMap(Fn1<? super R,? extends S> lFn,
Fn1<? super T,? extends U> rFn)
Dually map contravariantly over the left parameter and covariantly over the right parameter.
|
<R> Market<A,B,R,T> |
diMapL(Fn1<? super R,? extends S> fn)
Contravariantly map over the left parameter.
|
<U> Market<A,B,S,U> |
diMapR(Fn1<? super T,? extends U> fn)
Covariantly map over the right parameter.
|
<U> Market<A,B,S,U> |
flatMap(Fn1<? super T,? extends Monad<U,Market<A,B,S,?>>> f)
Chain dependent computations that may continue or short-circuit based on previous results.
|
<U> Market<A,B,S,U> |
fmap(Fn1<? super T,? extends U> fn)
Covariantly transmute this functor's parameter using the given mapping function.
|
<U> Market<A,B,S,U> |
pure(U u)
Lift the value
b into this applicative functor. |
static <A,B,S> Pure<Market<A,B,S,?>> |
pureMarket()
|
Fn1<? super S,? extends Either<T,A>> |
sta()
Extract the mapping
S -> . |
<U> Market<A,B,S,U> |
trampolineM(Fn1<? super T,? extends MonadRec<RecursiveResult<T,U>,Market<A,B,S,?>>> fn)
Given some operation yielding a
RecursiveResult inside this MonadRec , internally trampoline the
operation until it yields a termination instruction. |
<U> Market<A,B,S,U> |
zip(Applicative<Fn1<? super T,? extends U>,Market<A,B,S,?>> appFn)
Given another instance of this applicative over a mapping function, "zip" the two instances together using
whatever application semantics the current applicative supports.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
discardL, discardR, lazyZip
choose
public <U> Market<A,B,S,U> pure(U u)
b
into this applicative functor.pure
in interface Applicative<T,Market<A,B,S,?>>
pure
in interface Monad<T,Market<A,B,S,?>>
pure
in interface MonadRec<T,Market<A,B,S,?>>
U
- the type of the returned applicative's parameteru
- the valuepublic <U> Market<A,B,S,U> flatMap(Fn1<? super T,? extends Monad<U,Market<A,B,S,?>>> f)
public <U> Market<A,B,S,U> trampolineM(Fn1<? super T,? extends MonadRec<RecursiveResult<T,U>,Market<A,B,S,?>>> fn)
RecursiveResult
inside this MonadRec
, internally trampoline the
operation until it yields a termination
instruction.
Stack-safety depends on implementations guaranteeing that the growth of the call stack is a constant factor independent of the number of invocations of the operation. For various examples of how this can be achieved in stereotypical circumstances, see the referenced types.
trampolineM
in interface MonadRec<T,Market<A,B,S,?>>
U
- the ultimate resulting carrier typefn
- the function to internally trampolineMonadRec
for a basic implementation
,
for a {@link CoProduct2 coproduct} implementation
,
for an implementation leveraging an already stack-safe {@link Monad#flatMap(Fn1)}
,
for a {@link MonadT monad transformer} implementation
public <U> Market<A,B,S,U> zip(Applicative<Fn1<? super T,? extends U>,Market<A,B,S,?>> appFn)
zip
in interface Applicative<T,Market<A,B,S,?>>
zip
in interface Monad<T,Market<A,B,S,?>>
zip
in interface MonadRec<T,Market<A,B,S,?>>
U
- the resulting applicative parameter typeappFn
- the other applicative instancepublic <U> Market<A,B,S,U> fmap(Fn1<? super T,? extends U> fn)
fmap
in interface Applicative<T,Market<A,B,S,?>>
fmap
in interface Functor<T,Market<A,B,S,?>>
fmap
in interface Monad<T,Market<A,B,S,?>>
fmap
in interface MonadRec<T,Market<A,B,S,?>>
U
- the new parameter typefn
- the mapping functionpublic <C> Market<A,B,Choice2<C,S>,Choice2<C,T>> cocartesian()
C
or this profunctor's carrier types.cocartesian
in interface Cocartesian<S,T,Market<A,B,?,?>>
C
- the choice typepublic <R,U> Market<A,B,R,U> diMap(Fn1<? super R,? extends S> lFn, Fn1<? super T,? extends U> rFn)
diMapL(lFn).diMapR(rFn)
.diMap
in interface Cocartesian<S,T,Market<A,B,?,?>>
diMap
in interface Profunctor<S,T,Market<A,B,?,?>>
R
- the new left parameter typeU
- the new right parameter typelFn
- the left parameter mapping functionrFn
- the right parameter mapping functionpublic <R> Market<A,B,R,T> diMapL(Fn1<? super R,? extends S> fn)
diMapL
in interface Cocartesian<S,T,Market<A,B,?,?>>
diMapL
in interface Profunctor<S,T,Market<A,B,?,?>>
R
- the new left parameter typefn
- the mapping functionpublic <U> Market<A,B,S,U> diMapR(Fn1<? super T,? extends U> fn)
diMapR(f) == fmap(f)
.diMapR
in interface Cocartesian<S,T,Market<A,B,?,?>>
diMapR
in interface Profunctor<S,T,Market<A,B,?,?>>
U
- the new right parameter typefn
- the mapping functionpublic <R> Market<A,B,R,T> contraMap(Fn1<? super R,? extends S> fn)
A <- B
.contraMap
in interface Cocartesian<S,T,Market<A,B,?,?>>
contraMap
in interface Contravariant<S,Profunctor<?,T,Market<A,B,?,?>>>
contraMap
in interface Profunctor<S,T,Market<A,B,?,?>>
R
- the new parameter typefn
- the mapping function