Package fj.data.hlist
Class HList.HFoldr<G,V,L,R>
java.lang.Object
fj.data.hlist.HList.HFoldr<G,V,L,R>
- Type Parameters:
G
- The type of the function with which to fold.V
- The type of the value to be substituted for the empty list.L
- The type of the heterogeneous list to be folded.R
- The return type of the fold.
The catamorphism over heterogeneous lists.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionFolds a non-empty heterogeneous list.static <G,
V> HList.HFoldr <G, V, HList.HNil, V> hFoldr()
A fold instance for the empty list.static <E,
G, V, L extends HList<L>, R, RR, H extends HList.HFoldr<G, V, L, R>, PP extends HList.Apply<G, P2<E, R>, RR>>
HList.HFoldr<G, V, HList.HCons<E, L>, RR> hFoldr
(PP p, H h) A fold instance for a non-empty heterogeneous list
-
Field Details
-
foldRight
-
-
Constructor Details
-
HFoldr
-
-
Method Details
-
hFoldr
A fold instance for the empty list.- Type Parameters:
G
- The type of the function with which to fold.V
- The type of value that this fold returns.- Returns:
- a fold instance for the empty list.
-
hFoldr
public static <E,G, HList.HFoldr<G,V, L extends HList<L>, R, RR, H extends HList.HFoldr<G, V, L, R>, PP extends HList.Apply<G, P2<E, R>, RR>> V, hFoldrHList.HCons<E, L>, RR> (PP p, H h) A fold instance for a non-empty heterogeneous list- Type Parameters:
E
- The type of the head of the list.G
- The type of function to apply to the head of the list and the fold of its tail.V
- The type of value to substitute for the empty list.L
- The type of the tail of the list.R
- The type of the fold of the tail of the list.RR
- The return type of the fold.H
- The type of the fold instance for the tail of the list.PP
- The type of the given function application operator.- Parameters:
p
- An operator that applies a function on the head of the list and the fold of its tail.h
- A fold instance for the tail of the list.- Returns:
- A fold instance for a non-empty heterogeneous list.
-
foldRight
Folds a non-empty heterogeneous list.- Parameters:
f
- A function with which to fold.v
- The value to substitute for the empty list.l
- The heterogeneous list to be folded.- Returns:
- a value obtained by folding the given list with the given function.
-