Class HListLens
- java.lang.Object
-
- com.jnape.palatable.lambda.optics.lenses.HListLens
-
public final class HListLens extends java.lang.Object
Lenses that operate onHList
s.
-
-
Constructor Summary
Constructors Constructor Description HListLens()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <E,List extends HList.HCons<?,?>>
Lens.Simple<List,E>elementAt(Index<E,List> index)
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
.
-
-
-
Method Detail
-
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
public static <Head,Tail extends HList> Lens.Simple<HList.HCons<Head,? extends Tail>,Head> 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
public static <Head,Tail extends HList> Lens.Simple<HList.HCons<Head,? extends Tail>,Tail> 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
-
-