A
- the smaller viewed value of an Iso
B
- the smaller viewing value of an Iso
S
- the larger viewing value of an Iso
T
- the larger viewed value of an Iso
public final class Exchange<A,B,S,T> extends Object implements Profunctor<S,T,Exchange<A,B,?,?>>
Iso
is composed of.Constructor and Description |
---|
Exchange(Fn1<? super S,? extends A> sa,
Fn1<? super B,? extends T> bt) |
Modifier and Type | Method and Description |
---|---|
Fn1<? super B,? extends T> |
bt()
Extract the mapping
B -> T . |
<Z> Exchange<A,B,Z,T> |
contraMap(Fn1<? super Z,? extends S> fn)
Contravariantly map
A <- B . |
<Z,C> Exchange<A,B,Z,C> |
diMap(Fn1<? super Z,? extends S> lFn,
Fn1<? super T,? extends C> rFn)
Dually map contravariantly over the left parameter and covariantly over the right parameter.
|
<Z> Exchange<A,B,Z,T> |
diMapL(Fn1<? super Z,? extends S> fn)
Contravariantly map over the left parameter.
|
<C> Exchange<A,B,S,C> |
diMapR(Fn1<? super T,? extends C> fn)
Covariantly map over the right parameter.
|
Fn1<? super S,? extends A> |
sa()
Extract the mapping
S -> A . |
public <Z,C> Exchange<A,B,Z,C> diMap(Fn1<? super Z,? extends S> lFn, Fn1<? super T,? extends C> rFn)
diMapL(lFn).diMapR(rFn)
.diMap
in interface Profunctor<S,T,Exchange<A,B,?,?>>
Z
- the new left parameter typeC
- the new right parameter typelFn
- the left parameter mapping functionrFn
- the right parameter mapping functionpublic <Z> Exchange<A,B,Z,T> diMapL(Fn1<? super Z,? extends S> fn)
public <C> Exchange<A,B,S,C> diMapR(Fn1<? super T,? extends C> fn)
diMapR(f) == fmap(f)
.public <Z> Exchange<A,B,Z,T> contraMap(Fn1<? super Z,? extends S> fn)
A <- B
.contraMap
in interface Contravariant<S,Profunctor<?,T,Exchange<A,B,?,?>>>
contraMap
in interface Profunctor<S,T,Exchange<A,B,?,?>>
Z
- the new parameter typefn
- the mapping function