Class Folder<E>

java.lang.Object
net.hydromatic.morel.util.Folder<E>
Type Parameters:
E - Element type
Direct Known Subclasses:
Folder.End

public abstract class Folder<E> extends Object
Enable creating right-deep trees.
  • Field Details

    • e

      final E e
  • Constructor Details

    • Folder

      Folder(E e)
  • Method Details

    • combine

      abstract E combine(List<Folder<E>> list)
    • combineAll

      public static <E> E combineAll(List<Folder<E>> list)
    • end

      private static <E> Folder<E> end(E e)
    • at

      public static void at(List<Folder<Ast.Exp>> list, Ast.Exp exp)
      Appends an element using "@".
    • cons

      public static void cons(List<Folder<Ast.Exp>> list, Ast.Exp exp)
      Appends an element using "::".
    • start

      public static <E> void start(List<Folder<E>> list, E e)
      Adds an element to an empty list.
    • append

      private static <E> void append(List<Folder<E>> list, E e, Function<E,Folder<E>> fn)
      Adds an element and operator to a non-empty list.
    • op

      private static Folder<Ast.Exp> op(Ast.Exp exp, Op at)
      Creates a folder that combines an expression with whatever follows using an infix operator.