Uses of Class
fj.P2
Packages that use P2
Package
Description
Types that set the premise for the existence of Functional Java.
Parallelization strategies.
Common algebraic data types.
Provides 2-3 finger trees, a functional representation of persistent sequences supporting access to the ends in
amortized O(1) time.
Type-safe, extensible, heterogeneous lists
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 P2 in fj
Modifier and TypeMethodDescriptionDuplicates this product on the first element, and maps the given function across the duplicate (Comonad pattern).P2.duplicate()
Duplicates this product into the first element (Comonad pattern).static <B,
C, D> P2 <C, D> Sends the given input value to both argument functions and combines their output.P2.inject
(C c) Replaces the first element of this product with the given value.static <A,
B> P2 <A, B> static <A,
B> P2 <A, B> static <A,
B> P2 <A, B> P.lazyProduct
(F0<P2<A, B>> f) static <A,
B> P2 <B, B> Maps the given function across both the elements of the given product.Map the first element of the product.Map the second element of the product.P2.memo()
Provides a memoising P2 that remembers its values.LcgRng.nextInt()
Rng.nextInt()
LcgRng.nextLong()
LcgRng.nextLong
(long seed) Rng.nextLong()
Rng.nextNatural()
static <A,
B> P2 <A, B> P.p
(A a, B b) A function that puts elements in a product-2.Rng.range
(int low, int high) final <C,
D> P2 <C, D> Split this product between two argument functions and combine their output.P2.swap()
Swaps the elements around in this product.Modifier and TypeMethodDescriptionP2.__1()
Returns a function that returns the first element of a product.P2.__2()
Returns a function that returns the second element of a product.P2.Optic._1()
Monomorphic lens targeted on _1.P2.Optic._1p()
Polyomorphic lens targeted on _1.P2.Optic._1p()
Polyomorphic lens targeted on _1.P2.Optic._2()
Monomorphic lens targeted on _1.P2.Optic._2p()
Polyomorphic lens targeted on _2.P2.Optic._2p()
Polyomorphic lens targeted on _2.Composes this monoid with another.P2.duplicate()
Duplicates this product into the first element (Comonad pattern).Promotes a function so that it maps the first element of a product.Promotes a function so that it maps the first element of a product.Promotes a function so that it maps the second element of a product.Promotes a function so that it maps the second element of a product.F.mapBoth()
Promotes this function to map over both elements of a pair.F.mapBoth()
Promotes this function to map over both elements of a pair.F.mapFst()
Promotes this function to map over the first element of a pair.F.mapFst()
Promotes this function to map over the first element of a pair.F.mapSnd()
Promotes this function to map over the second element of a pair.F.mapSnd()
Promotes this function to map over the second element of a pair.P.p2()
A function that puts an element in a product-2.An equal instance for a product-2.A hash instance for a product-2.A show instance for thetuple-2
type in the style of a mapping from A to B.An order instance for a product-2, with the first factor considered most significant.Semigroup.p2Semigroup
(Semigroup<A> sa, Semigroup<B> sb) A lazy semigroup for binary products.A show instance for thetuple-2
type.A show instance for thetuple-2
type.A first-class version of the split function.A first-class version of the split function.P2.swap_()
Returns a curried form ofswap()
.P2.swap_()
Returns a curried form ofswap()
.P2.traverseEither
(F<B, Either<X, C>> f) P2.traverseIO
(F<B, IO<C>> f) P2.traverseList
(F<B, List<C>> f) P2.traverseOption
(F<B, Option<C>> f) P2.traverseStream
(F<B, Stream<C>> f) F2.tuple()
Uncurries this function to a function on tuples.Transforms a curried function of arity-2 to a function of a product-2Transforms an uncurried function of arity-2 to a function of a product-2Modifier and TypeMethodDescriptionstatic <A,
B> P2 <B, B> Maps the given function across both the elements of the given product.Modifier and TypeMethodDescriptionDuplicates this product on the first element, and maps the given function across the duplicate (Comonad pattern).static <A,
B> P2 <A, B> P.lazyProduct
(F0<P2<A, B>> f) final <C> List
<C> Applies a list of comonadic functions to this product, returning a list of values.final <C> Stream
<C> Applies a stream of comonadic functions to this product, returning a stream of values.static <A,
B, C> F2 <A, B, C> Transforms a function of a product-2 to an uncurried function or arity-2. -
Uses of P2 in fj.control.parallel
Fields in fj.control.parallel with type parameters of type P2Constructor parameters in fj.control.parallel with type arguments of type P2 -
Uses of P2 in fj.data
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<Character>>, Iteratee.IterV<Character, A>> IOFunctions.CharChunkReader2.done
private final F
<P2<A, Iteratee.Input<String>>, P1<Iteratee.IterV<String, A>>> IOFunctions.LineReader.done
private final FingerTree
<K, P2<K, A>> PriorityQueue.ftree
State.runF
TreeMap.tree
Modifier and TypeMethodDescriptionReturns a tuple where the first element is the longest prefix of this list that does not satisfy the given predicate and the second element is the remainder of the list.private static <S> P2
<S, S> State.dup
(S s) Partitions the list into a tuple where the first element contains the items that satisfy the the predicate f and the second element contains the items that does not.Validation.partition
(List<Validation<A, B>> list) Partitions the list into the list of fails and the list of successesWriter.run()
Returns a tuple where the first element is the longest prefix of this list that satisfies the given predicate and the second element is the remainder of the list.Returns a tuple where the first element is the longest prefix of this stream that satisfies the given predicate and the second element is the remainder of the stream.Seq.split
(int i) Splits this sequence into a pair of sequences at the given position.Returns a tuple where the first element is the longest prefix of this stream that does not satisfy the given predicate and the second element is the remainder of the stream.List.splitAt
(int i) Splits this list into two lists at the given index.PriorityQueue.topDequeue()
Returns a tuple of the node with the highest priority and the rest of the priority queue.Transforms an array of pairs into an array of first components and an array of second components.Transforms a list of pairs into a list of first components and a list of second components.static <A,
B> P2 <NonEmptyList<A>, NonEmptyList<B>> NonEmptyList.unzip
(NonEmptyList<P2<A, B>> xs) Transforms a non empty list of pairs into a non empty list of first components and a non empty list of second components.Transforms a stream of pairs into a stream of first components and a stream of second components.Updates, with the given function, the first element in the set that is equal to the given element, according to the order.Modifies the value for the given key, if present, by applying the given function to it.Modifier and TypeMethodDescriptionOption.bindProduct
(Option<B> ob) List.Optic.cons()
Cons prismprivate static <A> F
<TreeZipper<A>, P2<TreeZipper<A>, P1<Stream<TreeZipper<A>>>>> TreeZipper.dwn()
TreeMap.iterator()
Returns an iterator for this map's key-value pairs.Returns a partially applied version ofList.lookup(Equal, List, Object)
.TreeMap.max()
Returns the maximum (key, value) pair in the tree if the tree is not empty.TreeMap.min()
Returns the minimum (key, value) pair in the tree if the tree is not empty.TreeZipper.splitChildren
(Stream<A> acc, Stream<A> xs, int n) HashMap.toArray()
Collection
<P2<K, V>> HashMap.toCollection()
Projects an immutable collection of this hash map.HashMap.toList()
PriorityQueue.toList()
Returns a list of products with priority k and value a.TreeMap.toList()
TreeMap.toListReverse()
HashMap.toOption()
PriorityQueue.top()
If the tree is not empty, returns the node with highest priority otherwise returns nothing.PriorityQueue.topDequeue()
Returns a tuple of the node with the highest priority and the rest of the priority queue.PriorityQueue.topN()
Returns all the elements of the queue with the highest (same) priority.HashMap.toStream()
PriorityQueue.toStream()
Returns a stream of products with priority k and value a.TreeMap.toStream()
TreeMap.toStreamReverse()
Zips this array with the given array to produce an array of pairs.Zips this iterable with the given iterable to produce a iterable of pairs.List.zip()
The first-class version of the zip function.Zips this list with the given list to produce a list of pairs.<B> NonEmptyList
<P2<A, B>> NonEmptyList.zip
(NonEmptyList<B> bs) Zips this non empty list with the given non empty list to produce a list of pairs.Zips this stream with the given stream to produce a stream of pairs.Array.zipIndex()
Zips this array with the index of its element as a pair.IterableW.zipIndex()
Zips this iterable with the index of its element as a pair.List.zipIndex()
Zips this list with the index of its element as a pair.NonEmptyList.zipIndex()
Zips this non empty list with the index of its element as a pair.Stream.zipIndex()
Zips this stream with the index of its element as a pair.TreeZipper
<P2<A, Boolean>> TreeZipper.zipWithFocus()
Zips the nodes in this zipper with a boolean that indicates whether that node has focus.Zipper.zipWithFocus()
Zips the elements of this zipper with a boolean that indicates whether that element has focus.Modifier and TypeMethodDescriptionstatic <K,
V> HashMap <K, V> HashMap.arrayHashMap
(Equal<K> equal, Hash<K> hash, P2<K, V>... entries) Converts the array to a HashMapstatic <K,
V> HashMap <K, V> HashMap.arrayHashMap
(P2<K, V>... entries) Converts the array to a HashMapstatic <K,
V> TreeMap <K, V> TreeMap.arrayTreeMap
(Ord<K> keyOrd, P2<K, V>... ps) Constructs a tree map from the given elements.Adds a node with priority k and value a.static <K,
V> TreeMap <K, V> Constructs a tree map from the given elements.Modifier and TypeMethodDescriptionstatic <A,
B> Tree <B> Adds nodes using the list of products with priority k and value a.Adds nodes using the iterable of products with priority k and value a.abstract <Z> Z
Iteratee.IterV.fold
(F<P2<A, Iteratee.Input<E>>, Z> done, F<F<Iteratee.Input<E>, Iteratee.IterV<E, A>>, Z> cont) void
void
HashMap.foreachDoEffect
(Effect1<P2<K, V>> effect) static <K,
V> HashMap <K, V> HashMap.iterableHashMap
(Equal<K> equal, Hash<K> hash, Iterable<P2<K, V>> entries) Converts the Iterable to a HashMapstatic <K,
V> HashMap <K, V> HashMap.iterableHashMap
(Iterable<P2<K, V>> entries) Converts the Iterable to a HashMapstatic <K,
V> TreeMap <K, V> TreeMap.iterableTreeMap
(Ord<K> keyOrd, Iterable<P2<K, V>> it) Constructs a tree map from the given elements.static <K,
V> HashMap <K, V> HashMap.iteratorHashMap
(Equal<K> equal, Hash<K> hash, Iterator<P2<K, V>> entries) Converts the Iterator to a HashMapstatic <K,
V> HashMap <K, V> HashMap.iteratorHashMap
(Iterator<P2<K, V>> entries) Converts the Iterator to a HashMapstatic <K,
V> TreeMap <K, V> TreeMap.iteratorTreeMap
(Ord<K> keyOrd, Iterator<P2<K, V>> it) Constructs a tree map from the given elements.static <A,
B> Option <B> Returns an associated value with the given key in the list of pairs.<A,
B> HashMap <A, B> <A,
B> HashMap <A, B> <A,
B> HashMap <A, B> <A,
B> HashMap <A, B> static <K,
A> PriorityQueue <K, A> PriorityQueue.priorityQueue
(Equal<K> e, FingerTree<K, P2<K, A>> ft) Creates a priority queue from a finger tree.static <K,
V> TreeMap <K, V> TreeMap.setTreeMap
(Ord<K> ord, Set<P2<K, Option<V>>> s) Constructs a TreeMap from the given set.private static <S,
A> State <S, A> State.suspended
(F<S, Trampoline<P2<S, A>>> runF) static <A,
B> List <A> Unfolds across the given function starting at the given value to produce a list.static <A,
B> Stream <A> Unfolds across the given function starting at the given value to produce a stream.Tree.unfoldTree
(F<B, P2<A, P1<Stream<B>>>> f) Builds a tree from a seed value.The expressiont1.union(t2)
takes the left-biased union oft1
andt2
.static <S,
A> State <S, A> <B> B
Performs a reduction on this priority queue using the given arguments.Transforms an array of pairs into an array of first components and an array of second components.Transforms a list of pairs into a list of first components and a list of second components.static <A,
B> P2 <NonEmptyList<A>, NonEmptyList<B>> NonEmptyList.unzip
(NonEmptyList<P2<A, B>> xs) Transforms a non empty list of pairs into a non empty list of first components and a non empty list of second components.Transforms a stream of pairs into a stream of first components and a stream of second components. -
Uses of P2 in fj.data.fingertrees
Methods in fj.data.fingertrees that return P2Modifier and TypeMethodDescriptionfinal P2
<FingerTree<V, A>, FingerTree<V, A>> Splits this tree into a pair of subtrees at the point where the given predicate, based on the measure, changes fromfalse
totrue
.Methods in fj.data.fingertrees that return types with arguments of type P2Modifier and TypeMethodDescriptionstatic <A> FingerTree
<Integer, P2<Integer, A>> FingerTree.emptyIntMax()
Returns a finger tree which combines the integer node annotations with the maximum function. -
Uses of P2 in fj.data.hamt
Fields in fj.data.hamt with type parameters of type P2Methods in fj.data.hamt that return types with arguments of type P2Modifier and TypeMethodDescriptionHashArrayMappedTrie.toList()
Returns a list of key-value pairs.Returns the list of key-value pairs, ordered by key.HashArrayMappedTrie.toStream()
Returns a stream of key-value pairs.Node.toStream()
Methods in fj.data.hamt with parameters of type P2Method parameters in fj.data.hamt with type arguments of type P2Modifier and TypeMethodDescription<B> B
Performs a left-fold reduction across this trie.<B> B
Performs a left-fold reduction across this trie.<B> B
Performs a reduction on this Node using the given arguments.Adds the product of key-value (k, v) pairs to the trie.Constructors in fj.data.hamt with parameters of type P2Constructor parameters in fj.data.hamt with type arguments of type P2 -
Uses of P2 in fj.data.hlist
Methods in fj.data.hlist with type parameters of type P2Modifier and TypeMethodDescriptionstatic <E,
G, V, L extends HList<L>, R, RR, H extends HList.HFoldr<G, V, L, R>, PP extends HList.Apply<G, P2<E, R>, RR>>
HList.HFoldr<G, V, HList.HCons<E, L>, RR> HList.HFoldr.hFoldr
(PP p, H h) A fold instance for a non-empty heterogeneous listMethods in fj.data.hlist that return types with arguments of type P2Modifier and TypeMethodDescriptionstatic <A,
B, C> HList.Apply <HList.HAppend<A, B, C>, P2<A, B>, C> HList.Apply.append()
A function application operator for concatenating heterogeneous lists.HList.Apply.comp()
A function application operator for function composition.static <E,
L extends HList<L>>
HList.Apply<Unit, P2<E, L>, HList.HCons<E, L>> HList.Apply.cons()
An operator for the construction of heterogeneous lists.abstract <E> HList.Apply
<Unit, P2<E, A>, HList.HCons<E, A>> HList.extender()
<X> HList.Apply
<Unit, P2<X, HList.HCons<E, L>>, HList.HCons<X, HList.HCons<E, L>>> HList.HCons.extender()
<E> HList.Apply
<Unit, P2<E, HList.HNil>, HList.HCons<E, HList.HNil>> HList.HNil.extender()
-
Uses of P2 in fj.data.optic
Methods in fj.data.optic that return types with arguments of type P2Modifier and TypeMethodDescriptionGetter.first()
Getter.first()
Iso.first()
Iso.first()
Optional.first()
Optional.first()
PIso.first()
PIso.first()
PIso.first()
PIso.first()
POptional.first()
POptional.first()
POptional.first()
POptional.first()
pair two disjointGetter
pair two disjointGetter
pair two disjointIso
pair two disjointIso
pair two disjointPIso
pair two disjointPIso
pair two disjointPIso
pair two disjointPIso
Getter.second()
Getter.second()
Iso.second()
Iso.second()
Optional.second()
Optional.second()
PIso.second()
PIso.second()
PIso.second()
PIso.second()
POptional.second()
POptional.second()
POptional.second()
POptional.second()
-
Uses of P2 in fj.data.vector
Fields in fj.data.vector declared as P2Methods in fj.data.vector that return P2Modifier and TypeMethodDescriptionV2.p()
Returns a homogeneous product-2 equivalent to this vector.Methods in fj.data.vector that return types with arguments of type P2Modifier and TypeMethodDescriptionV2.p_()
Returns a function that transforms a vector-2 to the equivalent product-2.Zips this vector with the given vector to produce a vector of pairs.Zips this vector with the given vector to produce a vector of pairs.Zips this vector with the given vector to produce a vector of pairs.Zips this vector with the given vector to produce a vector of pairs.Zips this vector with the given vector to produce a vector of pairs.Zips this vector with the given vector to produce a vector of pairs.Zips this vector with the given vector to produce a vector of pairs.Methods in fj.data.vector with parameters of type P2Modifier and TypeMethodDescriptionstatic <A> V2
<A> Creates a vector-2 from a homogeneous product-2.Constructors in fj.data.vector with parameters of type P2 -
Uses of P2 in fj.function
Method parameters in fj.function with type arguments of type P2Modifier and TypeMethodDescriptionVisitor.association
(List<P2<A, B>> x, Equal<A> eq) Uses an association list to perform a lookup with equality and returns a function that can be applied to a default, followed by the associated key to return a value.Visitor.associationLazy
(List<P2<A, B>> x, Equal<A> eq) Uses an association list to perform a lookup with equality and returns a function that can be applied to a default, followed by the associated key to return a value.