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

## Class ToArray<A>

- java.lang.Object
- - com.jnape.palatable.lambda.functions.builtin.fn2.ToArray<A>

- Type Parameters:
    `A` - the `Iterable` element type
  All Implemented Interfaces:
    Fn1<Class<A[]>,Fn1<Iterable<? extends A>,A[]>>, Fn2<Class<A[]>,Iterable<? extends A>,A[]>, Applicative<Fn1<Iterable<? extends A>,A[]>,Fn1<Class<A[]>,?>>, Cartesian<Class<A[]>,Fn1<Iterable<? extends A>,A[]>,Fn1<?,?>>, Cocartesian<Class<A[]>,Fn1<Iterable<? extends A>,A[]>,Fn1<?,?>>, Contravariant<Class<A[]>,Profunctor<?,Fn1<Iterable<? extends A>,A[]>,Fn1<?,?>>>, Functor<Fn1<Iterable<? extends A>,A[]>,Fn1<Class<A[]>,?>>, Profunctor<Class<A[]>,Fn1<Iterable<? extends A>,A[]>,Fn1<?,?>>, Monad<Fn1<Iterable<? extends A>,A[]>,Fn1<Class<A[]>,?>>, MonadReader<Class<A[]>,Fn1<Iterable<? extends A>,A[]>,Fn1<Class<A[]>,?>>, MonadRec<Fn1<Iterable<? extends A>,A[]>,Fn1<Class<A[]>,?>>, MonadWriter<Class<A[]>,Fn1<Iterable<? extends A>,A[]>,Fn1<Class<A[]>,?>>

      public final class ToArray<A>
      extends Object
      implements Fn2<Class<A[]>,Iterable<? extends A>,A[]>

  Write all the elements of an `Iterable` directly into an array of the specified type. If the `Iterable` is an instance of `Collection`, use `Collection.toArray(Object[])`.

- - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `A[]` | `checkedApply(Class<A[]> arrayType, Iterable<? extends A> as)`
    `static <A> ToArray<A>` | `toArray()`
    `static <A> Fn1<Iterable<? extends A>,A[]>` | `toArray(Class<A[]> arrayType)`
    `static <A> A[]` | `toArray(Class<A[]> arrayType, Iterable<? extends 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 A[] checkedApply(Class<A[]> arrayType,
                                  Iterable<? extends A> as)

      Specified by:
        `checkedApply` in interface `Fn2<Class<A[]>,Iterable<? extends A>,A[]>`

    - #### toArray

          public static <A> ToArray<A> toArray()

    - #### toArray

          public static <A> Fn1<Iterable<? extends A>,A[]> toArray(Class<A[]> arrayType)

    - #### toArray

          public static <A> A[] toArray(Class<A[]> arrayType,
                                        Iterable<? extends A> as)