Package com.jnape.palatable.lambda.functions.builtin.fn2
package com.jnape.palatable.lambda.functions.builtin.fn2
-
ClassesClassDescription$<A,
B> All<A>Eagerly apply a predicate to each element in anIterable
, returningtrue
if every element satisfies the predicate, andfalse
otherwise.Alter<A>Any<A>Eagerly apply a predicate to each element in anIterable
, returningtrue
if any element satisfies the predicate, andfalse
otherwise.Given anIO
yielding someAutoCloseable
typeA
and a kleisli arrow from that type to a newIO
of typeB
, attempt to provision theA
, applying the body operation if provisioning was successful and ensuring thatAutoCloseable.close()
is called regardless of whether the body succeeds or fails.Both<A,B, C> CartesianProduct<A,B> Lazily compute the cartesian product of anIterable<A>
andIterable<B>
, returning anIterable<Tuple2<A, B>>
, the products as tuples of multiplicandA
s and multiplierB
s.CmpEq<A extends Comparable<A>>Given twoComparable
values of typeA
, returntrue
if the first value is strictly equal to the second value (according toComparable.compareTo(Object)
; otherwise, return false.Cons<A>Prepend an element to anIterable
.Difference<A>Drop<A>Lazily skip the firstn
elements from anIterable
by returning anIterable
that begins iteration after thenth
element.DropWhile<A>Lazily limit theIterable
by skipping the first contiguous group of elements that satisfy the predicate, beginning iteration at the first element for which the predicate evaluates tofalse
.Eq<A>Type-safe equality in function form; usesObject.equals(java.lang.Object)
, not==
.Filter<A>Lazily apply a predicate to each element in anIterable
, returning anIterable
of just the elements for which the predicate evaluated totrue
.Find<A>Iterate the elements in anIterable
, applying a predicate to each one, returning the first element that matches the predicate, wrapped in aMaybe
.GroupBy<K,V> Given anIterable<V>
vs
and a key functionV -> K
f
, foldvs
into aMap<K, List<V>>
by applyingf
to each element ofvs
, retaining values that map to the same key in a list, in the order they were iterated in.GT<A extends Comparable<A>>Given twoComparable
values of typeA
, returntrue
if the second value is strictly greater than the first value; otherwise, return false.GTE<A extends Comparable<A>>Given twoComparable
values of typeA
, returntrue
if the second value is greater than or equal to the first value according toComparable.compareTo(Object)
; otherwise, return false.InGroupsOf<A>Lazily group theIterable
by returning anIterable
of smallerIterable
s of sizek
.Intersperse<A>Lazily inject the provided separator value between each value in the suppliedIterable
.Into<A,B, C> Into1<A,B> Given an
and aFn1
<A, B>
, pop the head and apply it to the function, returning the result.SingletonHList
<A>Into3<A,B, C, D> Into4<A,B, C, D, E> Into5<A,B, C, D, E, F> Into6<A,B, C, D, E, F, G> Into7<A,B, C, D, E, F, G, H> Into8<A,B, C, D, E, F, G, H, I> Iterate<A>LazyRec<A,B> LT<A extends Comparable<A>>Given twoComparable
values of typeA
, returntrue
if the second value is strictly less than the first value; otherwise, return false.LTE<A extends Comparable<A>>Given twoComparable
values of typeA
, returntrue
if the second value is less than or equal to the first value according toComparable.compareTo(Object)
otherwise, return false.MagnetizeBy<A>Map<A,B> Lazily apply a function to each element in anIterable
, producing anIterable
of the mapped results.Partition<A,B, C> Given anIterable<A>
as
and a disjoint mapping functiona -> CoProduct2<A, B>
, return aTuple2
over the lazily unwrapped leftA
and rightB
values in the first and second slots, respectively.Deprecated.Peek2<A,B, FAB extends BoundedBifunctor<A, B, ? super A, ? super B, ?>> Deprecated.in favor of producing anIO
from the givenBoundedBifunctor
and explicitly running itPrependAll<A>Lazily prepend each value with of theIterable
with the supplied separator value.ReduceLeft<A>ReduceRight<A>Replicate<A>Produce anIterable
of a valuen
times.Sequence<A,App extends Applicative<?, App>, Trav extends Traversable<?, Trav>, TravA extends Traversable<A, Trav>, AppTrav extends Applicative<TravA, App>> Given aTraversable
ofApplicative
s and a pureApplicative
constructor, traverse the elements from left to right, zipping theApplicative
s together and collecting the results.Slide<A>Snoc<A>SortBy<A,B extends Comparable<B>> Given anIterable
and some mapping function from theIterable
element type to someComparable
type, produce a sortedList
of the original elements based on sorting applied to the result of the mapping function.SortWith<A>Given anIterable
and aComparator
over theIterable
element type, produce a sortedList
of the original elements based on sorting applied by theComparator
.Span<A>Take<A>Lazily limit theIterable
ton
elements by returning anIterable
that stops iteration after thenth
element, or the last element of theIterable
, whichever comes first.TakeWhile<A>Lazily limit theIterable
to the first group of contiguous elements that satisfy the predicate by iterating up to, but not including, the first element for which the predicate evaluates tofalse
.ToArray<A>Write all the elements of anIterable
directly into an array of the specified type.ToCollection<A,C extends Collection<A>> Given anFn0
of someCollection
C
, create an instance ofC
and add all of the elements in the providedIterable
to the instance.Tupler2<A,B> Creates aTuple2
from two values.Unfoldr<A,B> Until<A>Given apredicate function
for a value of some typeA
and anIO
that yields a value of typeA
, produce anIO
that repeatedly executes the originalIO
until the predicate returns true when applied to the yielded value.Zip<A,B> Zip together twoIterable
s into a singleIterable
ofTuple2<A, B>
.
IO
from the givenFunctor
and explicitly running it