public abstract class F<A,B>
extends java.lang.Object
A
to B
. This type can be represented
using the Java 7 closure syntax.Constructor and Description |
---|
F() |
Modifier and Type | Method and Description |
---|---|
<C> F<F<B,C>,F<A,C>> |
andThen()
First-class composition flipped.
|
<C> F<A,C> |
andThen(F<B,C> g)
Function composition flipped.
|
<C> F<F<A,F<B,C>>,F<A,C>> |
apply()
First-class function application in an environment.
|
<C> F<A,C> |
apply(F<A,F<B,C>> g)
Function application in an environment (Applicative Functor).
|
F<A,Array<B>> |
arrayK()
Promotes this function so that it returns its result in a Array.
|
<C> F<F<B,F<A,C>>,F<A,C>> |
bind()
First-class function binding.
|
<C> F<A,C> |
bind(F<B,F<A,C>> g)
Binds a given function across this function (Reader Monad).
|
F<Actor<B>,Actor<A>> |
comapActor()
Returns a function that comaps over a given actor.
|
F<Equal<B>,Equal<A>> |
comapEqual()
Promotes this function to map over an Equal as a contravariant functor.
|
F<Hash<B>,Hash<A>> |
comapHash()
Promotes this function to map over a Hash as a contravariant functor.
|
F<Show<B>,Show<A>> |
comapShow()
Promotes this function to map over a Show as a contravariant functor.
|
<C> F<A,Either<B,C>> |
eitherLeftK()
Promotes this function so that it returns its result on the left side of an Either.
|
<C> F<A,Either<C,B>> |
eitherRightK()
Promotes this function so that it returns its result on the right side of an Either.
|
abstract B |
f(A a)
Transform
A to B . |
<C> F<A,Validation<B,C>> |
failK()
Promotes this function so that it returns its result on the failure side of a Validation.
|
F<Tree<A>,B> |
foldMapTree(Monoid<B> m)
Returns a function that maps this function over a tree and folds it with the given monoid.
|
F<A,IterableW<B>> |
iterableK()
Promotes this function to return its value in an Iterable.
|
F<A,P1<B>> |
lazy()
Promotes this function so that it returns its result in a product-1.
|
F<A,List<B>> |
listK()
Promotes this function so that it returns its result in a List.
|
F<Array<A>,Array<B>> |
mapArray()
Promotes this function to map over a Array.
|
F<P2<A,A>,P2<B,B>> |
mapBoth()
Promotes this function to map over both elements of a pair.
|
<X> F<Validation<A,X>,Validation<B,X>> |
mapFail()
Promotes this function to map over the failure side of a Validation.
|
<C> F<P2<A,C>,P2<B,C>> |
mapFst()
Promotes this function to map over the first element of a pair.
|
F<java.lang.Iterable<A>,IterableW<B>> |
mapIterable()
Promotes this function to map over Iterables.
|
java.util.concurrent.ArrayBlockingQueue<B> |
mapJ(java.util.concurrent.ArrayBlockingQueue<A> as)
Maps this function over an ArrayBlockingQueue.
|
java.util.ArrayList<B> |
mapJ(java.util.ArrayList<A> as)
Maps this function over an ArrayList.
|
java.util.concurrent.ConcurrentLinkedQueue<B> |
mapJ(java.util.concurrent.ConcurrentLinkedQueue<A> as)
Maps this function over a ConcurrentLinkedQueue.
|
java.util.concurrent.CopyOnWriteArrayList<B> |
mapJ(java.util.concurrent.CopyOnWriteArrayList<A> as)
Maps this function over a CopyOnWriteArrayList.
|
java.util.concurrent.CopyOnWriteArraySet<B> |
mapJ(java.util.concurrent.CopyOnWriteArraySet<A> as)
Maps this function over a CopyOnWriteArraySet.
|
java.util.concurrent.LinkedBlockingQueue<B> |
mapJ(java.util.concurrent.LinkedBlockingQueue<A> as)
Maps this function over a LinkedBlockingQueue.
|
java.util.LinkedList<B> |
mapJ(java.util.LinkedList<A> as)
Maps this function over a LinkedList.
|
java.util.concurrent.PriorityBlockingQueue<B> |
mapJ(java.util.concurrent.PriorityBlockingQueue<A> as)
Maps this function over a PriorityBlockingQueue.
|
java.util.PriorityQueue<B> |
mapJ(java.util.PriorityQueue<A> as)
Maps this function over a PriorityQueue.
|
java.util.concurrent.SynchronousQueue<B> |
mapJ(java.util.concurrent.SynchronousQueue<A> as)
Maps this function over a SynchronousQueue.
|
java.util.TreeSet<B> |
mapJ(java.util.TreeSet<A> as)
Maps this function over a TreeSet.
|
<X> F<Either<A,X>,Either<B,X>> |
mapLeft()
Promotes this function to map over the left side of an Either.
|
F<List<A>,List<B>> |
mapList()
Promotes this function to map over a List.
|
F<NonEmptyList<A>,NonEmptyList<B>> |
mapNel()
Promotes this function to map over a NonEmptyList.
|
F<Option<A>,Option<B>> |
mapOption()
Promotes this function to map over an optional value.
|
F<P1<A>,P1<B>> |
mapP1()
Promotes this function to map over a product-1.
|
F<Promise<A>,Promise<B>> |
mapPromise()
Promotes this function to map over a Promise.
|
<X> F<Either<X,A>,Either<X,B>> |
mapRight()
Promotes this function to map over the right side of an Either.
|
F<Set<A>,Set<B>> |
mapSet(Ord<B> o)
Promotes this function to map over a Set.
|
<C> F<P2<C,A>,P2<C,B>> |
mapSnd()
Promotes this function to map over the second element of a pair.
|
F<Stream<A>,Stream<B>> |
mapStream()
Promotes this function to map over a Stream.
|
<X> F<Validation<X,A>,Validation<X,B>> |
mapSuccess()
Promotes this function to map over the success side of a Validation.
|
F<Tree<A>,Tree<B>> |
mapTree()
Promotes this function to map over a Tree.
|
F<TreeZipper<A>,TreeZipper<B>> |
mapTreeZipper()
Promotes this function to map over a TreeZipper.
|
F<Zipper<A>,Zipper<B>> |
mapZipper()
Promotes this function to map over a Zipper.
|
F<A,NonEmptyList<B>> |
nelK()
Promotes this function to return its value in a NonEmptyList.
|
<C> F<F<C,A>,F<C,B>> |
o()
First-class function composition
|
<C> F<C,B> |
o(F<C,A> g)
Function composition
|
<C> F<F<B,F<B,C>>,F<A,F<A,C>>> |
on()
Applies this function over the arguments of another function.
|
<C> F<A,F<A,C>> |
on(F<B,F<B,C>> g)
Applies this function over the arguments of another function.
|
F<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.
|
F<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.
|
F<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.
|
F<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.
|
F<A,Option<B>> |
optionK()
Promotes this function so that it returns its result in an Option.
|
F<A,Promise<B>> |
promiseK(Strategy<Unit> s)
Promotes this function to a concurrent function that returns a Promise of a value.
|
F<A,Set<B>> |
setK(Ord<B> o)
Promotes this function to return its value in a Set.
|
F<A,Stream<B>> |
streamK()
Promotes this function so that it returns its result in a Stream.
|
<C> F<A,Validation<C,B>> |
successK()
Promotes this function so that it returns its result on the success side of an Validation.
|
F<A,Tree<B>> |
treeK()
Promotes this function to return its value in a Tree.
|
F<A,TreeZipper<B>> |
treeZipperK()
Promotes this function to return its value in a TreeZipper.
|
F<A,Zipper<B>> |
zipperK()
Promotes this function to return its value in a Zipper.
|
public abstract B f(A a)
A
to B
.a
- The A
to transform.public final <C> F<C,B> o(F<C,A> g)
g
- A function to compose with this one.public final <C> F<F<C,A>,F<C,B>> o()
public final <C> F<A,C> andThen(F<B,C> g)
g
- A function with which to compose this one.public final <C> F<F<B,C>,F<A,C>> andThen()
public final <C> F<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 final <C> F<F<B,F<A,C>>,F<A,C>> bind()
public final <C> F<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 final <C> F<F<A,F<B,C>>,F<A,C>> apply()
public final <C> F<A,F<A,C>> on(F<B,F<B,C>> g)
g
- The function over whose arguments to apply this function.public final <C> F<F<B,F<B,C>>,F<A,F<A,C>>> on()
public final F<A,P1<B>> lazy()
public final F<P1<A>,P1<B>> mapP1()
public final F<A,Option<B>> optionK()
public final F<Option<A>,Option<B>> mapOption()
public final F<A,List<B>> listK()
public final F<List<A>,List<B>> mapList()
public final F<A,Stream<B>> streamK()
public final F<Stream<A>,Stream<B>> mapStream()
public final F<A,Array<B>> arrayK()
public final F<Array<A>,Array<B>> mapArray()
public final F<Actor<B>,Actor<A>> comapActor()
public final F<A,Promise<B>> promiseK(Strategy<Unit> s)
s
- A parallel strategy for concurrent execution.public final F<Promise<A>,Promise<B>> mapPromise()
public final <C> F<A,Either<B,C>> eitherLeftK()
public final <C> F<A,Either<C,B>> eitherRightK()
public final <X> F<Either<A,X>,Either<B,X>> mapLeft()
public final <X> F<Either<X,A>,Either<X,B>> mapRight()
public final F<Either<B,A>,B> onLeft()
public final F<Either<A,B>,B> onRight()
public final F<A,IterableW<B>> iterableK()
public final F<java.lang.Iterable<A>,IterableW<B>> mapIterable()
public final F<A,NonEmptyList<B>> nelK()
public final F<NonEmptyList<A>,NonEmptyList<B>> mapNel()
public final F<A,Set<B>> setK(Ord<B> o)
o
- An order for the set.public final F<Set<A>,Set<B>> mapSet(Ord<B> o)
o
- An order for the resulting set.public final F<A,Tree<B>> treeK()
public final F<Tree<A>,Tree<B>> mapTree()
public final F<Tree<A>,B> foldMapTree(Monoid<B> m)
m
- The monoid with which to fold the mapped tree.public final F<A,TreeZipper<B>> treeZipperK()
public final F<TreeZipper<A>,TreeZipper<B>> mapTreeZipper()
public final <C> F<A,Validation<B,C>> failK()
public final <C> F<A,Validation<C,B>> successK()
public final <X> F<Validation<A,X>,Validation<B,X>> mapFail()
public final <X> F<Validation<X,A>,Validation<X,B>> mapSuccess()
public final F<Validation<B,A>,B> onFail()
public final F<Validation<A,B>,B> onSuccess()
public final F<A,Zipper<B>> zipperK()
public final F<Zipper<A>,Zipper<B>> mapZipper()
public final F<Equal<B>,Equal<A>> comapEqual()
public final F<Hash<B>,Hash<A>> comapHash()
public final F<Show<B>,Show<A>> comapShow()
public final <C> F<P2<A,C>,P2<B,C>> mapFst()
public final <C> F<P2<C,A>,P2<C,B>> mapSnd()
public final F<P2<A,A>,P2<B,B>> mapBoth()
public final java.util.concurrent.SynchronousQueue<B> mapJ(java.util.concurrent.SynchronousQueue<A> as)
as
- A SynchronousQueue to map this function over.public final java.util.concurrent.PriorityBlockingQueue<B> mapJ(java.util.concurrent.PriorityBlockingQueue<A> as)
as
- A PriorityBlockingQueue to map this function over.public final java.util.concurrent.LinkedBlockingQueue<B> mapJ(java.util.concurrent.LinkedBlockingQueue<A> as)
as
- A LinkedBlockingQueue to map this function over.public final java.util.concurrent.CopyOnWriteArraySet<B> mapJ(java.util.concurrent.CopyOnWriteArraySet<A> as)
as
- A CopyOnWriteArraySet to map this function over.public final java.util.concurrent.CopyOnWriteArrayList<B> mapJ(java.util.concurrent.CopyOnWriteArrayList<A> as)
as
- A CopyOnWriteArrayList to map this function over.public final java.util.concurrent.ConcurrentLinkedQueue<B> mapJ(java.util.concurrent.ConcurrentLinkedQueue<A> as)
as
- A ConcurrentLinkedQueue to map this function over.public final java.util.concurrent.ArrayBlockingQueue<B> mapJ(java.util.concurrent.ArrayBlockingQueue<A> as)
as
- An ArrayBlockingQueue to map this function over.public final java.util.TreeSet<B> mapJ(java.util.TreeSet<A> as)
as
- A TreeSet to map this function over.public final java.util.PriorityQueue<B> mapJ(java.util.PriorityQueue<A> as)
as
- A PriorityQueue to map this function over.public final java.util.LinkedList<B> mapJ(java.util.LinkedList<A> as)
as
- A LinkedList to map this function over.