public final class ParModule
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
<A> F<Effect1<A>,Actor<A>> |
actor()
A first-class constructor of actors.
|
<A> Actor<A> |
actor(Effect1<A> e)
Creates a concurrent actor that is guaranteed to process only one message at a time.
|
<A> F<Effect1<A>,Actor<A>> |
effect()
A first-class constructor of concurrent effects, as actors that don't guarantee ordering of messages.
|
<A> Actor<A> |
effect(Effect1<A> e)
Creates a very fast concurrent effect, as an actor that does not guarantee ordering of its messages.
|
<A,B> F<F<A,Promise<B>>,F<List<A>,Promise<List<B>>>> |
mapList()
First-class function that maps a concurrent function over a List inside a promise.
|
<A,B> Promise<List<B>> |
mapM(List<A> as,
F<A,Promise<B>> f)
Takes a Promise-valued function and applies it to each element
in the given List, yielding a promise of a List of results.
|
<A,B> Promise<P1<B>> |
mapM(P1<A> a,
F<A,Promise<B>> f)
Maps a concurrent function over a Product-1 inside a Promise.
|
<A,B> Promise<Stream<B>> |
mapM(Stream<A> as,
F<A,Promise<B>> f)
Takes a Promise-valued function and applies it to each element
in the given Stream, yielding a promise of a Stream of results.
|
<A,B> F<F<A,Promise<B>>,F<Stream<A>,Promise<Stream<B>>>> |
mapStream()
First-class function that maps a concurrent function over a Stream inside a promise.
|
<A,B> Promise<NonEmptyList<B>> |
parExtend(NonEmptyList<A> as,
F<NonEmptyList<A>,B> f)
Maps the given function across all sublists of the given NonEmptyList in parallel.
|
<A,B> Promise<Tree<B>> |
parExtend(Tree<A> ta,
F<Tree<A>,B> f)
Maps the given function across all subtrees of the given Tree in parallel.
|
<A,B> Promise<TreeZipper<B>> |
parExtend(TreeZipper<A> za,
F<TreeZipper<A>,B> f)
Maps the given function across all positions of the given TreeZipper in parallel.
|
<A,B> Promise<Zipper<B>> |
parExtend(Zipper<A> za,
F<Zipper<A>,B> f)
Maps the given function across all positions of the given zipper in parallel.
|
<A,B> Promise<Array<B>> |
parFlatMap(Array<A> as,
F<A,Array<B>> f)
Binds an Array-valued function across an Array in parallel, concatenating the results into a new Array.
|
<A,B> Promise<java.lang.Iterable<B>> |
parFlatMap(java.lang.Iterable<A> as,
F<A,java.lang.Iterable<B>> f)
Binds an Iterable-valued function across an Iterable in parallel, concatenating the results into a new Iterable.
|
<A,B> Promise<List<B>> |
parFlatMap(List<A> as,
F<A,List<B>> f)
Binds a list-valued function across a list in parallel, concatenating the results into a new list.
|
<A,B> Promise<Stream<B>> |
parFlatMap(Stream<A> as,
F<A,Stream<B>> f)
Binds a Stream-valued function across a Stream in parallel, concatenating the results into a new Stream.
|
<A,B> Promise<B> |
parFoldMap(java.lang.Iterable<A> as,
F<A,B> map,
Monoid<B> reduce)
Maps with the given function across the given iterable in parallel, while folding with
the given monoid.
|
<A,B> Promise<B> |
parFoldMap(java.lang.Iterable<A> as,
F<A,B> map,
Monoid<B> reduce,
F<java.lang.Iterable<A>,P2<java.lang.Iterable<A>,java.lang.Iterable<A>>> chunking)
Maps with the given function across chunks of the given Iterable in parallel, while folding with
the given monoid.
|
<A,B> Promise<B> |
parFoldMap(Stream<A> as,
F<A,B> map,
Monoid<B> reduce)
Maps with the given function across the given stream in parallel, while folding with
the given monoid.
|
<A,B> Promise<B> |
parFoldMap(Stream<A> as,
F<A,B> map,
Monoid<B> reduce,
F<Stream<A>,P2<Stream<A>,Stream<A>>> chunking)
Maps with the given function across chunks of the given stream in parallel, while folding with
the given monoid.
|
<A,B> Promise<Array<B>> |
parMap(Array<A> as,
F<A,B> f)
Maps across an Array in parallel.
|
<A,B> Promise<java.lang.Iterable<B>> |
parMap(java.lang.Iterable<A> as,
F<A,B> f)
Maps across an Iterable in parallel.
|
<A,B> Promise<List<B>> |
parMap(List<A> as,
F<A,B> f)
Maps across a list in parallel.
|
<A,B> Promise<NonEmptyList<B>> |
parMap(NonEmptyList<A> as,
F<A,B> f)
Maps across a nonempty list in parallel.
|
<A,B> Promise<Stream<B>> |
parMap(Stream<A> as,
F<A,B> f)
Maps across a Stream in parallel.
|
<A,B> Promise<Tree<B>> |
parMap(Tree<A> ta,
F<A,B> f)
Maps a function across a Tree in parallel.
|
<A,B> Promise<TreeZipper<B>> |
parMap(TreeZipper<A> za,
F<A,B> f)
Maps a function across a TreeZipper in parallel.
|
<A,B> Promise<Zipper<B>> |
parMap(Zipper<A> za,
F<A,B> f)
Maps a function across a Zipper in parallel.
|
<A,B> F<F<A,B>,F<Array<A>,Promise<Array<B>>>> |
parMapArray()
A first-class function that maps another function across an array in parallel.
|
<A,B> F<F<A,B>,F<java.lang.Iterable<A>,Promise<java.lang.Iterable<B>>>> |
parMapIterable()
A first-class function that maps another function across an iterable in parallel.
|
<A,B> F<F<A,B>,F<List<A>,Promise<List<B>>>> |
parMapList()
A first-class function that maps another function across a list in parallel.
|
<A,B> F<F<A,B>,F<Stream<A>,Promise<Stream<B>>>> |
parMapStream()
A first-class function that maps another function across a stream in parallel.
|
<A,B> F<F<A,B>,F<Tree<A>,Promise<Tree<B>>>> |
parMapTree()
A first-class function that maps across a Tree in parallel.
|
static ParModule |
parModule(Strategy<Unit> u)
Constructor method for ParModule
|
<A,B,C> Promise<Array<C>> |
parZipWith(Array<A> as,
Array<B> bs,
F<A,F<B,C>> f)
Zips two arrays together with a given function, in parallel.
|
<A,B,C> Promise<java.lang.Iterable<C>> |
parZipWith(java.lang.Iterable<A> as,
java.lang.Iterable<B> bs,
F<A,F<B,C>> f)
Zips two iterables together with a given function, in parallel.
|
<A,B,C> Promise<List<C>> |
parZipWith(List<A> as,
List<B> bs,
F<A,F<B,C>> f)
Zips two lists together with a given function, in parallel.
|
<A,B,C> Promise<Stream<C>> |
parZipWith(Stream<A> as,
Stream<B> bs,
F<A,F<B,C>> f)
Zips two streams together with a given function, in parallel.
|
<A> F<P1<A>,Promise<A>> |
promise()
Returns a function that evaluates a given product concurrently and returns a Promise of the result.
|
<A,B> F<A,Promise<B>> |
promise(F<A,B> f)
Promotes the given function to a concurrent function that returns a Promise.
|
<A,B,C> F2<A,B,Promise<C>> |
promise(F2<A,B,C> f)
Promotes the given function to a concurrent function that returns a Promise.
|
<A> Promise<A> |
promise(P1<A> p)
Evaluates the given product concurrently and returns a Promise of the result.
|
<A,B> F<F<A,B>,F<A,Promise<B>>> |
promisePure()
Returns a function that promotes a given function to a concurrent function that returns a Promise.
|
<A> Promise<List<A>> |
sequence(List<Promise<A>> ps)
List iteration inside a Promise.
|
<A> Promise<P1<A>> |
sequence(P1<Promise<A>> p)
Traverses a product-1 inside a promise.
|
<A> Promise<Stream<A>> |
sequence(Stream<Promise<A>> ps)
Stream iteration inside a Promise.
|
<A> F<List<Promise<A>>,Promise<List<A>>> |
sequenceList()
A first-class function that traverses a list inside a promise.
|
<A> F<Stream<Promise<A>>,Promise<Stream<A>>> |
sequenceStream()
A first-class function that traverses a stream inside a promise.
|
public static ParModule parModule(Strategy<Unit> u)
u
- A parallel strategy for the module.public <A> Promise<A> promise(P1<A> p)
p
- A product to evaluate concurrently.public <A> F<P1<A>,Promise<A>> promise()
public <A,B> F<A,Promise<B>> promise(F<A,B> f)
f
- A given function to promote to a concurrent function.public <A,B> F<F<A,B>,F<A,Promise<B>>> promisePure()
public <A,B,C> F2<A,B,Promise<C>> promise(F2<A,B,C> f)
f
- A given function to promote to a concurrent function.public <A> Actor<A> effect(Effect1<A> e)
e
- The effect that the actor should have on its messages.public <A> F<Effect1<A>,Actor<A>> effect()
public <A> Actor<A> actor(Effect1<A> e)
e
- The effect that the actor should have on its messages.public <A> F<Effect1<A>,Actor<A>> actor()
public <A> Promise<List<A>> sequence(List<Promise<A>> ps)
ps
- A list of promises to sequence.public <A> F<List<Promise<A>>,Promise<List<A>>> sequenceList()
public <A> Promise<Stream<A>> sequence(Stream<Promise<A>> ps)
ps
- A Stream of promises to sequence.public <A> F<Stream<Promise<A>>,Promise<Stream<A>>> sequenceStream()
public <A> Promise<P1<A>> sequence(P1<Promise<A>> p)
p
- A product-1 of a promised value.public <A,B> Promise<List<B>> mapM(List<A> as, F<A,Promise<B>> f)
as
- A list to map across.f
- A promise-valued function to map across the list.public <A,B> F<F<A,Promise<B>>,F<List<A>,Promise<List<B>>>> mapList()
public <A,B> Promise<Stream<B>> mapM(Stream<A> as, F<A,Promise<B>> f)
as
- A Stream to map across.f
- A promise-valued function to map across the Stream.public <A,B> F<F<A,Promise<B>>,F<Stream<A>,Promise<Stream<B>>>> mapStream()
public <A,B> Promise<P1<B>> mapM(P1<A> a, F<A,Promise<B>> f)
a
- A product-1 across which to map.f
- A concurrent function to map over the product inside a promise.public <A,B> Promise<List<B>> parMap(List<A> as, F<A,B> f)
as
- A list to map across in parallel.f
- A function to map across the given list.public <A,B> F<F<A,B>,F<List<A>,Promise<List<B>>>> parMapList()
public <A,B> Promise<NonEmptyList<B>> parMap(NonEmptyList<A> as, F<A,B> f)
as
- A NonEmptyList to map across in parallel.f
- A function to map across the given NonEmptyList.public <A,B> Promise<Stream<B>> parMap(Stream<A> as, F<A,B> f)
as
- A Stream to map across in parallel.f
- A function to map across the given Stream.public <A,B> F<F<A,B>,F<Stream<A>,Promise<Stream<B>>>> parMapStream()
public <A,B> Promise<java.lang.Iterable<B>> parMap(java.lang.Iterable<A> as, F<A,B> f)
as
- An Iterable to map across in parallel.f
- A function to map across the given Iterable.public <A,B> F<F<A,B>,F<java.lang.Iterable<A>,Promise<java.lang.Iterable<B>>>> parMapIterable()
public <A,B> Promise<Array<B>> parMap(Array<A> as, F<A,B> f)
as
- An array to map across in parallel.f
- A function to map across the given Array.public <A,B> F<F<A,B>,F<Array<A>,Promise<Array<B>>>> parMapArray()
public <A,B> Promise<Zipper<B>> parMap(Zipper<A> za, F<A,B> f)
za
- A Zipper to map across in parallel.f
- A function to map across the given Zipper.public <A,B> Promise<Tree<B>> parMap(Tree<A> ta, F<A,B> f)
ta
- A Tree to map across in parallel.f
- A function to map across the given Tree.public <A,B> F<F<A,B>,F<Tree<A>,Promise<Tree<B>>>> parMapTree()
public <A,B> Promise<TreeZipper<B>> parMap(TreeZipper<A> za, F<A,B> f)
za
- A TreeZipper to map across in parallel.f
- A function to map across the given TreeZipper.public <A,B> Promise<List<B>> parFlatMap(List<A> as, F<A,List<B>> f)
as
- A list to bind across in parallel.f
- A function to bind across the given list in parallel.public <A,B> Promise<Stream<B>> parFlatMap(Stream<A> as, F<A,Stream<B>> f)
as
- A Stream to bind across in parallel.f
- A function to bind across the given Stream in parallel.public <A,B> Promise<Array<B>> parFlatMap(Array<A> as, F<A,Array<B>> f)
as
- An Array to bind across in parallel.f
- A function to bind across the given Array in parallel.public <A,B> Promise<java.lang.Iterable<B>> parFlatMap(java.lang.Iterable<A> as, F<A,java.lang.Iterable<B>> f)
as
- A Iterable to bind across in parallel.f
- A function to bind across the given Iterable in parallel.public <A,B,C> Promise<List<C>> parZipWith(List<A> as, List<B> bs, F<A,F<B,C>> f)
as
- A list to zip with another in parallel.bs
- A list to zip with another in parallel.f
- A function with which to zip two lists in parallel.public <A,B,C> Promise<Stream<C>> parZipWith(Stream<A> as, Stream<B> bs, F<A,F<B,C>> f)
as
- A stream to zip with another in parallel.bs
- A stream to zip with another in parallel.f
- A function with which to zip two streams in parallel.public <A,B,C> Promise<Array<C>> parZipWith(Array<A> as, Array<B> bs, F<A,F<B,C>> f)
as
- An array to zip with another in parallel.bs
- An array to zip with another in parallel.f
- A function with which to zip two arrays in parallel.public <A,B,C> Promise<java.lang.Iterable<C>> parZipWith(java.lang.Iterable<A> as, java.lang.Iterable<B> bs, F<A,F<B,C>> f)
as
- An iterable to zip with another in parallel.bs
- An iterable to zip with another in parallel.f
- A function with which to zip two iterables in parallel.public <A,B> Promise<B> parFoldMap(Stream<A> as, F<A,B> map, Monoid<B> reduce)
as
- A stream to map over and reduce.map
- The function to map over the given stream.reduce
- The monoid with which to sum the results.public <A,B> Promise<B> parFoldMap(Stream<A> as, F<A,B> map, Monoid<B> reduce, F<Stream<A>,P2<Stream<A>,Stream<A>>> chunking)
as
- A stream to chunk, then map over and reduce.map
- The function to map over the given stream.reduce
- The monoid with which to sum the results.chunking
- A function describing how the stream should be split into chunks. Should return the first chunk
and the rest of the stream.public <A,B> Promise<B> parFoldMap(java.lang.Iterable<A> as, F<A,B> map, Monoid<B> reduce, F<java.lang.Iterable<A>,P2<java.lang.Iterable<A>,java.lang.Iterable<A>>> chunking)
as
- An Iterable to chunk, then map over and reduce.map
- The function to map over the given Iterable.reduce
- The monoid with which to sum the results.chunking
- A function describing how the Iterable should be split into chunks. Should return the first chunk
and the rest of the Iterable.public <A,B> Promise<B> parFoldMap(java.lang.Iterable<A> as, F<A,B> map, Monoid<B> reduce)
as
- An Iterable to map over and reduce.map
- The function to map over the given Iterable.reduce
- The Monoid with which to sum the results.public <A,B> Promise<Zipper<B>> parExtend(Zipper<A> za, F<Zipper<A>,B> f)
za
- A zipper to extend the given function across.f
- A function to extend across the given zipper.public <A,B> Promise<Tree<B>> parExtend(Tree<A> ta, F<Tree<A>,B> f)
ta
- A tree to extend the given function across.f
- A function to extend across the given Tree.public <A,B> Promise<TreeZipper<B>> parExtend(TreeZipper<A> za, F<TreeZipper<A>,B> f)
za
- A TreeZipper to extend the given function across.f
- A function to extend across the given TreeZipper.public <A,B> Promise<NonEmptyList<B>> parExtend(NonEmptyList<A> as, F<NonEmptyList<A>,B> f)
as
- A NonEmptyList to extend the given function across.f
- A function to extend across the given NonEmptyList