Interface Cartesian<A,B,P extends Cartesian<?,?,P>>
-
- Type Parameters:
A- the type of the left parameterB- the type of the left parameterP- the unification parameter
- All Superinterfaces:
Contravariant<A,Profunctor<?,B,P>>,Profunctor<A,B,P>
- All Known Subinterfaces:
BiMonoidFactory<A,B,C>,BiPredicate<A,B>,BiSemigroupFactory<A,B,C>,Effect<A>,Fn0<A>,Fn1<A,B>,Fn2<A,B,C>,Fn3<A,B,C,D>,Fn4<A,B,C,D,E>,Fn5<A,B,C,D,E,F>,Fn6<A,B,C,D,E,F,G>,Fn7<A,B,C,D,E,F,G,H>,Fn8<A,B,C,D,E,F,G,H,I>,Kleisli<A,B,M,MB>,Monoid<A>,MonoidFactory<A,B>,Predicate<A>,Semigroup<A>,SemigroupFactory<A,B>
- All Known Implementing Classes:
$,Absent,AddAll,All,Alter,And,Any,AutoBracket,Between,Both,Bracket,CartesianProduct,CatMaybes,Clamp,CmpEq,CmpEqBy,CmpEqWith,Coalesce,Collapse,Collapse,Compare,Compose,Compose,Concat,Cons,Constantly,Cycle,Difference,Distinct,Downcast,Drop,DropWhile,Empty,Endo,EndoK,Eq,Filter,Find,First,Flatten,FoldLeft,FoldRight,Force,GroupBy,GT,GTBy,GTE,GTEBy,GTEWith,GTWith,Head,Id,IfThenElse,InGroupsOf,Init,Inits,Intersection,Intersperse,Into,Into1,Into3,Into4,Into5,Into6,Into7,Into8,Iterate,Join,Last,Last,LazyRec,LeftAll,LeftAll,LeftAny,LeftAny,LiftA2,LiftA3,LiftA4,LiftA5,LiftA6,LiftA7,LT,LTBy,LTE,LTEBy,LTEWith,LTWith,Magnetize,MagnetizeBy,Map,Matching,Max,MaxBy,MaxWith,Merge,Merge,MergeHMaps,MergeMaps,Min,MinBy,MinWith,Not,Occurrences,Or,Over,Partition,Peek,Peek2,Pre,PrependAll,Present,PutAll,RateLimit,Re,ReaderT,ReduceLeft,ReduceRight,Repeat,Replicate,Reverse,RightAll,RightAll,RightAny,RightAny,RunAll,RunAll,ScanLeft,Sequence,Set,Size,Slide,Snoc,Sort,SortBy,SortWith,Span,Tail,Tails,Take,TakeWhile,Times,ToArray,ToCollection,ToMap,Trampoline,Trivial,Tupler2,Uncons,Under,Unfoldr,Union,Until,Upcast,View,Xor,Zip,ZipWith
public interface Cartesian<A,B,P extends Cartesian<?,?,P>> extends Profunctor<A,B,P>
- See Also:
Fn1,Cocartesian
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default Cartesian<A,Tuple2<A,B>,P>carry()Pair the covariantly-positioned carrier type with the contravariantly-positioned carrier type.<C> Cartesian<Tuple2<C,A>,Tuple2<C,B>,P>cartesian()Pair some typeCto this profunctor's carrier types.default <Z> Cartesian<Z,B,P>contraMap(Fn1<? super Z,? extends A> fn)Contravariantly mapA <- B.<Z,C>
Cartesian<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> Cartesian<Z,B,P>diMapL(Fn1<? super Z,? extends A> fn)Contravariantly map over the left parameter.default <C> Cartesian<A,C,P>diMapR(Fn1<? super B,? extends C> fn)Covariantly map over the right parameter.
-
-
-
Method Detail
-
cartesian
<C> Cartesian<Tuple2<C,A>,Tuple2<C,B>,P> cartesian()
Pair some typeCto this profunctor's carrier types.- Type Parameters:
C- the paired type- Returns:
- the cartesian-strengthened profunctor
-
carry
default Cartesian<A,Tuple2<A,B>,P> carry()
Pair the covariantly-positioned carrier type with the contravariantly-positioned carrier type. This can be thought of as "carrying" or "inspecting" the left parameter.- Returns:
- the profunctor with the first parameter carried
-
diMap
<Z,C> Cartesian<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. This is isomorphic todiMapL(lFn).diMapR(rFn).- Specified by:
diMapin interfaceProfunctor<A,B,P extends Cartesian<?,?,P>>- 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
default <Z> Cartesian<Z,B,P> diMapL(Fn1<? super Z,? extends A> fn)
Contravariantly map over the left parameter.
-
diMapR
default <C> Cartesian<A,C,P> diMapR(Fn1<? super B,? extends C> fn)
Covariantly map over the right parameter. For all profunctors that are also functors, it should hold thatdiMapR(f) == fmap(f).
-
-