Class Reverse<A>

java.lang.Object
com.jnape.palatable.lambda.functions.builtin.fn1.Reverse<A>
Type Parameters:
A - The Iterable element type
All Implemented Interfaces:
Fn1<Iterable<A>, Iterable<A>>, Applicative<Iterable<A>, Fn1<Iterable<A>, ?>>, Cartesian<Iterable<A>, Iterable<A>, Fn1<?,?>>, Cocartesian<Iterable<A>, Iterable<A>, Fn1<?,?>>, Contravariant<Iterable<A>, Profunctor<?, Iterable<A>, Fn1<?,?>>>, Functor<Iterable<A>, Fn1<Iterable<A>, ?>>, Profunctor<Iterable<A>, Iterable<A>, Fn1<?,?>>, Monad<Iterable<A>, Fn1<Iterable<A>, ?>>, MonadReader<Iterable<A>, Iterable<A>, Fn1<Iterable<A>, ?>>, MonadRec<Iterable<A>, Fn1<Iterable<A>, ?>>, MonadWriter<Iterable<A>, Iterable<A>, Fn1<Iterable<A>, ?>>

public final class Reverse<A> extends Object implements Fn1<Iterable<A>, Iterable<A>>
Given an Iterable, return a reversed representation of that Iterable. Note that reversing is deferred until the returned Iterable is iterated.
  • Field Details

    • INSTANCE

      private static final Reverse<?> INSTANCE
  • Constructor Details

    • Reverse

      private Reverse()
  • Method Details

    • checkedApply

      public Iterable<A> checkedApply(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<Iterable<A>, Iterable<A>>
      Parameters:
      as - the argument
      Returns:
      the result of the function application
    • reverse

      public static <A> Reverse<A> reverse()
    • reverse

      public static <A> Iterable<A> reverse(Iterable<A> as)