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

## Class SortWith<A>

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

- Type Parameters:
    `A` - the input Iterable and output List element type
  All Implemented Interfaces:
    Fn1<Comparator<? super A>,Fn1<Iterable<A>,List<A>>>, Fn2<Comparator<? super A>,Iterable<A>,List<A>>, Applicative<Fn1<Iterable<A>,List<A>>,Fn1<Comparator<? super A>,?>>, Cartesian<Comparator<? super A>,Fn1<Iterable<A>,List<A>>,Fn1<?,?>>, Cocartesian<Comparator<? super A>,Fn1<Iterable<A>,List<A>>,Fn1<?,?>>, Contravariant<Comparator<? super A>,Profunctor<?,Fn1<Iterable<A>,List<A>>,Fn1<?,?>>>, Functor<Fn1<Iterable<A>,List<A>>,Fn1<Comparator<? super A>,?>>, Profunctor<Comparator<? super A>,Fn1<Iterable<A>,List<A>>,Fn1<?,?>>, Monad<Fn1<Iterable<A>,List<A>>,Fn1<Comparator<? super A>,?>>, MonadReader<Comparator<? super A>,Fn1<Iterable<A>,List<A>>,Fn1<Comparator<? super A>,?>>, MonadRec<Fn1<Iterable<A>,List<A>>,Fn1<Comparator<? super A>,?>>, MonadWriter<Comparator<? super A>,Fn1<Iterable<A>,List<A>>,Fn1<Comparator<? super A>,?>>

      public final class SortWith<A>
      extends Object
      implements Fn2<Comparator<? super A>,Iterable<A>,List<A>>

  Given an `Iterable` and a `Comparator` over the `Iterable` element type, produce a sorted `List` of the original elements based on sorting applied by the `Comparator`. Note that this is both eager and monolithic.
  See Also:
    `Sort`, `SortBy`

- - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `List<A>` | `checkedApply(Comparator<? super A> comparator, Iterable<A> as)`
    `static <A> SortWith<A>` | `sortWith()`
    `static <A> Fn1<Iterable<A>,List<A>>` | `sortWith(Comparator<? super A> comparator)`
    `static <A> List<A>` | `sortWith(Comparator<? super A> comparator, 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 List<A> checkedApply(Comparator<? super A> comparator,
                                      Iterable<A> as)

      Specified by:
        `checkedApply` in interface `Fn2<Comparator<? super A>,Iterable<A>,List<A>>`

    - #### sortWith

          public static <A> SortWith<A> sortWith()

    - #### sortWith

          public static <A> Fn1<Iterable<A>,List<A>> sortWith(Comparator<? super A> comparator)

    - #### sortWith

          public static <A> List<A> sortWith(Comparator<? super A> comparator,
                                             Iterable<A> as)