|
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.FW<A,B>
public final class FW<A,B>
A wrapper for functions of arity 1, that decorates them with higher-order functions.
Method Summary | ||
---|---|---|
static
|
$()
First-class constructor for FW. |
|
static
|
$(F<A,B> f)
Wraps the given function, decorating it with higher-order functions. |
|
|
andThen_()
First-class composition flipped. |
|
|
andThen(F<B,C> g)
Function composition flipped. |
|
|
apply()
First-class function application in an environment. |
|
|
apply(F<A,F<B,C>> g)
Function application in an environment (Applicative Functor). |
|
FW<A,Array<B>> |
array()
Promotes this function so that it returns its result in an Array. |
|
|
bind()
First-class function binding. |
|
|
bind(F<B,F<A,C>> g)
Binds a given function across this function (Reader Monad). |
|
FW<Actor<B>,Actor<A>> |
comapActor()
Returns a function that comaps over a given actor. |
|
FW<Equal<B>,Equal<A>> |
comapEqual()
Promotes this function to map over an Equal as a contravariant functor. |
|
FW<Hash<B>,Hash<A>> |
comapHash()
Promotes this function to map over a Hash as a contravariant functor. |
|
FW<Show<B>,Show<A>> |
comapShow()
Promotes this function to map over a Show as a contravariant functor. |
|
|
eitherLeft()
Promotes this function so that it returns its result on the left side of an Either. |
|
|
eitherRight()
Promotes this function so that it returns its result on the right side of an Either. |
|
B |
f(A a)
Function application |
|
|
fail()
Promotes this function so that it returns its result on the failure side of a Validation. |
|
FW<Tree<A>,B> |
foldMapTree(Monoid<B> m)
Returns a function that maps this function over a tree and folds it with the given monoid. |
|
FW<A,IterableW<B>> |
iterable()
Promotes this function to return its value in an Iterable. |
|
FW<A,P1<B>> |
lazy()
Promotes this function so that it returns its result in a product-1. |
|
FW<A,List<B>> |
list()
Promotes this function so that it returns its result in a List. |
|
ArrayBlockingQueue<B> |
map(ArrayBlockingQueue<A> as)
Maps this function over an ArrayBlockingQueue. |
|
ArrayList<B> |
map(ArrayList<A> as)
Maps this function over an ArrayList. |
|
ConcurrentLinkedQueue<B> |
map(ConcurrentLinkedQueue<A> as)
Maps this function over a ConcurrentLinkedQueue. |
|
CopyOnWriteArrayList<B> |
map(CopyOnWriteArrayList<A> as)
Maps this function over a CopyOnWriteArrayList. |
|
CopyOnWriteArraySet<B> |
map(CopyOnWriteArraySet<A> as)
Maps this function over a CopyOnWriteArraySet. |
|
LinkedBlockingQueue<B> |
map(LinkedBlockingQueue<A> as)
Maps this function over a LinkedBlockingQueue. |
|
LinkedList<B> |
map(LinkedList<A> as)
Maps this function over a LinkedList. |
|
PriorityBlockingQueue<B> |
map(PriorityBlockingQueue<A> as)
Maps this function over a PriorityBlockingQueue. |
|
PriorityQueue<B> |
map(PriorityQueue<A> as)
Maps this function over a PriorityQueue. |
|
SynchronousQueue<B> |
map(SynchronousQueue<A> as)
Maps this function over a SynchronousQueue. |
|
TreeSet<B> |
map(TreeSet<A> as)
Maps this function over a TreeSet. |
|
FW<Array<A>,Array<B>> |
mapArray()
Promotes this function to map over a Stream. |
|
FW<P2<A,A>,P2<B,B>> |
mapBoth()
Promotes this function to map over both elements of a pair. |
|
|
mapFail()
Promotes this function to map over the failure side of a Validation. |
|
|
mapFst()
Promotes this function to map over the first element of a pair. |
|
FW<Iterable<A>,IterableW<B>> |
mapIterable()
Promotes this function to map over Iterables. |
|
|
mapLeft()
Promotes this function to map over the left side of an Either. |
|
FW<List<A>,List<B>> |
mapList()
Promotes this function to map over a List. |
|
FW<NonEmptyList<A>,NonEmptyList<B>> |
mapNel()
Promotes this function to map over a NonEmptyList. |
|
FW<Option<A>,Option<B>> |
mapOption()
Promotes this function to map over an optional value. |
|
FW<P1<A>,P1<B>> |
mapP1()
Promotes this function to map over a product-1. |
|
FW<Promise<A>,Promise<B>> |
mapPromise()
Promotes this function to map over a Promise. |
|
|
mapRight()
Promotes this function to map over the right side of an Either. |
|
FW<Set<A>,Set<B>> |
mapSet(Ord<B> o)
Promotes this function to map over a Set. |
|
|
mapSnd()
Promotes this function to map over the second element of a pair. |
|
FW<Stream<A>,Stream<B>> |
mapStream()
Promotes this function to map over a Stream. |
|
|
mapSuccess()
Promotes this function to map over the success side of a Validation. |
|
FW<Tree<A>,Tree<B>> |
mapTree()
Promotes this function to map over a Tree. |
|
FW<TreeZipper<A>,TreeZipper<B>> |
mapTreeZipper()
Promotes this function to map over a TreeZipper. |
|
FW<Zipper<A>,Zipper<B>> |
mapZipper()
Promotes this function to map over a Zipper. |
|
FW<A,NonEmptyList<B>> |
nel()
Promotes this function to return its value in a NonEmptyList. |
|
|
o_()
First-class function composition |
|
|
o(F<C,A> g)
Function composition |
|
|
on()
First-class composition with a function of arity-2 |
|
|
on(F<B,F<B,C>> g)
Applies this function over the arguments of another function. |
|
FW<Validation<B,A>,B> |
onFail()
Returns a function that returns the failure side of a given Validation, or this function applied to the success side. |
|
FW<Either<B,A>,B> |
onLeft()
Returns a function that returns the left side of a given Either, or this function applied to the right side. |
|
FW<Either<A,B>,B> |
onRight()
Returns a function that returns the right side of a given Either, or this function applied to the left side. |
|
FW<Validation<A,B>,B> |
onSuccess()
Returns a function that returns the success side of a given Validation, or this function applied to the failure side. |
|
FW<A,Option<B>> |
option()
Promotes this function so that it returns its result in an Option. |
|
FW<A,Promise<B>> |
promise(Strategy<Unit> s)
Promotes this function to a concurrent function that returns a Promise of a value. |
|
FW<A,Set<B>> |
set(Ord<B> o)
Promotes this function to return its value in a Set. |
|
FW<A,Stream<B>> |
stream()
Promotes this function so that it returns its result in a Stream. |
|
|
success()
Promotes this function so that it returns its result on the success side of an Validation. |
|
FW<A,Tree<B>> |
tree()
Promotes this function to return its value in a Tree. |
|
FW<A,TreeZipper<B>> |
treeZipper()
Promotes this function to return its value in a TreeZipper. |
|
FW<? super A,? extends B> |
vary()
Simultaneously covaries and contravaries a function. |
|
FW<A,Zipper<B>> |
zipper()
Promotes this function to return its value in a Zipper. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static <A,B> FW<A,B> $(F<A,B> f)
f
- A function to wrap.
public static <A,B> FW<F<A,B>,FW<A,B>> $()
public B f(A a)
f
in interface F<A,B>
a
- The A
to transform.
public <C> FW<C,B> o(F<C,A> g)
g
- A function to compose with this one.
public <C> FW<F<C,A>,F<C,B>> o_()
public <C> FW<A,C> andThen(F<B,C> g)
g
- A function with which to compose this one.
public <C> FW<F<B,C>,F<A,C>> andThen_()
public FW<? super A,? extends B> vary()
public <C> FW<A,C> bind(F<B,F<A,C>> g)
g
- A function that takes the return value of this function as an argument, yielding a new function.
public <C> FW<F<B,F<A,C>>,F<A,C>> bind()
public <C> FW<A,C> apply(F<A,F<B,C>> g)
g
- A function with the same argument type as this function, yielding a function that takes the return
value of this function.
public <C> FW<F<A,F<B,C>>,F<A,C>> apply()
public <C> FW<A,F<A,C>> on(F<B,F<B,C>> g)
g
- The function over whose arguments to apply this function.
public <C> FW<F<B,F<B,C>>,F<A,F<A,C>>> on()
public FW<A,P1<B>> lazy()
public FW<P1<A>,P1<B>> mapP1()
public FW<A,Option<B>> option()
public FW<Option<A>,Option<B>> mapOption()
public FW<A,List<B>> list()
public FW<List<A>,List<B>> mapList()
public FW<A,Stream<B>> stream()
public FW<Stream<A>,Stream<B>> mapStream()
public FW<A,Array<B>> array()
public FW<Array<A>,Array<B>> mapArray()
public FW<Actor<B>,Actor<A>> comapActor()
public FW<A,Promise<B>> promise(Strategy<Unit> s)
s
- A parallel strategy for concurrent execution.
public FW<Promise<A>,Promise<B>> mapPromise()
public <C> FW<A,Either<B,C>> eitherLeft()
public <C> FW<A,Either<C,B>> eitherRight()
public <X> FW<Either<A,X>,Either<B,X>> mapLeft()
public <X> FW<Either<X,A>,Either<X,B>> mapRight()
public FW<Either<B,A>,B> onLeft()
public FW<Either<A,B>,B> onRight()
public FW<A,IterableW<B>> iterable()
public FW<Iterable<A>,IterableW<B>> mapIterable()
public FW<A,NonEmptyList<B>> nel()
public FW<NonEmptyList<A>,NonEmptyList<B>> mapNel()
public FW<A,Set<B>> set(Ord<B> o)
o
- An order for the set.
public FW<Set<A>,Set<B>> mapSet(Ord<B> o)
o
- An order for the resulting set.
public FW<A,Tree<B>> tree()
public FW<Tree<A>,Tree<B>> mapTree()
public FW<Tree<A>,B> foldMapTree(Monoid<B> m)
m
- The monoid with which to fold the mapped tree.
public FW<A,TreeZipper<B>> treeZipper()
public FW<TreeZipper<A>,TreeZipper<B>> mapTreeZipper()
public <C> FW<A,Validation<B,C>> fail()
public <C> FW<A,Validation<C,B>> success()
public <X> FW<Validation<A,X>,Validation<B,X>> mapFail()
public <X> FW<Validation<X,A>,Validation<X,B>> mapSuccess()
public FW<Validation<B,A>,B> onFail()
public FW<Validation<A,B>,B> onSuccess()
public FW<A,Zipper<B>> zipper()
public FW<Zipper<A>,Zipper<B>> mapZipper()
public FW<Equal<B>,Equal<A>> comapEqual()
public FW<Hash<B>,Hash<A>> comapHash()
public FW<Show<B>,Show<A>> comapShow()
public <C> FW<P2<A,C>,P2<B,C>> mapFst()
public <C> FW<P2<C,A>,P2<C,B>> mapSnd()
public FW<P2<A,A>,P2<B,B>> mapBoth()
public SynchronousQueue<B> map(SynchronousQueue<A> as)
as
- A SynchronousQueue to map this function over.
public PriorityBlockingQueue<B> map(PriorityBlockingQueue<A> as)
as
- A PriorityBlockingQueue to map this function over.
public LinkedBlockingQueue<B> map(LinkedBlockingQueue<A> as)
as
- A LinkedBlockingQueue to map this function over.
public CopyOnWriteArraySet<B> map(CopyOnWriteArraySet<A> as)
as
- A CopyOnWriteArraySet to map this function over.
public CopyOnWriteArrayList<B> map(CopyOnWriteArrayList<A> as)
as
- A CopyOnWriteArrayList to map this function over.
public ConcurrentLinkedQueue<B> map(ConcurrentLinkedQueue<A> as)
as
- A ConcurrentLinkedQueue to map this function over.
public ArrayBlockingQueue<B> map(ArrayBlockingQueue<A> as)
as
- An ArrayBlockingQueue to map this function over.
public TreeSet<B> map(TreeSet<A> as)
as
- A TreeSet to map this function over.
public PriorityQueue<B> map(PriorityQueue<A> as)
as
- A PriorityQueue to map this function over.
public LinkedList<B> map(LinkedList<A> as)
as
- A LinkedList to map this function over.
public ArrayList<B> map(ArrayList<A> as)
as
- An ArrayList to map this function over.
|
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 |