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