Class Sort<A extends java.lang.Comparable<A>>

  • Type Parameters:
    A - the input Iterable and output List element type
    All Implemented Interfaces:
    Fn1<java.lang.Iterable<A>,​java.util.List<A>>, Applicative<java.util.List<A>,​Fn1<java.lang.Iterable<A>,​?>>, Cartesian<java.lang.Iterable<A>,​java.util.List<A>,​Fn1<?,​?>>, Cocartesian<java.lang.Iterable<A>,​java.util.List<A>,​Fn1<?,​?>>, Contravariant<java.lang.Iterable<A>,​Profunctor<?,​java.util.List<A>,​Fn1<?,​?>>>, Functor<java.util.List<A>,​Fn1<java.lang.Iterable<A>,​?>>, Profunctor<java.lang.Iterable<A>,​java.util.List<A>,​Fn1<?,​?>>, Monad<java.util.List<A>,​Fn1<java.lang.Iterable<A>,​?>>, MonadReader<java.lang.Iterable<A>,​java.util.List<A>,​Fn1<java.lang.Iterable<A>,​?>>, MonadRec<java.util.List<A>,​Fn1<java.lang.Iterable<A>,​?>>, MonadWriter<java.lang.Iterable<A>,​java.util.List<A>,​Fn1<java.lang.Iterable<A>,​?>>

    public final class Sort<A extends java.lang.Comparable<A>>
    extends java.lang.Object
    implements Fn1<java.lang.Iterable<A>,​java.util.List<A>>
    Given an Iterable of Comparable elements, return a List of the sorted elements. Note that this is both eager and monolithic.
    See Also:
    SortBy, SortWith
    • Field Detail

      • INSTANCE

        private static final Sort<?> INSTANCE
    • Constructor Detail

      • Sort

        private Sort()
    • Method Detail

      • checkedApply

        public java.util.List<A> checkedApply​(java.lang.Iterable<A> as)
        Description copied from interface: Fn1
        Invoke this function with the given argument, potentially throwing any Throwable.
        Specified by:
        checkedApply in interface Fn1<java.lang.Iterable<A extends java.lang.Comparable<A>>,​java.util.List<A extends java.lang.Comparable<A>>>
        Parameters:
        as - the argument
        Returns:
        the result of the function application
      • sort

        public static <A extends java.lang.Comparable<A>> Sort<A> sort()
      • sort

        public static <A extends java.lang.Comparable<A>> java.util.List<A> sort​(java.lang.Iterable<A> as)