Class HList<A extends HList<A>>
java.lang.Object
fj.data.hlist.HList<A>
- Type Parameters:
A- The specific type of the list, as a subtype of HList
- Direct Known Subclasses:
HList.HCons, HList.HNil
Type-safe heterogeneous lists.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classHList.Apply<F$,A, R> Type-level function application operators.static final classHList.HAppend<A,B, C> The concatenation of two heterogeneous lists.static final classHList.HCons<E, L extends HList<L>>The nonempty liststatic final classHList.HFoldr<G,V, L, R> The catamorphism over heterogeneous lists.static final classThe empty list -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <E, L extends HList<L>>
HList.HCons<E, L> cons(E e, L l) Returns a heterogeneous list consisting of an element and another list.abstract <E> HList.HCons<E, A> extend(E e) Extends (cons) this list by prepending the given element, returning a new list.abstract <E> HList.Apply<Unit, P2<E, A>, HList.HCons<E, A>> extender()static HList.HNilnil()Returns the empty list.static <E> HList.HCons<E, HList.HNil> single(E e) Returns a heterogeneous list consisting of a single element.
-
Constructor Details
-
HList
HList()
-
-
Method Details
-
extend
Extends (cons) this list by prepending the given element, returning a new list.- Parameters:
e- an element to prepend to this list.- Returns:
- a new heterogeneous list, consisting of the given element prepended to this list.
-
extender
-
nil
-
cons
Returns a heterogeneous list consisting of an element and another list.- Parameters:
e- an element to put in a list.l- the rest of the list.- Returns:
- a heterogeneous list consisting of an element and another list.
-
single
Returns a heterogeneous list consisting of a single element.- Parameters:
e- an element to put in a list- Returns:
- a heterogeneous list consisting of a single element.
-