Class ToCollection<A,C extends Collection<A>>
java.lang.Object
com.jnape.palatable.lambda.functions.builtin.fn2.ToCollection<A,C>
- Type Parameters:
A
- the iterable element typeC
- the resulting collection type
- All Implemented Interfaces:
Fn1<Fn0<C>,
,Fn1<Iterable<A>, C>> Fn2<Fn0<C>,
,Iterable<A>, C> Applicative<Fn1<Iterable<A>,
,C>, Fn1<Fn0<C>, ?>> Cartesian<Fn0<C>,
,Fn1<Iterable<A>, C>, Fn1<?, ?>> Cocartesian<Fn0<C>,
,Fn1<Iterable<A>, C>, Fn1<?, ?>> Contravariant<Fn0<C>,
,Profunctor<?, Fn1<Iterable<A>, C>, Fn1<?, ?>>> Functor<Fn1<Iterable<A>,
,C>, Fn1<Fn0<C>, ?>> Profunctor<Fn0<C>,
,Fn1<Iterable<A>, C>, Fn1<?, ?>> Monad<Fn1<Iterable<A>,
,C>, Fn1<Fn0<C>, ?>> MonadReader<Fn0<C>,
,Fn1<Iterable<A>, C>, Fn1<Fn0<C>, ?>> MonadRec<Fn1<Iterable<A>,
,C>, Fn1<Fn0<C>, ?>> MonadWriter<Fn0<C>,
Fn1<Iterable<A>, C>, Fn1<Fn0<C>, ?>>
public final class ToCollection<A,C extends Collection<A>>
extends Object
implements Fn2<Fn0<C>,Iterable<A>,C>
Given an
Fn0
of some Collection
C
, create an instance of C
and add all of
the elements in the provided Iterable
to the instance. Note that instances of C
must
support Collection.add(E)
(which is to say, must not throw on invocation).-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncheckedApply
(Fn0<C> cFn0, Iterable<A> as) static <A,
C extends Collection<A>>
ToCollection<A, C> static <A,
C extends Collection<A>>
Fn1<Iterable<A>, C> toCollection
(Fn0<C> cFn0) static <A,
C extends Collection<A>>
CtoCollection
(Fn0<C> cFn0, 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 Details
-
INSTANCE
-
-
Constructor Details
-
ToCollection
private ToCollection()
-
-
Method Details
-
checkedApply
- Specified by:
checkedApply
in interfaceFn2<Fn0<C extends Collection<A>>,
Iterable<A>, C extends Collection<A>>
-
toCollection
-
toCollection
-
toCollection
-