Interface Schema<Values extends HList>
- Type Parameters:
Values
- theHList
of 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 com.jnape.palatable.lambda.optics.Lens
Lens.Simple<S,
A> Nested classes/interfaces inherited from interface com.jnape.palatable.lambda.optics.Optic
Optic.Simple<P extends Profunctor<?,
?, ? extends P>, F extends Functor<?, ? extends F>, S, A> -
Method Summary
Modifier and TypeMethodDescriptiondefault <A,
NewValues extends HList.HCons<A, Values>>
Schema<NewValues> add
(TypeSafeKey<?, A> key) Add a newTypeSafeKey
to the head of thisSchema
.static <A> Schema
<SingletonHList<A>> schema
(TypeSafeKey<?, A> key) Create aSchema
from a singleTypeSafeKey
.schema
(TypeSafeKey<?, A> aKey, TypeSafeKey<?, B> bKey) Create aSchema
from twoTypeSafeKeys
.schema
(TypeSafeKey<?, A> aKey, TypeSafeKey<?, B> bKey, TypeSafeKey<?, C> cKey) Create aSchema
from threeTypeSafeKeys
.schema
(TypeSafeKey<?, A> aKey, TypeSafeKey<?, B> bKey, TypeSafeKey<?, C> cKey, TypeSafeKey<?, D> dKey) Create aSchema
from fourTypeSafeKeys
.schema
(TypeSafeKey<?, A> aKey, TypeSafeKey<?, B> bKey, TypeSafeKey<?, C> cKey, TypeSafeKey<?, D> dKey, TypeSafeKey<?, E> eKey) Create aSchema
from fiveTypeSafeKeys
.schema
(TypeSafeKey<?, A> aKey, TypeSafeKey<?, B> bKey, TypeSafeKey<?, C> cKey, TypeSafeKey<?, D> dKey, TypeSafeKey<?, E> eKey, TypeSafeKey<?, F> fKey) Create aSchema
from sixTypeSafeKeys
.schema
(TypeSafeKey<?, A> aKey, TypeSafeKey<?, B> bKey, TypeSafeKey<?, C> cKey, TypeSafeKey<?, D> dKey, TypeSafeKey<?, E> eKey, TypeSafeKey<?, F> fKey, TypeSafeKey<?, G> gKey) Create aSchema
from 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 aSchema
from eightTypeSafeKeys
.Methods inherited from interface com.jnape.palatable.lambda.optics.Lens
andThen, compose, contraMap, diMap, diMapL, diMapR, discardL, discardR, flatMap, fmap, mapA, mapB, mapS, mapT, pure, toIso, trampolineM, zip
Methods inherited from interface com.jnape.palatable.lambda.optics.Lens.Simple
andThen, compose
Methods inherited from interface com.jnape.palatable.lambda.optics.Optic
apply, monomorphize
-
Method Details
-
add
Add a newTypeSafeKey
to the head of thisSchema
.- Type Parameters:
A
- the value the head key focuses onNewValues
- the newHList.HCons
of values- Parameters:
key
- the new head key- Returns:
- the updated
Schema
-
schema
Create aSchema
from a singleTypeSafeKey
.- Type Parameters:
A
- the type of value the key focuses on- Parameters:
key
- theTypeSafeKey
- Returns:
- the
Schema
-
schema
Create aSchema
from 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 firstTypeSafeKey
bKey
- 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 aSchema
from 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 firstTypeSafeKey
bKey
- the secondTypeSafeKey
cKey
- 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 aSchema
from 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 firstTypeSafeKey
bKey
- the secondTypeSafeKey
cKey
- the thirdTypeSafeKey
dKey
- 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 aSchema
from 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 firstTypeSafeKey
bKey
- the secondTypeSafeKey
cKey
- the thirdTypeSafeKey
dKey
- the fourthTypeSafeKey
eKey
- 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 aSchema
from 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 firstTypeSafeKey
bKey
- the secondTypeSafeKey
cKey
- the thirdTypeSafeKey
dKey
- the fourthTypeSafeKey
eKey
- the fifthTypeSafeKey
fKey
- 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 aSchema
from 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 firstTypeSafeKey
bKey
- the secondTypeSafeKey
cKey
- the thirdTypeSafeKey
dKey
- the fourthTypeSafeKey
eKey
- the fifthTypeSafeKey
fKey
- the sixthTypeSafeKey
gKey
- 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 aSchema
from 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 firstTypeSafeKey
bKey
- the secondTypeSafeKey
cKey
- the thirdTypeSafeKey
dKey
- the fourthTypeSafeKey
eKey
- the fifthTypeSafeKey
fKey
- the sixthTypeSafeKey
gKey
- the seventhTypeSafeKey
hKey
- the eighthTypeSafeKey
- Returns:
- the
Schema
-