Class Span<A>
- java.lang.Object
-
- com.jnape.palatable.lambda.functions.builtin.fn2.Span<A>
-
- Type Parameters:
A
- theIterable
element type
- All Implemented Interfaces:
Fn1<Fn1<? super A,? extends java.lang.Boolean>,Fn1<java.lang.Iterable<A>,Tuple2<java.lang.Iterable<A>,java.lang.Iterable<A>>>>
,Fn2<Fn1<? super A,? extends java.lang.Boolean>,java.lang.Iterable<A>,Tuple2<java.lang.Iterable<A>,java.lang.Iterable<A>>>
,Applicative<Fn1<java.lang.Iterable<A>,Tuple2<java.lang.Iterable<A>,java.lang.Iterable<A>>>,Fn1<Fn1<? super A,? extends java.lang.Boolean>,?>>
,Cartesian<Fn1<? super A,? extends java.lang.Boolean>,Fn1<java.lang.Iterable<A>,Tuple2<java.lang.Iterable<A>,java.lang.Iterable<A>>>,Fn1<?,?>>
,Cocartesian<Fn1<? super A,? extends java.lang.Boolean>,Fn1<java.lang.Iterable<A>,Tuple2<java.lang.Iterable<A>,java.lang.Iterable<A>>>,Fn1<?,?>>
,Contravariant<Fn1<? super A,? extends java.lang.Boolean>,Profunctor<?,Fn1<java.lang.Iterable<A>,Tuple2<java.lang.Iterable<A>,java.lang.Iterable<A>>>,Fn1<?,?>>>
,Functor<Fn1<java.lang.Iterable<A>,Tuple2<java.lang.Iterable<A>,java.lang.Iterable<A>>>,Fn1<Fn1<? super A,? extends java.lang.Boolean>,?>>
,Profunctor<Fn1<? super A,? extends java.lang.Boolean>,Fn1<java.lang.Iterable<A>,Tuple2<java.lang.Iterable<A>,java.lang.Iterable<A>>>,Fn1<?,?>>
,Monad<Fn1<java.lang.Iterable<A>,Tuple2<java.lang.Iterable<A>,java.lang.Iterable<A>>>,Fn1<Fn1<? super A,? extends java.lang.Boolean>,?>>
,MonadReader<Fn1<? super A,? extends java.lang.Boolean>,Fn1<java.lang.Iterable<A>,Tuple2<java.lang.Iterable<A>,java.lang.Iterable<A>>>,Fn1<Fn1<? super A,? extends java.lang.Boolean>,?>>
,MonadRec<Fn1<java.lang.Iterable<A>,Tuple2<java.lang.Iterable<A>,java.lang.Iterable<A>>>,Fn1<Fn1<? super A,? extends java.lang.Boolean>,?>>
,MonadWriter<Fn1<? super A,? extends java.lang.Boolean>,Fn1<java.lang.Iterable<A>,Tuple2<java.lang.Iterable<A>,java.lang.Iterable<A>>>,Fn1<Fn1<? super A,? extends java.lang.Boolean>,?>>
public final class Span<A> extends java.lang.Object implements Fn2<Fn1<? super A,? extends java.lang.Boolean>,java.lang.Iterable<A>,Tuple2<java.lang.Iterable<A>,java.lang.Iterable<A>>>
Given a predicate, return aTuple2
where the first slot is the front contiguous elements of anIterable
matching the predicate and the second slot is all the remaining elements.
-
-
Constructor Summary
Constructors Modifier Constructor Description private
Span()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Tuple2<java.lang.Iterable<A>,java.lang.Iterable<A>>
checkedApply(Fn1<? super A,? extends java.lang.Boolean> predicate, java.lang.Iterable<A> as)
static <A> Span<A>
span()
static <A> Fn1<java.lang.Iterable<A>,Tuple2<java.lang.Iterable<A>,java.lang.Iterable<A>>>
span(Fn1<? super A,? extends java.lang.Boolean> predicate)
static <A> Tuple2<java.lang.Iterable<A>,java.lang.Iterable<A>>
span(Fn1<? super A,? extends java.lang.Boolean> predicate, java.lang.Iterable<A> as)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.jnape.palatable.lambda.functions.Fn1
andThen, carry, cartesian, censor, choose, cocartesian, diMap, diMapR, discardL, flatMap, fmap, lazyZip, listens, local, pure, self, thunk, toFunction, trampolineM, zip, zip
-
-
-
-
Field Detail
-
INSTANCE
private static final Span<?> INSTANCE
-
-
Method Detail
-
checkedApply
public Tuple2<java.lang.Iterable<A>,java.lang.Iterable<A>> checkedApply(Fn1<? super A,? extends java.lang.Boolean> predicate, java.lang.Iterable<A> as)
-
span
public static <A> Span<A> span()
-
span
public static <A> Fn1<java.lang.Iterable<A>,Tuple2<java.lang.Iterable<A>,java.lang.Iterable<A>>> span(Fn1<? super A,? extends java.lang.Boolean> predicate)
-
-