Package fj

Class P


  • public final class P
    extends java.lang.Object
    Functions across products.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private P()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <A> P1<A> hardMemo​(F0<A> f)
      Convert a F0 into a P1, using call-by-need semantic: function f is evaluated at most once, at first to P1._1().
      static <A> P1<A> lazy​(F<Unit,​A> f)  
      static <A,​B>
      P2<A,​B>
      lazy​(F<Unit,​A> fa, F<Unit,​B> fb)  
      static <A,​B,​C>
      P3<A,​B,​C>
      lazy​(F<Unit,​A> fa, F<Unit,​B> fb, F<Unit,​C> fc)  
      static <A,​B,​C,​D>
      P4<A,​B,​C,​D>
      lazy​(F<Unit,​A> fa, F<Unit,​B> fb, F<Unit,​C> fc, F<Unit,​D> fd)  
      static <A,​B,​C,​D,​E>
      P5<A,​B,​C,​D,​E>
      lazy​(F<Unit,​A> fa, F<Unit,​B> fb, F<Unit,​C> fc, F<Unit,​D> fd, F<Unit,​E> fe)  
      static <A,​B,​C,​D,​E,​F$>
      P6<A,​B,​C,​D,​E,​F$>
      lazy​(F<Unit,​A> fa, F<Unit,​B> fb, F<Unit,​C> fc, F<Unit,​D> fd, F<Unit,​E> fe, F<Unit,​F$> ff)  
      static <A,​B,​C,​D,​E,​F$,​G>
      P7<A,​B,​C,​D,​E,​F$,​G>
      lazy​(F<Unit,​A> fa, F<Unit,​B> fb, F<Unit,​C> fc, F<Unit,​D> fd, F<Unit,​E> fe, F<Unit,​F$> ff, F<Unit,​G> fg)  
      static <A,​B,​C,​D,​E,​F$,​G,​H>
      P8<A,​B,​C,​D,​E,​F$,​G,​H>
      lazy​(F<Unit,​A> fa, F<Unit,​B> fb, F<Unit,​C> fc, F<Unit,​D> fd, F<Unit,​E> fe, F<Unit,​F$> ff, F<Unit,​G> fg, F<Unit,​H> fh)  
      static <A> P1<A> lazy​(F0<A> f)
      Convert a F0 into a P1, using call-by-name semantic: function f is evaluated at each call to P1._1().
      static <A,​B>
      P2<A,​B>
      lazy​(F0<A> pa, F0<B> pb)  
      static <A,​B,​C>
      P3<A,​B,​C>
      lazy​(F0<A> pa, F0<B> pb, F0<C> pc)  
      static <A,​B,​C,​D>
      P4<A,​B,​C,​D>
      lazy​(F0<A> pa, F0<B> pb, F0<C> pc, F0<D> pd)  
      static <A,​B,​C,​D,​E>
      P5<A,​B,​C,​D,​E>
      lazy​(F0<A> pa, F0<B> pb, F0<C> pc, F0<D> pd, F0<E> pe)  
      static <A,​B,​C,​D,​E,​F>
      P6<A,​B,​C,​D,​E,​F>
      lazy​(F0<A> pa, F0<B> pb, F0<C> pc, F0<D> pd, F0<E> pe, F0<F> pf)  
      static <A,​B,​C,​D,​E,​F,​G>
      P7<A,​B,​C,​D,​E,​F,​G>
      lazy​(F0<A> pa, F0<B> pb, F0<C> pc, F0<D> pd, F0<E> pe, F0<F> pf, F0<G> pg)  
      static <A,​B,​C,​D,​E,​F,​G,​H>
      P8<A,​B,​C,​D,​E,​F,​G,​H>
      lazy​(F0<A> pa, F0<B> pb, F0<C> pc, F0<D> pd, F0<E> pe, F0<F> pf, F0<G> pg, F0<H> ph)  
      static <A,​B>
      P2<A,​B>
      lazyProduct​(F0<P2<A,​B>> f)  
      static <A> P1<A> memo​(F0<A> f)
      Convert a F0 into a P1, using weak call-by-need semantic using weakMemo(F0).
      static <A> P1<A> p​(A a)
      A function that puts an element in a product-1.
      static <A,​B>
      P2<A,​B>
      p​(A a, B b)
      A function that puts elements in a product-2.
      static <A,​B,​C>
      P3<A,​B,​C>
      p​(A a, B b, C c)
      A function that puts elements in a product-3.
      static <A,​B,​C,​D>
      P4<A,​B,​C,​D>
      p​(A a, B b, C c, D d)
      A function that puts elements in a product-4.
      static <A,​B,​C,​D,​E>
      P5<A,​B,​C,​D,​E>
      p​(A a, B b, C c, D d, E e)
      A function that puts elements in a product-5.
      static <A,​B,​C,​D,​E,​F$>
      P6<A,​B,​C,​D,​E,​F$>
      p​(A a, B b, C c, D d, E e, F$ f)
      A function that puts elements in a product-6.
      static <A,​B,​C,​D,​E,​F$,​G>
      P7<A,​B,​C,​D,​E,​F$,​G>
      p​(A a, B b, C c, D d, E e, F$ f, G g)
      A function that puts elements in a product-7.
      static <A,​B,​C,​D,​E,​F$,​G,​H>
      P8<A,​B,​C,​D,​E,​F$,​G,​H>
      p​(A a, B b, C c, D d, E e, F$ f, G g, H h)
      A function that puts elements in a product-8.
      static <A> F<A,​P1<A>> p1()
      A function that puts an element in a product-1.
      static <A,​B>
      F<A,​F<B,​P2<A,​B>>>
      p2()
      A function that puts an element in a product-2.
      static <A,​B,​C>
      F<A,​F<B,​F<C,​P3<A,​B,​C>>>>
      p3()
      A function that puts elements in a product-3.
      static <A,​B,​C,​D>
      F<A,​F<B,​F<C,​F<D,​P4<A,​B,​C,​D>>>>>
      p4()
      A function that puts an element in a product-4.
      static <A,​B,​C,​D,​E>
      F<A,​F<B,​F<C,​F<D,​F<E,​P5<A,​B,​C,​D,​E>>>>>>
      p5()
      A function that puts an element in a product-5.
      static <A,​B,​C,​D,​E,​F$>
      F<A,​F<B,​F<C,​F<D,​F<E,​F<F$,​P6<A,​B,​C,​D,​E,​F$>>>>>>>
      p6()
      A function that puts an element in a product-6.
      static <A,​B,​C,​D,​E,​F$,​G>
      F<A,​F<B,​F<C,​F<D,​F<E,​F<F$,​F<G,​P7<A,​B,​C,​D,​E,​F$,​G>>>>>>>>
      p7()
      A function that puts an element in a product-7.
      static <A,​B,​C,​D,​E,​F$,​G,​H>
      F<A,​F<B,​F<C,​F<D,​F<E,​F<F$,​F<G,​F<H,​P8<A,​B,​C,​D,​E,​F$,​G,​H>>>>>>>>>
      p8()
      A function that puts an element in a product-8.
      static <A> P1<A> softMemo​(F0<A> f)
      Convert a F0 into a P1, using soft call-by-need semantic: function f is evaluated at first call to P1._1() and at each subsequent call if and only if the reference have been garbage collected due of shortage of memory (ie.
      static <A> P1<A> weakMemo​(F0<A> f)
      Convert a F0 into a P1, using weak call-by-need semantic: function f is evaluated at first call to P1._1() and at each subsequent call if and only if the reference have been garbage collected.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • P

        private P()
    • Method Detail

      • p1

        public static <A> F<A,​P1<A>> p1()
        A function that puts an element in a product-1.
        Returns:
        A function that puts an element in a product-1.
      • p

        public static <A> P1<A> p​(A a)
        A function that puts an element in a product-1.
        Parameters:
        a - The element.
        Returns:
        The product-1.
      • hardMemo

        public static <A> P1<A> hardMemo​(F0<A> f)
        Convert a F0 into a P1, using call-by-need semantic: function f is evaluated at most once, at first to P1._1().
      • weakMemo

        public static <A> P1<A> weakMemo​(F0<A> f)
        Convert a F0 into a P1, using weak call-by-need semantic: function f is evaluated at first call to P1._1() and at each subsequent call if and only if the reference have been garbage collected.
      • softMemo

        public static <A> P1<A> softMemo​(F0<A> f)
        Convert a F0 into a P1, using soft call-by-need semantic: function f is evaluated at first call to P1._1() and at each subsequent call if and only if the reference have been garbage collected due of shortage of memory (ie. to avoid OutOfMemoryErrors).
      • memo

        public static <A> P1<A> memo​(F0<A> f)
        Convert a F0 into a P1, using weak call-by-need semantic using weakMemo(F0).
      • lazy

        public static <A> P1<A> lazy​(F0<A> f)
        Convert a F0 into a P1, using call-by-name semantic: function f is evaluated at each call to P1._1().
      • lazy

        public static <A,​B> P2<A,​B> lazy​(F0<A> pa,
                                                     F0<B> pb)
      • lazy

        public static <A,​B,​C> P3<A,​B,​C> lazy​(F0<A> pa,
                                                                     F0<B> pb,
                                                                     F0<C> pc)
      • lazy

        public static <A,​B,​C,​D> P4<A,​B,​C,​D> lazy​(F0<A> pa,
                                                                                     F0<B> pb,
                                                                                     F0<C> pc,
                                                                                     F0<D> pd)
      • lazy

        public static <A,​B,​C,​D,​E> P5<A,​B,​C,​D,​E> lazy​(F0<A> pa,
                                                                                                     F0<B> pb,
                                                                                                     F0<C> pc,
                                                                                                     F0<D> pd,
                                                                                                     F0<E> pe)
      • lazy

        public static <A,​B,​C,​D,​E,​F> P6<A,​B,​C,​D,​E,​F> lazy​(F0<A> pa,
                                                                                                                     F0<B> pb,
                                                                                                                     F0<C> pc,
                                                                                                                     F0<D> pd,
                                                                                                                     F0<E> pe,
                                                                                                                     F0<F> pf)
      • lazy

        public static <A,​B,​C,​D,​E,​F,​G> P7<A,​B,​C,​D,​E,​F,​G> lazy​(F0<A> pa,
                                                                                                                                     F0<B> pb,
                                                                                                                                     F0<C> pc,
                                                                                                                                     F0<D> pd,
                                                                                                                                     F0<E> pe,
                                                                                                                                     F0<F> pf,
                                                                                                                                     F0<G> pg)
      • lazy

        public static <A,​B,​C,​D,​E,​F,​G,​H> P8<A,​B,​C,​D,​E,​F,​G,​H> lazy​(F0<A> pa,
                                                                                                                                                     F0<B> pb,
                                                                                                                                                     F0<C> pc,
                                                                                                                                                     F0<D> pd,
                                                                                                                                                     F0<E> pe,
                                                                                                                                                     F0<F> pf,
                                                                                                                                                     F0<G> pg,
                                                                                                                                                     F0<H> ph)
      • lazyProduct

        public static <A,​B> P2<A,​B> lazyProduct​(F0<P2<A,​B>> f)
      • p2

        public static <A,​B> F<A,​F<B,​P2<A,​B>>> p2()
        A function that puts an element in a product-2.
        Returns:
        A function that puts an element in a product-2.
      • p

        public static <A,​B> P2<A,​B> p​(A a,
                                                  B b)
        A function that puts elements in a product-2.
        Parameters:
        a - An element.
        b - An element.
        Returns:
        The product-2.
      • p3

        public static <A,​B,​C> F<A,​F<B,​F<C,​P3<A,​B,​C>>>> p3()
        A function that puts elements in a product-3.
        Returns:
        A function that puts elements in a product-3.
      • p

        public static <A,​B,​C> P3<A,​B,​C> p​(A a,
                                                                  B b,
                                                                  C c)
        A function that puts elements in a product-3.
        Parameters:
        a - An element.
        b - An element.
        c - An element.
        Returns:
        The product-3.
      • p4

        public static <A,​B,​C,​D> F<A,​F<B,​F<C,​F<D,​P4<A,​B,​C,​D>>>>> p4()
        A function that puts an element in a product-4.
        Returns:
        A function that puts an element in a product-4.
      • p

        public static <A,​B,​C,​D> P4<A,​B,​C,​D> p​(A a,
                                                                                  B b,
                                                                                  C c,
                                                                                  D d)
        A function that puts elements in a product-4.
        Parameters:
        a - An element.
        b - An element.
        c - An element.
        d - An element.
        Returns:
        The product-4.
      • p5

        public static <A,​B,​C,​D,​E> F<A,​F<B,​F<C,​F<D,​F<E,​P5<A,​B,​C,​D,​E>>>>>> p5()
        A function that puts an element in a product-5.
        Returns:
        A function that puts an element in a product-5.
      • p

        public static <A,​B,​C,​D,​E> P5<A,​B,​C,​D,​E> p​(A a,
                                                                                                  B b,
                                                                                                  C c,
                                                                                                  D d,
                                                                                                  E e)
        A function that puts elements in a product-5.
        Parameters:
        a - An element.
        b - An element.
        c - An element.
        d - An element.
        e - An element.
        Returns:
        The product-5.
      • p6

        public static <A,​B,​C,​D,​E,​F$> F<A,​F<B,​F<C,​F<D,​F<E,​F<F$,​P6<A,​B,​C,​D,​E,​F$>>>>>>> p6()
        A function that puts an element in a product-6.
        Returns:
        A function that puts an element in a product-6.
      • p

        public static <A,​B,​C,​D,​E,​F$> P6<A,​B,​C,​D,​E,​F$> p​(A a,
                                                                                                                    B b,
                                                                                                                    C c,
                                                                                                                    D d,
                                                                                                                    E e,
                                                                                                                    F$ f)
        A function that puts elements in a product-6.
        Parameters:
        a - An element.
        b - An element.
        c - An element.
        d - An element.
        e - An element.
        f - An element.
        Returns:
        The product-6.
      • p7

        public static <A,​B,​C,​D,​E,​F$,​G> F<A,​F<B,​F<C,​F<D,​F<E,​F<F$,​F<G,​P7<A,​B,​C,​D,​E,​F$,​G>>>>>>>> p7()
        A function that puts an element in a product-7.
        Returns:
        A function that puts an element in a product-7.
      • p

        public static <A,​B,​C,​D,​E,​F$,​G> P7<A,​B,​C,​D,​E,​F$,​G> p​(A a,
                                                                                                                                    B b,
                                                                                                                                    C c,
                                                                                                                                    D d,
                                                                                                                                    E e,
                                                                                                                                    F$ f,
                                                                                                                                    G g)
        A function that puts elements in a product-7.
        Parameters:
        a - An element.
        b - An element.
        c - An element.
        d - An element.
        e - An element.
        f - An element.
        g - An element.
        Returns:
        The product-7.
      • p8

        public static <A,​B,​C,​D,​E,​F$,​G,​H> F<A,​F<B,​F<C,​F<D,​F<E,​F<F$,​F<G,​F<H,​P8<A,​B,​C,​D,​E,​F$,​G,​H>>>>>>>>> p8()
        A function that puts an element in a product-8.
        Returns:
        A function that puts an element in a product-8.
      • p

        public static <A,​B,​C,​D,​E,​F$,​G,​H> P8<A,​B,​C,​D,​E,​F$,​G,​H> p​(A a,
                                                                                                                                                    B b,
                                                                                                                                                    C c,
                                                                                                                                                    D d,
                                                                                                                                                    E e,
                                                                                                                                                    F$ f,
                                                                                                                                                    G g,
                                                                                                                                                    H h)
        A function that puts elements in a product-8.
        Parameters:
        a - An element.
        b - An element.
        c - An element.
        d - An element.
        e - An element.
        f - An element.
        g - An element.
        h - An element.
        Returns:
        The product-8.
      • lazy

        public static <A> P1<A> lazy​(F<Unit,​A> f)
      • lazy

        public static <A,​B> P2<A,​B> lazy​(F<Unit,​A> fa,
                                                     F<Unit,​B> fb)
      • lazy

        public static <A,​B,​C> P3<A,​B,​C> lazy​(F<Unit,​A> fa,
                                                                     F<Unit,​B> fb,
                                                                     F<Unit,​C> fc)
      • lazy

        public static <A,​B,​C,​D> P4<A,​B,​C,​D> lazy​(F<Unit,​A> fa,
                                                                                     F<Unit,​B> fb,
                                                                                     F<Unit,​C> fc,
                                                                                     F<Unit,​D> fd)
      • lazy

        public static <A,​B,​C,​D,​E> P5<A,​B,​C,​D,​E> lazy​(F<Unit,​A> fa,
                                                                                                     F<Unit,​B> fb,
                                                                                                     F<Unit,​C> fc,
                                                                                                     F<Unit,​D> fd,
                                                                                                     F<Unit,​E> fe)
      • lazy

        public static <A,​B,​C,​D,​E,​F$> P6<A,​B,​C,​D,​E,​F$> lazy​(F<Unit,​A> fa,
                                                                                                                       F<Unit,​B> fb,
                                                                                                                       F<Unit,​C> fc,
                                                                                                                       F<Unit,​D> fd,
                                                                                                                       F<Unit,​E> fe,
                                                                                                                       F<Unit,​F$> ff)
      • lazy

        public static <A,​B,​C,​D,​E,​F$,​G> P7<A,​B,​C,​D,​E,​F$,​G> lazy​(F<Unit,​A> fa,
                                                                                                                                       F<Unit,​B> fb,
                                                                                                                                       F<Unit,​C> fc,
                                                                                                                                       F<Unit,​D> fd,
                                                                                                                                       F<Unit,​E> fe,
                                                                                                                                       F<Unit,​F$> ff,
                                                                                                                                       F<Unit,​G> fg)
      • lazy

        public static <A,​B,​C,​D,​E,​F$,​G,​H> P8<A,​B,​C,​D,​E,​F$,​G,​H> lazy​(F<Unit,​A> fa,
                                                                                                                                                       F<Unit,​B> fb,
                                                                                                                                                       F<Unit,​C> fc,
                                                                                                                                                       F<Unit,​D> fd,
                                                                                                                                                       F<Unit,​E> fe,
                                                                                                                                                       F<Unit,​F$> ff,
                                                                                                                                                       F<Unit,​G> fg,
                                                                                                                                                       F<Unit,​H> fh)