Class HListLens


  • public final class HListLens
    extends java.lang.Object
    Lenses that operate on HLists.
    • Constructor Detail

      • HListLens

        public HListLens()
    • Method Detail

      • elementAt

        public static <E,​List extends HList.HCons<?,​?>> Lens.Simple<List,​E> elementAt​(Index<E,​List> index)
        Focus invariantly on the element at the specified Index in an HList.
        Type Parameters:
        E - the element type
        List - 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 HListLens.Simple<HList.HCons<Head,​? extends Tail>,​Head> head()
        Focus on the head of an HList.
        Type Parameters:
        Head - the head element type
        Tail - the tail HList type
        Returns:
        a lens that focuses on the head of an HList
      • tail

        public static <Head,​Tail extends HListLens.Simple<HList.HCons<Head,​? extends Tail>,​Tail> tail()
        Focus on the tail of an HList.
        Type Parameters:
        Head - the head element type
        Tail - the tail HList type
        Returns:
        a lens that focuses on the tail of an HList