Package net.hydromatic.morel.util
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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classFolder.End<E>Sub-class ofFolderthat marks the end of a list.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description private static <E> voidappend(List<Folder<E>> list, E e, Function<E,Folder<E>> fn)Adds an element and operator to a non-empty list.static voidat(List<Folder<Ast.Exp>> list, Ast.Exp exp)Appends an element using "@".(package private) abstract Ecombine(List<Folder<E>> list)static <E> EcombineAll(List<Folder<E>> list)static voidcons(List<Folder<Ast.Exp>> list, Ast.Exp exp)Appends an element using "::".private static <E> Folder<E>end(E e)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.static <E> voidstart(List<Folder<E>> list, E e)Adds an element to an empty list.
-
-
-
Field Detail
-
e
final E e
-
-
Constructor Detail
-
Folder
Folder(E e)
-
-
Method Detail
-
end
private static <E> Folder<E> end(E e)
-
cons
public static void cons(List<Folder<Ast.Exp>> list, Ast.Exp exp)
Appends an element using "::".
-
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.
-
-