Class Inits<A>
- java.lang.Object
-
- com.jnape.palatable.lambda.functions.builtin.fn1.Inits<A>
-
- Type Parameters:
A
- the Iterable element type
- All Implemented Interfaces:
Fn1<java.lang.Iterable<A>,java.lang.Iterable<java.lang.Iterable<A>>>
,Applicative<java.lang.Iterable<java.lang.Iterable<A>>,Fn1<java.lang.Iterable<A>,?>>
,Cartesian<java.lang.Iterable<A>,java.lang.Iterable<java.lang.Iterable<A>>,Fn1<?,?>>
,Cocartesian<java.lang.Iterable<A>,java.lang.Iterable<java.lang.Iterable<A>>,Fn1<?,?>>
,Contravariant<java.lang.Iterable<A>,Profunctor<?,java.lang.Iterable<java.lang.Iterable<A>>,Fn1<?,?>>>
,Functor<java.lang.Iterable<java.lang.Iterable<A>>,Fn1<java.lang.Iterable<A>,?>>
,Profunctor<java.lang.Iterable<A>,java.lang.Iterable<java.lang.Iterable<A>>,Fn1<?,?>>
,Monad<java.lang.Iterable<java.lang.Iterable<A>>,Fn1<java.lang.Iterable<A>,?>>
,MonadReader<java.lang.Iterable<A>,java.lang.Iterable<java.lang.Iterable<A>>,Fn1<java.lang.Iterable<A>,?>>
,MonadRec<java.lang.Iterable<java.lang.Iterable<A>>,Fn1<java.lang.Iterable<A>,?>>
,MonadWriter<java.lang.Iterable<A>,java.lang.Iterable<java.lang.Iterable<A>>,Fn1<java.lang.Iterable<A>,?>>
public final class Inits<A> extends java.lang.Object implements Fn1<java.lang.Iterable<A>,java.lang.Iterable<java.lang.Iterable<A>>>
Given an
, produce anIterable
<A>
, representing all of the subsequences of initial elements, ordered by size, starting with the emptyIterable
<Iterable
<A>>Iterable
.For example,
inits(asList(1,2,3))
would iterate[]
,[1]
,[1,2]
, and[1,2,3]
.
-
-
Constructor Summary
Constructors Modifier Constructor Description private
Inits()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Iterable<java.lang.Iterable<A>>
checkedApply(java.lang.Iterable<A> as)
Invoke this function with the given argument, potentially throwing anyThrowable
.static <A> Inits<A>
inits()
static <A> java.lang.Iterable<java.lang.Iterable<A>>
inits(java.lang.Iterable<A> as)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
Field Detail
-
INSTANCE
private static final Inits<?> INSTANCE
-
-
Method Detail
-
checkedApply
public java.lang.Iterable<java.lang.Iterable<A>> checkedApply(java.lang.Iterable<A> as)
Description copied from interface:Fn1
Invoke this function with the given argument, potentially throwing anyThrowable
.- Specified by:
checkedApply
in interfaceFn1<java.lang.Iterable<A>,java.lang.Iterable<java.lang.Iterable<A>>>
- Parameters:
as
- the argument- Returns:
- the result of the function application
-
inits
public static <A> Inits<A> inits()
-
inits
public static <A> java.lang.Iterable<java.lang.Iterable<A>> inits(java.lang.Iterable<A> as)
-
-