Uses of Class
fj.P1
Packages that use P1
Package
Description
Types that set the premise for the existence of Functional Java.
Functional control abstractions.
Parallelization strategies.
Common algebraic data types.
Optic data types adapted from the Scala Monocle library
and inspired by the
Haskell Lens library.
Fixed-length vectors
A prelude of commonly used first-class functions
-
Uses of P1 in fj
Modifier and TypeClassDescription(package private) static final class
P1.Memo<A>
(package private) static class
(package private) static final class
(package private) static final class
Modifier and TypeMethodDescriptionP2._1_()
Returns the 1-product projection over the first element.P3._1_()
Returns the 1-product projection over the first element.P4._1_()
Returns the 1-product projection over the first element.P5._1_()
Returns the 1-product projection over the first element.P6._1_()
Returns the 1-product projection over the first element.P7._1_()
Returns the 1-product projection over the first element.P8._1_()
Returns the 1-product projection over the first element.P2._2_()
Returns the 1-product projection over the second element.P3._2_()
Returns the 1-product projection over the second element.P4._2_()
Returns the 1-product projection over the second element.P5._2_()
Returns the 1-product projection over the second element.P6._2_()
Returns the 1-product projection over the second element.P7._2_()
Returns the 1-product projection over the second element.P8._2_()
Returns the 1-product projection over the second element.P3._3_()
Returns the 1-product projection over the third element.P4._3_()
Returns the 1-product projection over the third element.P5._3_()
Returns the 1-product projection over the third element.P6._3_()
Returns the 1-product projection over the third element.P7._3_()
Returns the 1-product projection over the third element.P8._3_()
Returns the 1-product projection over the third element.P4._4_()
Returns the 1-product projection over the fourth element.P5._4_()
Returns the 1-product projection over the fourth element.P6._4_()
Returns the 1-product projection over the fourth element.P7._4_()
Returns the 1-product projection over the fourth element.P8._4_()
Returns the 1-product projection over the fourth element.P5._5_()
Returns the 1-product projection over the fifth element.P6._5_()
Returns the 1-product projection over the fifth element.P7._5_()
Returns the 1-product projection over the fifth element.P8._5_()
Returns the 1-product projection over the fifth element.P6._6_()
Returns the 1-product projection over the sixth element.P7._6_()
Returns the 1-product projection over the sixth element.P8._6_()
Returns the 1-product projection over the sixth element.P7._7_()
Returns the 1-product projection over the seventh element.P8._7_()
Returns the 1-product projection over the seventh element.P8._8_()
Returns the 1-product projection over the eighth element.final <B> P1
<B> Performs function application within a P1 (applicative functor pattern).final <B> P1
<B> Binds the given function to the value in a product-1 with a final join.final <B,
C> P1 <C> Binds the given function to the values in the given P1s with a final join.final <B,
C> P1 <C> Binds the given function to the values in the given P1s with a final join.static <A> P1
<A> Provides a thunk that throws an error using the given message when evaluated.static <A,
E extends Exception>
P1<Validation<E, A>> Promotes the Try0 to a Validation that returns an Exception on the failure side and its result on the success side.static <A,
Z extends Exception>
P1<Validation<Z, Unit>> TryEffect.f
(TryEffect0<Z> t) static <A> P1
<A> Convert a F0 into a P1, using call-by-need semantic: function f is evaluated at most once, at first to_1()
.P1.hardMemo()
Returns a P1 that remembers its value.P1.Memo.hardMemo()
static <A> P1
<A> Joins a P1 of a P1 with a bind operation.static <A> P1
<A> static <A> P1
<A> Convert a F0 into a P1, using call-by-name semantic: function f is evaluated at each call to_1()
.final <B,
C> P1 <C> final <B> P1
<B> Map the element of the product.static <A> P1
<A> Convert a F0 into a P1, using weak call-by-need semantic usingP.weakMemo(F0)
.P1.memo()
Wrap the memoized value into aWeakReference
.static <A> P1
<A> P.p
(A a) A function that puts an element in a product-1.Partial application.Turns an array of P1s into a single P1 of an array.Turns a List of P1s into a single P1 of a List.Turns an optional P1 into a lazy option.Turns a stream of P1s into a single P1 of a stream.static <A> P1
<A> Convert a F0 into a P1, using soft call-by-need semantic: function f is evaluated at first call to_1()
and at each subsequent call if and only if the reference have been garbage collected due of shortage of memory (ie.P1.Memo.softMemo()
P1.softMemo()
Likememo
, but the memoized value is wrapped into aSoftReference
P1.SoftReferenceMemo.softMemo()
F0.toP1()
static <A> P1
<A> Convert a F0 into a P1, using weak call-by-need semantic: function f is evaluated at first call to_1()
and at each subsequent call if and only if the reference have been garbage collected.P1.Memo.weakMemo()
P1.SoftReferenceMemo.weakMemo()
P1.weakMemo()
Likememo
, but the memoized value is wrapped into aWeakReference
P1.WeakReferenceMemo.weakMemo()
Modifier and TypeMethodDescriptionP1.__1()
Returns a function that returns the first element of a product.Promotes the given function so that it returns its value in a P1.F.lazy()
Promotes this function so that it returns its result in a product-1.Promotes a function of arity-2 to a function on P1s.Promotes a function of arity-2 to a function on P1s.Promotes a function of arity-2 to a function on P1s.Promote any function to a transformation between P1s.Promote any function to a transformation between P1s.F.mapP1()
Promotes this function to map over a product-1.F.mapP1()
Promotes this function to map over a product-1.P.p1()
A function that puts an element in a product-1.An equal instance for a product-1.A hash instance for a product-1.An order instance for a product-1.Semigroup.p1Semigroup
(Semigroup<A> sa) A lazy semigroup for unary products.A show instance for thetuple-1
type.Show.p1ShowEager
(Show<A> sa) Show.p1ShowLazy
(Show<A> sa) P1.sequenceList()
A first-class version of the sequence method for lists of P1s.P1.sequenceList()
A first-class version of the sequence method for lists of P1s.P1.traverseEither
(F<A, Either<X, B>> f) Traversable instance of P1 for EitherP1.traverseList
(F<A, List<B>> f) Traversable instance of P1 for ListP1.traverseOption
(F<A, Option<B>> f) Traversable instance of P1 for OptionP1.traverseStream
(F<A, Stream<B>> f) Traversable instance of P1 for Streamfinal <B,
E> Validation <E, P1<B>> P1.traverseValidation
(F<A, Validation<E, B>> f) Traversable instance of P1 for ValidationModifier and TypeMethodDescriptionfinal <B> P1
<B> Performs function application within a P1 (applicative functor pattern).final <B,
C> P1 <C> Binds the given function to the values in the given P1s with a final join.final <B,
C> P1 <C> Binds the given function to the values in the given P1s with a final join.static <A> P1
<A> Joins a P1 of a P1 with a bind operation.final <B,
C> P1 <C> Modifier and TypeMethodDescriptionfinal <B> P1
<B> Binds the given function to the value in a product-1 with a final join.static <A> P1
<A> Joins a P1 of a P1 with a bind operation.Turns an array of P1s into a single P1 of an array.Turns a List of P1s into a single P1 of a List.Turns an optional P1 into a lazy option.Turns a stream of P1s into a single P1 of a stream. -
Uses of P1 in fj.control
Fields in fj.control declared as P1Methods in fj.control that return types with arguments of type P1Modifier and TypeMethodDescriptionEither
<P1<Trampoline<A>>, A> Trampoline.Codense.resume()
Either
<P1<Trampoline<A>>, A> Trampoline.Pure.resume()
abstract Either
<P1<Trampoline<A>>, A> Trampoline.resume()
Runs a single step of this computation.Either
<P1<Trampoline<A>>, A> Trampoline.Suspend.resume()
static <A> F
<Trampoline<A>, Either<P1<Trampoline<A>>, A>> Trampoline.resume_()
static <A> F
<P1<Trampoline<A>>, Trampoline<A>> Trampoline.suspend_()
Methods in fj.control with parameters of type P1Modifier and TypeMethodDescriptionstatic <A> Trampoline
<A> Trampoline.suspend
(P1<Trampoline<A>> a) Suspends the given computation in a thunk.Constructors in fj.control with parameters of type P1 -
Uses of P1 in fj.control.parallel
Fields in fj.control.parallel with type parameters of type P1Methods in fj.control.parallel that return P1Modifier and TypeMethodDescriptionPass a message to this actor, applying its side-effect to the message.Turns the given Callable into either an exception or the value in the Callable.static <A> P1
<A> Provides a product-1 that waits for the given future to obtain a value.Turns the given Callable into an optional value.Apply the strategy to the given product-1.Binds the given function in parallel across the given array, using the given strategy, with a final join.Binds the given function in parallel across the given list, using the given strategy, with a final join.Evaluates a list of product-1s in parallel.Strategy.parListChunk
(Strategy<List<A>> s, int chunkLength, List<P1<A>> as) Sequentially evaluates chunks (sub-sequences) of a list in parallel.Maps the given function over the given array in parallel using this strategy.Maps the given function over the given list in parallel using this strategy.Strategy.parZipWith
(F2<B, C, A> f, Array<B> bs, Array<C> cs) Zips together two arrays in parallel using a given function, with this strategy.Strategy.parZipWith
(F2<B, C, A> f, List<B> bs, List<C> cs) Zips together two lists in parallel using a given function, with this strategy.Methods in fj.control.parallel that return types with arguments of type P1Modifier and TypeMethodDescriptionPromotes a function to a concurrent function.Promotes a function of arity-2 to a concurrent function.Callables.either()
Returns a transformation from a Callable to an Either.Strategy.f()
Returns the functional representation of this Strategy, a function that evaluates a product-1.Strategy.f()
Returns the functional representation of this Strategy, a function that evaluates a product-1.Callables.fromEither()
Returns a transformation from an Either to a Callable.Callables.fromOption()
Returns a transformation from an optional value to a CallableMaps a concurrent function over a Product-1 inside a Promise.Waits for every Future in a list to obtain a value, and collects those values in a list.Strategy.obtain()
Returns a function which returns a product-1 which waits for the given Future to obtain a value.Callables.option()
Returns a transformation from a Callable to an optional value.Strategy.parMapArray()
First-class version of parMap on arrays.Strategy.parMapArray
(F<B, A> f) Promotes a function to a parallel function on arrays using this strategy.Strategy.parMapList()
First-class version of parMap on lists.Strategy.parMapList
(F<B, A> f) Promotes a function to a parallel function on lists using this strategy.Strategy.parZipArrayWith
(F2<B, C, A> f) Lifts a given function of arity-2 so that it zips together two arrays in parallel, using this strategy, calling the function once for each corresponding pair in the arrays, position-wise.Strategy.parZipListWith
(F2<B, C, A> f) Lifts a given function of arity-2 so that it zips together two lists in parallel, using this strategy, calling the function once for each corresponding pair in the lists, position-wise.ParModule.promise()
Returns a function that evaluates a given product concurrently and returns a Promise of the result.Provides a first-class unit function for promises.Traverses a product-1 inside a promise.Transforms a product of a promise to a promise of a product.Methods in fj.control.parallel with parameters of type P1Modifier and TypeMethodDescription<B,
C> Promise <C> Binds the given function to this promise and the given promise, with a final join.static <A> Promise
<A> Turns a product of a promise into just a promise.Maps a concurrent function over a Product-1 inside a Promise.Apply the strategy to the given product-1.<A> Promise
<A> Evaluates the given product concurrently and returns a Promise of the result.static <A> Promise
<A> Promises to provide the value of the given 1-product, in the future.Traverses a product-1 inside a promise.Transforms a product of a promise to a promise of a product.Method parameters in fj.control.parallel with type arguments of type P1Modifier and TypeMethodDescriptionstatic <A> Actor
<A> Creates a new Actor that uses the given parallelization strategy and has the given side-effect.Maps the given transformation across this strategy's codomain (Invariant Functor pattern).Maps the given transformation across this strategy's codomain (Invariant Functor pattern).Performs a right-fold reduction across a Stream in constant stack space.Maps the given transformation across this strategy's domain (Invariant Functor pattern).Maps the given transformation across this strategy's domain (Invariant Functor pattern).Evaluates a list of product-1s in parallel.Strategy.parListChunk
(Strategy<List<A>> s, int chunkLength, List<P1<A>> as) Sequentially evaluates chunks (sub-sequences) of a list in parallel.static <A> Strategy
<A> Constructs a strategy from the given evaluation function.static <A> Strategy
<A> Constructs a strategy from the given evaluation function.<B> Strategy
<B> Maps the given bijective transformation across this strategy (Exponential Functor pattern).<B> Strategy
<B> Maps the given bijective transformation across this strategy (Exponential Functor pattern).Constructor parameters in fj.control.parallel with type arguments of type P1 -
Uses of P1 in fj.data
Modifier and TypeClassDescriptionfinal class
$<A,
B> The constant arrow, for attaching a new name to an existing type.Modifier and TypeFieldDescriptionEval.DeferEval.memo
Eval.Later.memo
Tree.subForest
Stream.Cons.tail
Modifier and TypeFieldDescriptionprivate final F
<P2<A, Iteratee.Input<char[]>>, P1<Iteratee.IterV<char[], A>>> IOFunctions.CharChunkReader.done
private final F
<P2<A, Iteratee.Input<String>>, P1<Iteratee.IterV<String, A>>> IOFunctions.LineReader.done
Modifier and TypeMethodDescriptionConversions.Effect0_P1
(Effect0 e) Stream.nil_()
Returns an empty stream.Returns the tail of this stream if there is one or the given argument if this stream is empty.static <A> P1
<Validation<IOException, A>> List.sequenceP1
(List<P1<B>> list) Sequence the given list and collect the output as a P1.Option.sequenceP1
(Option<P1<B>> option) Sequence the given option and collect the output as a P1.Seq.sequenceP1
(Seq<P1<B>> seq) Sequence the given seq and collect the output as a P1.Stream.sequenceP1
(Stream<P1<B>> stream) Sequence the given stream and collect the output as a P1.static final <E,
C> P1 <Validation<E, C>> Validation.sequenceP1
(Validation<E, P1<C>> validation) Sequence the given validation and collect the output as a P1.Tree.subForest()
Returns a stream of the tree's subtrees.static <A> P1
<A> Java8.Supplier_P1
(Supplier<A> s) Stream.Cons.tail()
Stream.Nil.tail()
Stream.tail()
The stream without the first element or fails for the empty stream.Either.LeftProjection.traverseP1
(F<A, P1<C>> f) Traverse this left with the given function and collect the output as a p1.Either.RightProjection.traverseP1
(F<B, P1<C>> f) Traverse this right with the given function and collect the output as a p1.Either3.LeftProjection.traverseP1
(F<A, P1<X>> f) Either3.MiddleProjection.traverseP1
(F<B, P1<X>> f) Either3.RightProjection.traverseP1
(F<C, P1<X>> f) List.traverseP1
(F<A, P1<B>> f) Traverse this list with the given function and collect the output as a p1.Option.traverseP1
(F<A, P1<B>> f) Traverse this option with the given function and collect the output as a P1.Seq.traverseP1
(F<A, P1<B>> f) Traverse this seq with the given function and collect the output as a p1.Stream.traverseP1
(F<A, P1<B>> f) Traverse this stream with the given function and collect the output as a p1.final <C> P1
<Validation<E, C>> Validation.traverseP1
(F<T, P1<C>> f) Traverse this validation with the given function and collect the output as a P1.static <E extends Exception>
P1<Validation<E, Unit>> Conversions.TryEffect_P
(TryEffect0<E> t) Modifier and TypeMethodDescriptionConversions.Array_Either()
A function that converts arrays to eithers.Stream.cons()
Returns a function that prepends (cons) an element to a stream to produce a new stream.private static <A> F
<TreeZipper<A>, P2<TreeZipper<A>, P1<Stream<TreeZipper<A>>>>> TreeZipper.dwn()
Conversions.Effect0_P1()
Stream.foldRight()
A first-class version of the foldRight function.Java.Future_P1()
Conversions.List_Either()
A function that converts lists to eithers.Tree.node()
First-class constructor of trees.Conversions.Option_Either()
A function that converts options to eithers.Java.P1_Callable()
Java8.P1_Supplier()
Sequence through the Stream monad.Conversions.Stream_Either()
A function that converts streams to eithers.Conversions.String_Either()
A function that converts string to eithers.Conversions.StringBuffer_Either()
A function that converts string buffers to eithers.Conversions.StringBuilder_Either()
A function that converts string builders to eithers.Tree.subForest_()
Provides a transformation from a tree to its subforest.Java8.Supplier_P1()
Modifier and TypeMethodDescriptionstatic <A> Tree
<A> Creates a new tree given a root and a (potentially infinite) subforest.static <A> Supplier
<A> Java8.P1_Supplier
(P1<A> p) Modifier and TypeMethodDescriptionfinal <B> B
Performs a right-fold reduction across this stream.final <B> B
Performs a right-fold reduction across this stream.List.sequenceP1
(List<P1<B>> list) Sequence the given list and collect the output as a P1.Option.sequenceP1
(Option<P1<B>> option) Sequence the given option and collect the output as a P1.Seq.sequenceP1
(Seq<P1<B>> seq) Sequence the given seq and collect the output as a P1.Stream.sequenceP1
(Stream<P1<B>> stream) Sequence the given stream and collect the output as a P1.static final <E,
C> P1 <Validation<E, C>> Validation.sequenceP1
(Validation<E, P1<C>> validation) Sequence the given validation and collect the output as a P1.Either.LeftProjection.traverseP1
(F<A, P1<C>> f) Traverse this left with the given function and collect the output as a p1.Either.RightProjection.traverseP1
(F<B, P1<C>> f) Traverse this right with the given function and collect the output as a p1.Either3.LeftProjection.traverseP1
(F<A, P1<X>> f) Either3.MiddleProjection.traverseP1
(F<B, P1<X>> f) Either3.RightProjection.traverseP1
(F<C, P1<X>> f) List.traverseP1
(F<A, P1<B>> f) Traverse this list with the given function and collect the output as a p1.Option.traverseP1
(F<A, P1<B>> f) Traverse this option with the given function and collect the output as a P1.Seq.traverseP1
(F<A, P1<B>> f) Traverse this seq with the given function and collect the output as a p1.Stream.traverseP1
(F<A, P1<B>> f) Traverse this stream with the given function and collect the output as a p1.final <C> P1
<Validation<E, C>> Validation.traverseP1
(F<T, P1<C>> f) Traverse this validation with the given function and collect the output as a P1.final <B> B
Performs a reduction on this stream using the given arguments.Tree.unfoldTree
(F<B, P2<A, P1<Stream<B>>>> f) Builds a tree from a seed value. -
Uses of P1 in fj.data.optic
Methods in fj.data.optic that return types with arguments of type P1Modifier and TypeMethodDescriptionmodify polymorphically the target of aPIso
with an Applicative functionmodify polymorphically the target of aPLens
with an Applicative functionmodify polymorphically the target of aPOptional
with an Applicative functionmodify polymorphically the target of aPPrism
with an Applicative functionmodify polymorphically the target of aPTraversal
with an Applicative functionMethod parameters in fj.data.optic with type arguments of type P1Modifier and TypeMethodDescriptionmodify polymorphically the target of aPIso
with an Applicative functionmodify polymorphically the target of aPLens
with an Applicative functionmodify polymorphically the target of aPOptional
with an Applicative functionmodify polymorphically the target of aPPrism
with an Applicative functionmodify polymorphically the target of aPTraversal
with an Applicative function -
Uses of P1 in fj.data.vector
Fields in fj.data.vector declared as P1Methods in fj.data.vector that return P1Modifier and TypeMethodDescriptionV2.head()
Return the first element of this vector as a product-1.V3.head()
Returns the first element of this vector, as a product-1.V4.head()
Returns the first element of this vector, as a product-1.V5.head()
Returns the first element of this vector, as a product-1.V6.head()
Returns the first element of this vector, as a product-1.V7.head()
Returns the first element of this vector, as a product-1.V8.head()
Returns the first element of this vector, as a product-1.Methods in fj.data.vector with parameters of type P1Modifier and TypeMethodDescriptionstatic <A> V3
<A> Creates a vector-3 from a head and a tail.static <A> V4
<A> Creates a vector-4 from a head and a tail.static <A> V5
<A> Creates a vector-5 from a head and a tail.static <A> V6
<A> Creates a vector-6 from a head and a tail.static <A> V7
<A> Creates a vector-7 from a head and a tail.static <A> V8
<A> Creates a vector-8 from a head and a tail.static <A> V3
<A> Puts elements in a vector-3.static <A> V4
<A> Puts elements in a vector-4.static <A> V5
<A> Puts elements in a vector-5.Constructors in fj.data.vector with parameters of type P1 -
Uses of P1 in fj.function
Methods in fj.function that return P1Modifier and TypeMethodDescriptionEffect0.toP1()
default P1
<Validation<Z, A>> Try0.toP1()
TryEffect0.toP1()
Methods in fj.function that return types with arguments of type P1