com.jnape.palatable.lambda.functions.builtin.fn2

## 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 type
    `C` - 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).

- - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `C` | `checkedApply(Fn0<C> cFn0, Iterable<A> as)`
    `static <A,C extends Collection<A>> ToCollection<A,C>` | `toCollection()`
    `static <A,C extends Collection<A>> Fn1<Iterable<A>,C>` | `toCollection(Fn0<C> cFn0)`
    `static <A,C extends Collection<A>> C` | `toCollection(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.Fn2

      `apply, apply, checkedApply, compose, contraMap, curried, curry, diMapL, discardR, flip, fn2, fromBiFunction, toBiFunction, uncurry, widen`

    - ### Methods inherited from interface com.jnape.palatable.lambda.functions.Fn1

      `andThen, carry, cartesian, censor, choose, cocartesian, diMap, diMapR, discardL, flatMap, fmap, fn1, fromFunction, lazyZip, listens, local, pure, pureFn1, thunk, toFunction, trampolineM, zip, zip`

    - ### Methods inherited from interface com.jnape.palatable.lambda.monad.Monad

      `join`

    - ### Methods inherited from interface com.jnape.palatable.lambda.functor.Functor

      `coerce`

- - ### Method Detail

    - #### checkedApply

          public C checkedApply(Fn0<C> cFn0,
                                Iterable<A> as)

      Specified by:
        `checkedApply` in interface `Fn2<Fn0<C extends Collection<A>>,Iterable<A>,C extends Collection<A>>`

    - #### toCollection

          public static <A,C extends Collection<A>> ToCollection<A,C> toCollection()

    - #### toCollection

          public static <A,C extends Collection<A>> Fn1<Iterable<A>,C> toCollection(Fn0<C> cFn0)

    - #### toCollection

          public static <A,C extends Collection<A>> C toCollection(Fn0<C> cFn0,
                                                                   Iterable<A> as)