Package fj
Interface F<A,B>
- All Superinterfaces:
Function<A,
B>
- All Known Implementing Classes:
IOFunctions.CharChunkReader
,IOFunctions.CharChunkReader2
,IOFunctions.LineReader
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
A transformation or function from
A
to B
.-
Method Summary
Modifier and TypeMethodDescriptionandThen()
First-class composition flipped.Function composition flipped.apply()
First-class function application in an environment.default B
Function application in an environment (Applicative Functor).arrayK()
Promotes this function so that it returns its result in a Array.bind()
First-class function binding.Binds a given function across this function (Reader Monad).Returns a function that contramaps over a given actor.Promotes this function to map over an Equal as a contravariant functor.Promotes this function to map over a Hash as a contravariant functor.Promotes this function to map over a Show as a contravariant functor.default <C,
D> F <C, D> Both map (with g) and contramap (with f) the target function.Promotes this function so that it returns its result on the left side of an Either.Promotes this function so that it returns its result on the right side of an Either.TransformA
toB
.default <C> F
<A, Validation<B, C>> failK()
Promotes this function so that it returns its result on the failure side of a Validation.foldMapTree
(Monoid<B> m) Returns a function that maps this function over a tree and folds it with the given monoid.Promotes this function to return its value in an Iterable.lazy()
Promotes this function so that it returns its result in a product-1.listK()
Promotes this function so that it returns its result in a List.mapArray()
Promotes this function to map over a Array.mapBoth()
Promotes this function to map over both elements of a pair.default <X> F
<Validation<A, X>, Validation<B, X>> 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.Promotes this function to map over Iterables.Maps this function over an ArrayList.default ArrayBlockingQueue
<B> mapJ
(ArrayBlockingQueue<A> as) Maps this function over an ArrayBlockingQueue.default ConcurrentLinkedQueue
<B> mapJ
(ConcurrentLinkedQueue<A> as) Maps this function over a ConcurrentLinkedQueue.default CopyOnWriteArrayList
<B> mapJ
(CopyOnWriteArrayList<A> as) Maps this function over a CopyOnWriteArrayList.default CopyOnWriteArraySet
<B> mapJ
(CopyOnWriteArraySet<A> as) Maps this function over a CopyOnWriteArraySet.default LinkedBlockingQueue
<B> mapJ
(LinkedBlockingQueue<A> as) Maps this function over a LinkedBlockingQueue.default PriorityBlockingQueue
<B> mapJ
(PriorityBlockingQueue<A> as) Maps this function over a PriorityBlockingQueue.default SynchronousQueue
<B> mapJ
(SynchronousQueue<A> as) Maps this function over a SynchronousQueue.default LinkedList
<B> mapJ
(LinkedList<A> as) Maps this function over a LinkedList.default PriorityQueue
<B> mapJ
(PriorityQueue<A> as) Maps this function over a PriorityQueue.Maps this function over a TreeSet.mapLeft()
Promotes this function to map over the left side of an Either.mapList()
Promotes this function to map over a List.default F
<NonEmptyList<A>, NonEmptyList<B>> mapNel()
Promotes this function to map over a NonEmptyList.Promotes this function to map over an optional value.mapP1()
Promotes this function to map over a product-1.Promotes this function to map over a Promise.mapRight()
Promotes this function to map over the right side of an Either.Promotes this function to map over a Set.mapSnd()
Promotes this function to map over the second element of a pair.Promotes this function to map over a Stream.default <X> F
<Validation<X, A>, Validation<X, B>> Promotes this function to map over the success side of a Validation.mapTree()
Promotes this function to map over a Tree.default F
<TreeZipper<A>, TreeZipper<B>> Promotes this function to map over a TreeZipper.Promotes this function to map over a Zipper.default F
<A, NonEmptyList<B>> nelK()
Promotes this function to return its value in a NonEmptyList.o()
First-class function compositionFunction compositionon()
Applies this function over the arguments of another function.Applies this function over the arguments of another function.default 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.onLeft()
Returns a function that returns the left side of a given Either, or this function applied to the right side.onRight()
Returns a function that returns the right side of a given Either, or this function applied to the left side.default F
<Validation<A, B>, B> Returns a function that returns the success side of a given Validation, or this function applied to the failure side.optionK()
Promotes this function so that it returns its result in an Option.Partial application.Promotes this function to a concurrent function that returns a Promise of a value.Promotes this function to return its value in a Set.streamK()
Promotes this function so that it returns its result in a Stream.default <C> F
<A, Validation<C, B>> successK()
Promotes this function so that it returns its result on the success side of an Validation.treeK()
Promotes this function to return its value in a Tree.default F
<A, TreeZipper<B>> Promotes this function to return its value in a TreeZipper.zipperK()
Promotes this function to return its value in a Zipper.
-
Method Details
-
f
TransformA
toB
.- Parameters:
a
- TheA
to transform.- Returns:
- The result of the transformation.
-
apply
-
o
Function composition- Parameters:
g
- A function to compose with this one.- Returns:
- The composed function such that this function is applied last.
-
o
First-class function composition- Returns:
- A function that composes this function with another.
-
andThen
Function composition flipped.- Parameters:
g
- A function with which to compose this one.- Returns:
- The composed function such that this function is applied first.
-
andThen
First-class composition flipped.- Returns:
- A function that invokes this function and then a given function on the result.
-
bind
Binds a given function across this function (Reader Monad).- Parameters:
g
- A function that takes the return value of this function as an argument, yielding a new function.- Returns:
- A function that invokes this function on its argument and then the given function on the result.
-
bind
First-class function binding.- Returns:
- A function that binds another function across this function.
-
apply
Function application in an environment (Applicative Functor).- Parameters:
g
- A function with the same argument type as this function, yielding a function that takes the return value of this function.- Returns:
- A new function that invokes the given function on its argument, yielding a new function that is then applied to the result of applying this function to the argument.
-
apply
First-class function application in an environment.- Returns:
- A function that applies a given function within the environment of this function.
-
on
Applies this function over the arguments of another function.- Parameters:
g
- The function over whose arguments to apply this function.- Returns:
- A new function that invokes this function on its arguments before invoking the given function.
-
on
Applies this function over the arguments of another function.- Returns:
- A function that applies this function over the arguments of another function.
-
lazy
Promotes this function so that it returns its result in a product-1. Kleisli arrow for P1.- Returns:
- This function promoted to return its result in a product-1.
-
partial
Partial application.- Parameters:
a
- TheA
to which to apply this function.- Returns:
- The function partially applied to the given argument to return a lazy value.
-
mapP1
Promotes this function to map over a product-1.- Returns:
- This function promoted to map over a product-1.
-
optionK
Promotes this function so that it returns its result in an Option. Kleisli arrow for Option.- Returns:
- This function promoted to return its result in an Option.
-
mapOption
Promotes this function to map over an optional value.- Returns:
- This function promoted to map over an optional value.
-
listK
Promotes this function so that it returns its result in a List. Kleisli arrow for List.- Returns:
- This function promoted to return its result in a List.
-
mapList
Promotes this function to map over a List.- Returns:
- This function promoted to map over a List.
-
streamK
Promotes this function so that it returns its result in a Stream. Kleisli arrow for Stream.- Returns:
- This function promoted to return its result in a Stream.
-
mapStream
Promotes this function to map over a Stream.- Returns:
- This function promoted to map over a Stream.
-
arrayK
Promotes this function so that it returns its result in a Array. Kleisli arrow for Array.- Returns:
- This function promoted to return its result in a Array.
-
mapArray
Promotes this function to map over a Array.- Returns:
- This function promoted to map over a Array.
-
contramapActor
Returns a function that contramaps over a given actor.- Returns:
- A function that contramaps over a given actor.
-
promiseK
Promotes this function to a concurrent function that returns a Promise of a value.- Parameters:
s
- A parallel strategy for concurrent execution.- Returns:
- A concurrent function that returns a Promise of a value.
-
mapPromise
Promotes this function to map over a Promise.- Returns:
- This function promoted to map over Promises.
-
eitherLeftK
Promotes this function so that it returns its result on the left side of an Either. Kleisli arrow for the Either left projection.- Returns:
- This function promoted to return its result on the left side of an Either.
-
eitherRightK
Promotes this function so that it returns its result on the right side of an Either. Kleisli arrow for the Either right projection.- Returns:
- This function promoted to return its result on the right side of an Either.
-
mapLeft
Promotes this function to map over the left side of an Either.- Returns:
- This function promoted to map over the left side of an Either.
-
mapRight
Promotes this function to map over the right side of an Either.- Returns:
- This function promoted to map over the right side of an Either.
-
onLeft
Returns a function that returns the left side of a given Either, or this function applied to the right side.- Returns:
- a function that returns the left side of a given Either, or this function applied to the right side.
-
onRight
Returns a function that returns the right side of a given Either, or this function applied to the left side.- Returns:
- a function that returns the right side of a given Either, or this function applied to the left side.
-
iterableK
Promotes this function to return its value in an Iterable.- Returns:
- This function promoted to return its value in an Iterable.
-
mapIterable
Promotes this function to map over Iterables.- Returns:
- This function promoted to map over Iterables.
-
nelK
Promotes this function to return its value in a NonEmptyList.- Returns:
- This function promoted to return its value in a NonEmptyList.
-
mapNel
Promotes this function to map over a NonEmptyList.- Returns:
- This function promoted to map over a NonEmptyList.
-
setK
Promotes this function to return its value in a Set.- Parameters:
o
- An order for the set.- Returns:
- This function promoted to return its value in a Set.
-
mapSet
Promotes this function to map over a Set.- Parameters:
o
- An order for the resulting set.- Returns:
- This function promoted to map over a Set.
-
treeK
Promotes this function to return its value in a Tree.- Returns:
- This function promoted to return its value in a Tree.
-
mapTree
Promotes this function to map over a Tree.- Returns:
- This function promoted to map over a Tree.
-
foldMapTree
Returns a function that maps this function over a tree and folds it with the given monoid.- Parameters:
m
- The monoid with which to fold the mapped tree.- Returns:
- a function that maps this function over a tree and folds it with the given monoid.
-
treeZipperK
Promotes this function to return its value in a TreeZipper.- Returns:
- This function promoted to return its value in a TreeZipper.
-
mapTreeZipper
Promotes this function to map over a TreeZipper.- Returns:
- This function promoted to map over a TreeZipper.
-
failK
Promotes this function so that it returns its result on the failure side of a Validation. Kleisli arrow for the Validation failure projection.- Returns:
- This function promoted to return its result on the failure side of a Validation.
-
successK
Promotes this function so that it returns its result on the success side of an Validation. Kleisli arrow for the Validation success projection.- Returns:
- This function promoted to return its result on the success side of an Validation.
-
mapFail
Promotes this function to map over the failure side of a Validation.- Returns:
- This function promoted to map over the failure side of a Validation.
-
mapSuccess
Promotes this function to map over the success side of a Validation.- Returns:
- This function promoted to map over the success side of a Validation.
-
onFail
Returns a function that returns the failure side of a given Validation, or this function applied to the success side.- Returns:
- a function that returns the failure side of a given Validation, or this function applied to the success side.
-
onSuccess
Returns a function that returns the success side of a given Validation, or this function applied to the failure side.- Returns:
- a function that returns the success side of a given Validation, or this function applied to the failure side.
-
zipperK
Promotes this function to return its value in a Zipper.- Returns:
- This function promoted to return its value in a Zipper.
-
mapZipper
Promotes this function to map over a Zipper.- Returns:
- This function promoted to map over a Zipper.
-
contramapEqual
Promotes this function to map over an Equal as a contravariant functor.- Returns:
- This function promoted to map over an Equal as a contravariant functor.
-
contramapHash
Promotes this function to map over a Hash as a contravariant functor.- Returns:
- This function promoted to map over a Hash as a contravariant functor.
-
contramapShow
Promotes this function to map over a Show as a contravariant functor.- Returns:
- This function promoted to map over a Show as a contravariant functor.
-
mapFst
Promotes this function to map over the first element of a pair.- Returns:
- This function promoted to map over the first element of a pair.
-
mapSnd
Promotes this function to map over the second element of a pair.- Returns:
- This function promoted to map over the second element of a pair.
-
mapBoth
Promotes this function to map over both elements of a pair.- Returns:
- This function promoted to map over both elements of a pair.
-
mapJ
Maps this function over a SynchronousQueue.- Parameters:
as
- A SynchronousQueue to map this function over.- Returns:
- A new SynchronousQueue with this function applied to each element.
-
mapJ
Maps this function over a PriorityBlockingQueue.- Parameters:
as
- A PriorityBlockingQueue to map this function over.- Returns:
- A new PriorityBlockingQueue with this function applied to each element.
-
mapJ
Maps this function over a LinkedBlockingQueue.- Parameters:
as
- A LinkedBlockingQueue to map this function over.- Returns:
- A new LinkedBlockingQueue with this function applied to each element.
-
mapJ
Maps this function over a CopyOnWriteArraySet.- Parameters:
as
- A CopyOnWriteArraySet to map this function over.- Returns:
- A new CopyOnWriteArraySet with this function applied to each element.
-
mapJ
Maps this function over a CopyOnWriteArrayList.- Parameters:
as
- A CopyOnWriteArrayList to map this function over.- Returns:
- A new CopyOnWriteArrayList with this function applied to each element.
-
mapJ
Maps this function over a ConcurrentLinkedQueue.- Parameters:
as
- A ConcurrentLinkedQueue to map this function over.- Returns:
- A new ConcurrentLinkedQueue with this function applied to each element.
-
mapJ
Maps this function over an ArrayBlockingQueue.- Parameters:
as
- An ArrayBlockingQueue to map this function over.- Returns:
- A new ArrayBlockingQueue with this function applied to each element.
-
mapJ
Maps this function over a TreeSet.- Parameters:
as
- A TreeSet to map this function over.- Returns:
- A new TreeSet with this function applied to each element.
-
mapJ
Maps this function over a PriorityQueue.- Parameters:
as
- A PriorityQueue to map this function over.- Returns:
- A new PriorityQueue with this function applied to each element.
-
mapJ
Maps this function over a LinkedList.- Parameters:
as
- A LinkedList to map this function over.- Returns:
- A new LinkedList with this function applied to each element.
-
mapJ
Maps this function over an ArrayList.- Parameters:
as
- An ArrayList to map this function over.- Returns:
- A new ArrayList with this function applied to each element.
-
map
-
contramap
-
dimap
Both map (with g) and contramap (with f) the target function. (Profunctor pattern)
-