| Modifier and Type | Method and Description |
|---|---|
abstract <B> Monadics.ListMonadic<B> |
bind(Function<? super A,? extends Iterable<B>> f)
Monadic bind
m a -> (a -> m b) -> m b. |
abstract <M extends Iterable<A>> |
concat(M m)
Append
a to the list. |
abstract <X extends A> |
cons(X a)
Construct a new list by prepending
a. |
abstract Monadics.ListMonadic<A> |
drop(int n)
Drop the first
n elements of the list. |
abstract Monadics.ListMonadic<A> |
each(Function<? super A,Void> e)
Apply side effect
e to each element. |
abstract Monadics.ListMonadic<A> |
eachIndex(Function2<? super A,? super Integer,Void> e)
Apply side effect
e to each element. |
abstract boolean |
exists(Function<? super A,Boolean> p)
Check if at least one element satisfies predicate
p. |
abstract Monadics.ListMonadic<A> |
filter(Function<? super A,Boolean> p)
Retain all elements satisfying predicate
p. |
abstract Option<A> |
find(Function<? super A,Boolean> p)
Return the first element satisfying predicate
p. |
<B> Monadics.ListMonadic<B> |
flatMap(Function<? super A,? extends Iterable<B>> f)
Alias for
bind(Function). |
abstract <B> Monadics.ListMonadic<B> |
fmap(Function<? super A,? extends B> f)
Apply
f to each elements building a new list. |
abstract <B> B |
foldl(B zero,
Function2<? super B,? super A,? extends B> f)
Fold the list from left to right applying binary operator
f starting with zero. |
abstract A |
head()
Return the head of the list.
|
abstract Option<A> |
headOpt()
Return the head of the list.
|
abstract <B> Monadics.ListMonadic<B> |
inspect(Function<? super List<A>,? extends List<B>> f)
Process the wrapped list en bloc.
|
abstract A |
last()
Return the last element of the list.
|
abstract Option<A> |
lastOpt()
Return the last element of the list.
|
<B> Monadics.ListMonadic<B> |
map(Function<? super A,? extends B> f)
Alias for
fmap. |
<B> B |
match(List<Monadics.Matcher<A,B>> ms)
Pattern matching on the wrapped list.
|
<B> B |
match(Monadics.Matcher<A,B>... ms)
Pattern matching on the wrapped list.
|
abstract String |
mkString(String sep) |
abstract Option<A> |
option()
Turn the list into an option only if it contains exactly one element.
|
abstract A |
reducel(Function2<? super A,? super A,? extends A> f)
Reduce the list from left to right applying binary operator
f. |
abstract Monadics.ListMonadic<A> |
reverse() |
abstract Monadics.ListMonadic<A> |
sort(Comparator<A> c) |
abstract Monadics.ListMonadic<A> |
tail()
Return the tail of the list.
|
abstract Monadics.ListMonadic<A> |
take(int n)
Limit the list to the first
n elements. |
abstract List<A> |
value()
Return the wrapped, unmodifiable list.
|
abstract <B> Monadics.ListMonadic<Tuple<A,B>> |
zip(B[] bs) |
abstract <B> Monadics.ListMonadic<Tuple<A,B>> |
zip(Iterator<B> bs) |
abstract <B,M extends Iterable<B>> |
zip(M bs) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, iterator, spliteratorpublic final <B> Monadics.ListMonadic<B> map(Function<? super A,? extends B> f)
fmap.public abstract <B> Monadics.ListMonadic<B> fmap(Function<? super A,? extends B> f)
f to each elements building a new list. This is the list functor.map(Function)public final <B> Monadics.ListMonadic<B> flatMap(Function<? super A,? extends Iterable<B>> f)
bind(Function).public abstract <B> Monadics.ListMonadic<B> bind(Function<? super A,? extends Iterable<B>> f)
m a -> (a -> m b) -> m b. Apply f to each elements concatenating
the results into a new list.public abstract <B> B foldl(B zero,
Function2<? super B,? super A,? extends B> f)
f starting with zero.public abstract A reducel(Function2<? super A,? super A,? extends A> f)
f. The list must not be empty.public abstract <M extends Iterable<A>> Monadics.ListMonadic<A> concat(M m)
a to the list.public abstract <X extends A> Monadics.ListMonadic<A> cons(X a)
a.public abstract Monadics.ListMonadic<A> filter(Function<? super A,Boolean> p)
p.public abstract Option<A> find(Function<? super A,Boolean> p)
p.public abstract boolean exists(Function<? super A,Boolean> p)
p.public abstract Monadics.ListMonadic<A> each(Function<? super A,Void> e)
e to each element.public abstract Monadics.ListMonadic<A> eachIndex(Function2<? super A,? super Integer,Void> e)
e to each element. Indexed version.public abstract <B,M extends Iterable<B>> Monadics.ListMonadic<Tuple<A,B>> zip(M bs)
public abstract <B> Monadics.ListMonadic<Tuple<A,B>> zip(B[] bs)
public abstract <B> Monadics.ListMonadic<Tuple<A,B>> zip(Iterator<B> bs)
public abstract Monadics.ListMonadic<A> sort(Comparator<A> c)
public abstract Monadics.ListMonadic<A> reverse()
public abstract A head()
public abstract A last()
public abstract Option<A> option()
public abstract Monadics.ListMonadic<A> tail()
public abstract Monadics.ListMonadic<A> take(int n)
n elements.public abstract Monadics.ListMonadic<A> drop(int n)
n elements of the list.public abstract <B> Monadics.ListMonadic<B> inspect(Function<? super List<A>,? extends List<B>> f)
public final <B> B match(Monadics.Matcher<A,B>... ms)
public final <B> B match(List<Monadics.Matcher<A,B>> ms)
Copyright © 2009–2021 Opencast Project. All rights reserved.