Interface Schema<Values extends HList>
- Type Parameters:
Values- theHListof values to focus on
- All Superinterfaces:
Applicative<HMap, Lens<HMap, ?, Maybe<Values>, Maybe<Values>>>, Contravariant<HMap, Profunctor<?, HMap, Lens<?, ?, Maybe<Values>, Maybe<Values>>>>, Functor<HMap, Lens<HMap, ?, Maybe<Values>, Maybe<Values>>>, Lens<HMap, HMap, Maybe<Values>, Maybe<Values>>, Lens.Simple<HMap, Maybe<Values>>, Monad<HMap, Lens<HMap, ?, Maybe<Values>, Maybe<Values>>>, MonadRec<HMap, Lens<HMap, ?, Maybe<Values>, Maybe<Values>>>, Optic<Cartesian<?,?, ?>, Functor<?, ?>, HMap, HMap, Maybe<Values>, Maybe<Values>>, Optic.Simple<Cartesian<?, ?, ?>, Functor<?, ?>, HMap, Maybe<Values>>, Profunctor<HMap, HMap, Lens<?, ?, Maybe<Values>, Maybe<Values>>>
A lens that focuses on the
heterogeneous list of values pointed at by one or more
typesafe keys that must all exist in the same HMap to be collectively extracted. Note
that if any of the keys is absent in the map, the result will be Maybe.nothing().- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface Lens
Lens.Simple<S,A> Nested classes/interfaces inherited from interface Optic
Optic.Simple<P,F, S, A> -
Method Summary
Modifier and TypeMethodDescriptiondefault <A, NewValues extends HList.HCons<A,Values>>
Schema<NewValues> add(TypeSafeKey<?, A> key) Add a newTypeSafeKeyto the head of thisSchema.static <A> Schema<SingletonHList<A>> schema(TypeSafeKey<?, A> key) Create aSchemafrom a singleTypeSafeKey.schema(TypeSafeKey<?, A> aKey, TypeSafeKey<?, B> bKey) Create aSchemafrom twoTypeSafeKeys.schema(TypeSafeKey<?, A> aKey, TypeSafeKey<?, B> bKey, TypeSafeKey<?, C> cKey) Create aSchemafrom threeTypeSafeKeys.schema(TypeSafeKey<?, A> aKey, TypeSafeKey<?, B> bKey, TypeSafeKey<?, C> cKey, TypeSafeKey<?, D> dKey) Create aSchemafrom fourTypeSafeKeys.schema(TypeSafeKey<?, A> aKey, TypeSafeKey<?, B> bKey, TypeSafeKey<?, C> cKey, TypeSafeKey<?, D> dKey, TypeSafeKey<?, E> eKey) Create aSchemafrom fiveTypeSafeKeys.schema(TypeSafeKey<?, A> aKey, TypeSafeKey<?, B> bKey, TypeSafeKey<?, C> cKey, TypeSafeKey<?, D> dKey, TypeSafeKey<?, E> eKey, TypeSafeKey<?, F> fKey) Create aSchemafrom sixTypeSafeKeys.schema(TypeSafeKey<?, A> aKey, TypeSafeKey<?, B> bKey, TypeSafeKey<?, C> cKey, TypeSafeKey<?, D> dKey, TypeSafeKey<?, E> eKey, TypeSafeKey<?, F> fKey, TypeSafeKey<?, G> gKey) Create aSchemafrom sevenTypeSafeKeys.schema(TypeSafeKey<?, A> aKey, TypeSafeKey<?, B> bKey, TypeSafeKey<?, C> cKey, TypeSafeKey<?, D> dKey, TypeSafeKey<?, E> eKey, TypeSafeKey<?, F> fKey, TypeSafeKey<?, G> gKey, TypeSafeKey<?, H> hKey) Create aSchemafrom eightTypeSafeKeys.Methods inherited from interface Lens
andThen, compose, contraMap, diMap, diMapL, diMapR, discardL, discardR, flatMap, fmap, mapA, mapB, mapS, mapT, pure, toIso, trampolineM, zipMethods inherited from interface Lens.Simple
andThen, composeMethods inherited from interface Optic
apply, monomorphize
-
Method Details
-
add
Add a newTypeSafeKeyto the head of thisSchema.- Type Parameters:
A- the value the head key focuses onNewValues- the newHList.HConsof values- Parameters:
key- the new head key- Returns:
- the updated
Schema
-
schema
Create aSchemafrom a singleTypeSafeKey.- Type Parameters:
A- the type of value the key focuses on- Parameters:
key- theTypeSafeKey- Returns:
- the
Schema
-
schema
Create aSchemafrom twoTypeSafeKeys.- Type Parameters:
A- the type of value the first key focuses onB- the type of value the second key focuses on- Parameters:
aKey- the firstTypeSafeKeybKey- the secondTypeSafeKey- Returns:
- the
Schema
-
schema
static <A,B, Schema<Tuple3<A,C> B, schemaC>> (TypeSafeKey<?, A> aKey, TypeSafeKey<?, B> bKey, TypeSafeKey<?, C> cKey) Create aSchemafrom threeTypeSafeKeys.- Type Parameters:
A- the type of value the first key focuses onB- the type of value the second key focuses onC- the type of value the third key focuses on- Parameters:
aKey- the firstTypeSafeKeybKey- the secondTypeSafeKeycKey- the thirdTypeSafeKey- Returns:
- the
Schema
-
schema
static <A,B, Schema<Tuple4<A,C, D> B, schemaC, D>> (TypeSafeKey<?, A> aKey, TypeSafeKey<?, B> bKey, TypeSafeKey<?, C> cKey, TypeSafeKey<?, D> dKey) Create aSchemafrom fourTypeSafeKeys.- Type Parameters:
A- the type of value the first key focuses onB- the type of value the second key focuses onC- the type of value the third key focuses onD- the type of value the fourth key focuses on- Parameters:
aKey- the firstTypeSafeKeybKey- the secondTypeSafeKeycKey- the thirdTypeSafeKeydKey- the fourthTypeSafeKey- Returns:
- the
Schema
-
schema
static <A,B, Schema<Tuple5<A,C, D, E> B, schemaC, D, E>> (TypeSafeKey<?, A> aKey, TypeSafeKey<?, B> bKey, TypeSafeKey<?, C> cKey, TypeSafeKey<?, D> dKey, TypeSafeKey<?, E> eKey) Create aSchemafrom fiveTypeSafeKeys.- Type Parameters:
A- the type of value the first key focuses onB- the type of value the second key focuses onC- the type of value the third key focuses onD- the type of value the fourth key focuses onE- the type of value the fifth key focuses on- Parameters:
aKey- the firstTypeSafeKeybKey- the secondTypeSafeKeycKey- the thirdTypeSafeKeydKey- the fourthTypeSafeKeyeKey- the fifthTypeSafeKey- Returns:
- the
Schema
-
schema
static <A,B, Schema<Tuple6<A,C, D, E, F> B, schemaC, D, E, F>> (TypeSafeKey<?, A> aKey, TypeSafeKey<?, B> bKey, TypeSafeKey<?, C> cKey, TypeSafeKey<?, D> dKey, TypeSafeKey<?, E> eKey, TypeSafeKey<?, F> fKey) Create aSchemafrom sixTypeSafeKeys.- Type Parameters:
A- the type of value the first key focuses onB- the type of value the second key focuses onC- the type of value the third key focuses onD- the type of value the fourth key focuses onE- the type of value the fifth key focuses onF- the type of value the sixth key focuses on- Parameters:
aKey- the firstTypeSafeKeybKey- the secondTypeSafeKeycKey- the thirdTypeSafeKeydKey- the fourthTypeSafeKeyeKey- the fifthTypeSafeKeyfKey- the sixthTypeSafeKey- Returns:
- the
Schema
-
schema
static <A,B, Schema<Tuple7<A,C, D, E, F, G> B, schemaC, D, E, F, G>> (TypeSafeKey<?, A> aKey, TypeSafeKey<?, B> bKey, TypeSafeKey<?, C> cKey, TypeSafeKey<?, D> dKey, TypeSafeKey<?, E> eKey, TypeSafeKey<?, F> fKey, TypeSafeKey<?, G> gKey) Create aSchemafrom sevenTypeSafeKeys.- Type Parameters:
A- the type of value the first key focuses onB- the type of value the second key focuses onC- the type of value the third key focuses onD- the type of value the fourth key focuses onE- the type of value the fifth key focuses onF- the type of value the sixth key focuses onG- the type of value the seventh key focuses on- Parameters:
aKey- the firstTypeSafeKeybKey- the secondTypeSafeKeycKey- the thirdTypeSafeKeydKey- the fourthTypeSafeKeyeKey- the fifthTypeSafeKeyfKey- the sixthTypeSafeKeygKey- the seventhTypeSafeKey- Returns:
- the
Schema
-
schema
static <A,B, Schema<Tuple8<A,C, D, E, F, G, H> B, schemaC, D, E, F, G, H>> (TypeSafeKey<?, A> aKey, TypeSafeKey<?, B> bKey, TypeSafeKey<?, C> cKey, TypeSafeKey<?, D> dKey, TypeSafeKey<?, E> eKey, TypeSafeKey<?, F> fKey, TypeSafeKey<?, G> gKey, TypeSafeKey<?, H> hKey) Create aSchemafrom eightTypeSafeKeys.- Type Parameters:
A- the type of value the first key focuses onB- the type of value the second key focuses onC- the type of value the third key focuses onD- the type of value the fourth key focuses onE- the type of value the fifth key focuses onF- the type of value the sixth key focuses onG- the type of value the seventh key focuses onH- the type of value the eighth key focuses on- Parameters:
aKey- the firstTypeSafeKeybKey- the secondTypeSafeKeycKey- the thirdTypeSafeKeydKey- the fourthTypeSafeKeyeKey- the fifthTypeSafeKeyfKey- the sixthTypeSafeKeygKey- the seventhTypeSafeKeyhKey- the eighthTypeSafeKey- Returns:
- the
Schema
-