|
Copyright 2008 - 2009 Tony Morris, Runar Bjarnason, Tom Adams, Brad Clow, Ricky Clarkson, Nick Partridge, Jason Zaugg This software is released under an open source BSD licence. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfj.control.parallel.ParModule
public final class ParModule
A module of higher-order concurrency features.
Method Summary | ||
---|---|---|
|
actor()
A first-class constructor of actors. |
|
|
actor(Effect<A> e)
Creates a concurrent actor that is guaranteed to process only one message at a time. |
|
|
effect()
A first-class constructor of concurrent effects, as actors that don't guarantee ordering of messages. |
|
|
effect(Effect<A> e)
Creates a very fast concurrent effect, as an actor that does not guarantee ordering of its messages. |
|
|
mapList()
First-class function that maps a concurrent function over a List inside a promise. |
|
|
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. |
|
|
mapM(P1<A> a,
F<A,Promise<B>> f)
Maps a concurrent function over a Product-1 inside a Promise. |
|
|
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. |
|
|
mapStream()
First-class function that maps a concurrent function over a Stream inside a promise. |
|
|
parExtend(NonEmptyList<A> as,
F<NonEmptyList<A>,B> f)
Maps the given function across all sublists of the given NonEmptyList in parallel. |
|
|
parExtend(Tree<A> ta,
F<Tree<A>,B> f)
Maps the given function across all subtrees of the given Tree in parallel. |
|
|
parExtend(TreeZipper<A> za,
F<TreeZipper<A>,B> f)
Maps the given function across all positions of the given TreeZipper in parallel. |
|
|
parExtend(Zipper<A> za,
F<Zipper<A>,B> f)
Maps the given function across all positions of the given zipper in parallel. |
|
|
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. |
|
|
parFlatMap(Iterable<A> as,
F<A,Iterable<B>> f)
Binds an Iterable-valued function across an Iterable in parallel, concatenating the results into a new Iterable. |
|
|
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. |
|
|
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. |
|
|
parFoldMap(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. |
|
|
parFoldMap(Iterable<A> as,
F<A,B> map,
Monoid<B> reduce,
F<Iterable<A>,P2<Iterable<A>,Iterable<A>>> chunking)
Maps with the given function across chunks of the given Iterable in parallel, while folding with the given monoid. |
|
|
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. |
|
|
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. |
|
|
parMap(Array<A> as,
F<A,B> f)
Maps across an Array in parallel. |
|
|
parMap(Iterable<A> as,
F<A,B> f)
Maps across an Iterable in parallel. |
|
|
parMap(List<A> as,
F<A,B> f)
Maps across a list in parallel. |
|
|
parMap(NonEmptyList<A> as,
F<A,B> f)
Maps across a nonempty list in parallel. |
|
|
parMap(Stream<A> as,
F<A,B> f)
Maps across a Stream in parallel. |
|
|
parMap(Tree<A> ta,
F<A,B> f)
Maps a function across a Tree in parallel. |
|
|
parMap(TreeZipper<A> za,
F<A,B> f)
Maps a function across a TreeZipper in parallel. |
|
|
parMap(Zipper<A> za,
F<A,B> f)
Maps a function across a Zipper in parallel. |
|
|
parMapArray()
A first-class function that maps another function across an array in parallel. |
|
|
parMapIterable()
A first-class function that maps another function across an iterable in parallel. |
|
|
parMapList()
A first-class function that maps another function across a list in parallel. |
|
|
parMapStream()
A first-class function that maps another function across a stream in parallel. |
|
|
parMapTree()
A first-class function that maps across a Tree in parallel. |
|
static ParModule |
parModule(Strategy<Unit> u)
Constructor method for ParModule |
|
|
parZipWith(Array<A> as,
Array<B> bs,
F<A,F<B,C>> f)
Zips two arrays together with a given function, in parallel. |
|
|
parZipWith(Iterable<A> as,
Iterable<B> bs,
F<A,F<B,C>> f)
Zips two iterables together with a given function, in parallel. |
|
|
parZipWith(List<A> as,
List<B> bs,
F<A,F<B,C>> f)
Zips two lists together with a given function, in parallel. |
|
|
parZipWith(Stream<A> as,
Stream<B> bs,
F<A,F<B,C>> f)
Zips two streams together with a given function, in parallel. |
|
|
promise()
Returns a function that evaluates a given product concurrently and returns a Promise of the result. |
|
|
promise(F<A,B> f)
Promotes the given function to a concurrent function that returns a Promise. |
|
|
promise(F2<A,B,C> f)
Promotes the given function to a concurrent function that returns a Promise. |
|
|
promise(P1<A> p)
Evaluates the given product concurrently and returns a Promise of the result. |
|
|
promisePure()
Returns a function that promotes a given function to a concurrent function that returns a Promise. |
|
|
sequence(List<Promise<A>> ps)
List iteration inside a Promise. |
|
|
sequence(P1<Promise<A>> p)
Traverses a product-1 inside a promise. |
|
|
sequence(Stream<Promise<A>> ps)
Stream iteration inside a Promise. |
|
|
sequenceList()
A first-class function that traverses a list inside a promise. |
|
|
sequenceStream()
A first-class function that traverses a stream inside a promise. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
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(Effect<A> e)
e
- The effect that the actor should have on its messages.
public <A> F<Effect<A>,Actor<A>> effect()
public <A> QueueActor<A> actor(Effect<A> e)
e
- The effect that the actor should have on its messages.
public <A> F<Effect<A>,QueueActor<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<Iterable<B>> parMap(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<Iterable<A>,Promise<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<Iterable<B>> parFlatMap(Iterable<A> as, F<A,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<Iterable<C>> parZipWith(Iterable<A> as, 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(Iterable<A> as, F<A,B> map, Monoid<B> reduce, F<Iterable<A>,P2<Iterable<A>,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(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
|
Copyright 2008 - 2009 Tony Morris, Runar Bjarnason, Tom Adams, Brad Clow, Ricky Clarkson, Nick Partridge, Jason Zaugg This software is released under an open source BSD licence. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |