Class HListLens
java.lang.Object
com.jnape.palatable.lambda.optics.lenses.HListLens
Lenses that operate on
HList
s.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <E,
List extends HList.HCons<?, ?>>
Lens.Simple<List, E> static <Head,
Tail extends HList>
Lens.Simple<HList.HCons<Head, ? extends Tail>, Head> head()
Focus on the head of anHList
.static <Head,
Tail extends HList>
Lens.Simple<HList.HCons<Head, ? extends Tail>, Tail> tail()
Focus on the tail of anHList
.
-
Constructor Details
-
HListLens
public HListLens()
-
-
Method Details
-
elementAt
public static <E,List extends HList.HCons<?, Lens.Simple<List,?>> E> elementAt(Index<E, List> index) - Type Parameters:
E
- the element typeList
- the HList under focus- Parameters:
index
- the index of the element to focus on- Returns:
- a lens focusing on the element at index
-
head
Focus on the head of anHList
.- Type Parameters:
Head
- the head element typeTail
- the tail HList type- Returns:
- a lens that focuses on the head of an HList
-
tail
Focus on the tail of anHList
.- Type Parameters:
Head
- the head element typeTail
- the tail HList type- Returns:
- a lens that focuses on the tail of an HList
-