Interface Cartesian<A,​B,​P extends Cartesian<?,​?,​P>>

    • Method Detail

      • cartesian

        <C> Cartesian<Tuple2<C,​A>,​Tuple2<C,​B>,​P> cartesian()
        Pair some type C to 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 to diMapL(lFn).diMapR(rFn).
        Specified by:
        diMap in interface Profunctor<A,​B,​P extends Cartesian<?,​?,​P>>
        Type Parameters:
        Z - the new left parameter type
        C - the new right parameter type
        Parameters:
        lFn - the left parameter mapping function
        rFn - 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.
        Specified by:
        diMapL in interface Profunctor<A,​B,​P extends Cartesian<?,​?,​P>>
        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

        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 that diMapR(f) == fmap(f).
        Specified by:
        diMapR in interface Profunctor<A,​B,​P extends Cartesian<?,​?,​P>>
        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

        default <Z> Cartesian<Z,​B,​P> contraMap​(Fn1<? super Z,​? extends A> fn)
        Contravariantly map A <- B.
        Specified by:
        contraMap in interface Contravariant<A,​B>
        Specified by:
        contraMap in interface Profunctor<A,​B,​P extends Cartesian<?,​?,​P>>
        Type Parameters:
        Z - the new parameter type
        Parameters:
        fn - the mapping function
        Returns:
        the mapped Contravariant functor instance