Package com.jnape.palatable.lambda.functions.builtin.fn3
package com.jnape.palatable.lambda.functions.builtin.fn3
-
ClassesClassDescriptionBetween<A extends Comparable<A>>Given two bounds and a value, return whether or not the value is greater than or equal to the lower bound and less than or equal to the upper bound.Bracket<A,
B> Given anIO
that yields some typeA
, a cleanup operation to run if a value of that type could be provisioned, and a kleisli arrow from that type to a newIO
of typeB
, produce an
that, when run, will provision theIO
<B>A
,flatMap
it toB
, and clean up the original value if it was produced in the first place.Clamp<A extends Comparable<A>>Given two bounds and a value, "clamp" the value between the bounds via the following algorithm: - if the value is strictly less than the lower bound, return the lower bound - if the value is strictly greater than the upper bound, return the upper bound - otherwise, return the valueCmpEqBy<A,B extends Comparable<B>> Given a mapping function from some typeA
to someComparable
typeB
and two values of typeA
, returntrue
if the first value is strictly equal to the second value (according toComparable.compareTo(Object)
in terms of their mappedB
results; otherwise, return false.CmpEqWith<A>Given aComparator
from some typeA
and two values of typeA
, returntrue
if the first value is strictly equal to the second value (according toComparator.compare(Object, Object)
otherwise, return false.Compare<A>Given aComparator
from some typeA
and two values of typeA
, return aComparisonRelation
of the first value with reference to the second value (according toComparator.compare(Object, Object)
.FoldLeft<A,B> Given anIterable
ofA
s, a starting valueB
, and a
, iteratively accumulate over theFn2
<B, A, B>Iterable
, ultimately returning a finalB
value.FoldRight<A,B> GTBy<A,B extends Comparable<B>> Given a mapping function from some typeA
to someComparable
typeB
and two values of typeA
, returntrue
if the second value is strictly greater than the first value in terms of their mappedB
results; otherwise, return false.GTEBy<A,B extends Comparable<B>> Given a mapping function from some typeA
to someComparable
typeB
and two values of typeA
, returntrue
if the second value is greater than or equal to the first value in terms of their mappedB
results according toComparable.compareTo(Object)
; otherwise, return false.GTEWith<A>Given aComparator
from some typeA
and two values of typeA
, returntrue
if the second value is greater than or equal to the first value in terms of their mappedB
results according toComparator.compare(Object, Object)
; otherwise, return false.GTWith<A>Given aComparator
from some typeA
and two values of typeA
, returntrue
if the second value is strictly greater than the first value in terms of their mappedB
results; otherwise, return false.LiftA2<A,B, C, App extends Applicative<?, App>, AppC extends Applicative<C, App>> Lift into and apply anFn2
to twoApplicative
values, returning the result inside the sameApplicative
context.LTBy<A,B extends Comparable<B>> Given a mapping function from some typeA
to someComparable
typeB
and two values of typeA
, returntrue
if the second value is strictly less than the first value in terms of their mappedB
results; otherwise, return false.LTEBy<A,B extends Comparable<B>> Given a mapping function from some typeA
to someComparable
typeB
and two values of typeA
, returntrue
if the second value is less than or equal to the first value in terms of their mappedB
results according toComparable.compareTo(Object)
; otherwise, return false.LTEWith<A>Given aComparator
from some typeA
and two values of typeA
, returntrue
if the second value is less than or equal to the first value in terms of their mappedB
results according toComparator.compare(Object, Object)
; otherwise, return false.LTWith<A>Given a comparator for some typeA
and two values of typeA
, returntrue
if the second value is strictly less than than the first value in terms of their mappedB
results; otherwise, return false.ScanLeft<A,B> Given anIterable
ofA
s, a starting valueB
, and a
, iteratively accumulate over theFn2
<B, A, B>Iterable
, collecting each function application result, finally returning anIterable
of all the results.Times<A>Given some number of timesn
to invoke a functionA -> A
, and given an inputA
, iteratively apply the function to the input, and then to the result of the invocation, a total ofn
times, returning the result.ZipWith<A,B, C> Zip together twoIterable
s by applying a zipping function to the successive elements of eachIterable
until one of them runs out of elements.