Class Exchange<A,B,S,T>
java.lang.Object
com.jnape.palatable.lambda.functor.builtin.Exchange<A,B,S,T>
- Type Parameters:
A- the smaller viewed value of anIsoB- the smaller viewing value of anIsoS- the larger viewing value of anIsoT- the larger viewed value of anIso
- All Implemented Interfaces:
Contravariant<S, Profunctor<?, T, Exchange<A,B, ?, ?>>>, Profunctor<S, T, Exchange<A, B, ?, ?>>
A profunctor used to extract the isomorphic functions an
Iso is composed of.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbt()Extract the mappingB -> T.Contravariantly mapA <- B.Dually map contravariantly over the left parameter and covariantly over the right parameter.Contravariantly map over the left parameter.Covariantly map over the right parameter.sa()Extract the mappingS -> A.
-
Field Details
-
sa
-
bt
-
-
Constructor Details
-
Exchange
-
-
Method Details
-
sa
-
bt
-
diMap
public <Z,C> Exchange<A,B, diMapZ, C> (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. This is isomorphic todiMapL(lFn).diMapR(rFn).- Specified by:
diMapin interfaceProfunctor<A,B, S> - Type Parameters:
Z- the new left parameter typeC- the new right parameter type- Parameters:
lFn- the left parameter mapping functionrFn- the right parameter mapping function- Returns:
- a profunctor over Z (the new left parameter type) and C (the new right parameter type)
-
diMapL
Contravariantly map over the left parameter.- Specified by:
diMapLin interfaceProfunctor<A,B, S> - Type Parameters:
Z- the new left parameter type- Parameters:
fn- the mapping function- Returns:
- a profunctor over Z (the new left parameter type) and C (the same right parameter type)
-
diMapR
Covariantly map over the right parameter. For all profunctors that are also functors, it should hold thatdiMapR(f) == fmap(f).- Specified by:
diMapRin interfaceProfunctor<A,B, S> - Type Parameters:
C- the new right parameter type- Parameters:
fn- the mapping function- Returns:
- a profunctor over A (the same left parameter type) and C (the new right parameter type)
-
contraMap
Contravariantly mapA <- B.- Specified by:
contraMapin interfaceContravariant<A,B> - Specified by:
contraMapin interfaceProfunctor<A,B, S> - Type Parameters:
Z- the new parameter type- Parameters:
fn- the mapping function- Returns:
- the mapped Contravariant functor instance
-