A
- the type of the left parameterB
- the type of the left parameterP
- the unification parameterpublic interface Cocartesian<A,B,P extends Cocartesian<?,?,P>> extends Profunctor<A,B,P>
Modifier and Type | Method and Description |
---|---|
default Cocartesian<A,Choice2<A,B>,P> |
choose()
Choose between the covariantly-positioned carrier type and the contravariantly-positioned carrier type.
|
<C> Cocartesian<Choice2<C,A>,Choice2<C,B>,P> |
cocartesian()
Choose some type
C or this profunctor's carrier types. |
default <Z> Cocartesian<Z,B,P> |
contraMap(Fn1<? super Z,? extends A> fn)
Contravariantly map
A <- B . |
<Z,C> Cocartesian<Z,C,P> |
diMap(Fn1<? super Z,? extends A> lFn,
Fn1<? super B,? extends C> rFn)
Dually map contravariantly over the left parameter and covariantly over the right parameter.
|
default <Z> Cocartesian<Z,B,P> |
diMapL(Fn1<? super Z,? extends A> fn)
Contravariantly map over the left parameter.
|
default <C> Cocartesian<A,C,P> |
diMapR(Fn1<? super B,? extends C> fn)
Covariantly map over the right parameter.
|
<C> Cocartesian<Choice2<C,A>,Choice2<C,B>,P> cocartesian()
C
or this profunctor's carrier types.C
- the choice typedefault Cocartesian<A,Choice2<A,B>,P> choose()
a -> (_|_ v b)
as total functions
a -> (a v b)
.<Z,C> Cocartesian<Z,C,P> diMap(Fn1<? super Z,? extends A> lFn, Fn1<? super B,? extends C> rFn)
diMapL(lFn).diMapR(rFn)
.diMap
in interface Profunctor<A,B,P extends Cocartesian<?,?,P>>
Z
- the new left parameter typeC
- the new right parameter typelFn
- the left parameter mapping functionrFn
- the right parameter mapping functiondefault <Z> Cocartesian<Z,B,P> diMapL(Fn1<? super Z,? extends A> fn)
diMapL
in interface Profunctor<A,B,P extends Cocartesian<?,?,P>>
Z
- the new left parameter typefn
- the mapping functiondefault <C> Cocartesian<A,C,P> diMapR(Fn1<? super B,? extends C> fn)
diMapR(f) == fmap(f)
.diMapR
in interface Profunctor<A,B,P extends Cocartesian<?,?,P>>
C
- the new right parameter typefn
- the mapping functiondefault <Z> Cocartesian<Z,B,P> contraMap(Fn1<? super Z,? extends A> fn)
A <- B
.contraMap
in interface Contravariant<A,Profunctor<?,B,P extends Cocartesian<?,?,P>>>
contraMap
in interface Profunctor<A,B,P extends Cocartesian<?,?,P>>
Z
- the new parameter typefn
- the mapping function