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>>>
public interface Schema<Values extends HList> extends Lens.Simple<HMap,Maybe<Values>>
A lens that focuses on theheterogeneous list
of values pointed at by one or moretypesafe keys
that must all exist in the sameHMap
to be collectively extracted. Note that if any of the keys is absent in the map, the result will beMaybe.nothing()
.- See Also:
TypeSafeKey
-
-
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
All Methods Static Methods Instance Methods Default Methods Modifier and Type Method Description default <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
.static <A,B>
Schema<Tuple2<A,B>>schema(TypeSafeKey<?,A> aKey, TypeSafeKey<?,B> bKey)
Create aSchema
from twoTypeSafeKeys
.static <A,B,C>
Schema<Tuple3<A,B,C>>schema(TypeSafeKey<?,A> aKey, TypeSafeKey<?,B> bKey, TypeSafeKey<?,C> cKey)
Create aSchema
from threeTypeSafeKeys
.static <A,B,C,D>
Schema<Tuple4<A,B,C,D>>schema(TypeSafeKey<?,A> aKey, TypeSafeKey<?,B> bKey, TypeSafeKey<?,C> cKey, TypeSafeKey<?,D> dKey)
Create aSchema
from fourTypeSafeKeys
.static <A,B,C,D,E>
Schema<Tuple5<A,B,C,D,E>>schema(TypeSafeKey<?,A> aKey, TypeSafeKey<?,B> bKey, TypeSafeKey<?,C> cKey, TypeSafeKey<?,D> dKey, TypeSafeKey<?,E> eKey)
Create aSchema
from fiveTypeSafeKeys
.static <A,B,C,D,E,F>
Schema<Tuple6<A,B,C,D,E,F>>schema(TypeSafeKey<?,A> aKey, TypeSafeKey<?,B> bKey, TypeSafeKey<?,C> cKey, TypeSafeKey<?,D> dKey, TypeSafeKey<?,E> eKey, TypeSafeKey<?,F> fKey)
Create aSchema
from sixTypeSafeKeys
.static <A,B,C,D,E,F,G>
Schema<Tuple7<A,B,C,D,E,F,G>>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
.static <A,B,C,D,E,F,G,H>
Schema<Tuple8<A,B,C,D,E,F,G,H>>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 Detail
-
add
default <A,NewValues extends HList.HCons<A,Values>> Schema<NewValues> add(TypeSafeKey<?,A> key)
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
static <A> Schema<SingletonHList<A>> schema(TypeSafeKey<?,A> key)
Create aSchema
from a singleTypeSafeKey
.- Type Parameters:
A
- the type of value the key focuses on- Parameters:
key
- theTypeSafeKey
- Returns:
- the
Schema
-
schema
static <A,B> Schema<Tuple2<A,B>> schema(TypeSafeKey<?,A> aKey, TypeSafeKey<?,B> bKey)
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,C> Schema<Tuple3<A,B,C>> schema(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,C,D> Schema<Tuple4<A,B,C,D>> schema(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,C,D,E> Schema<Tuple5<A,B,C,D,E>> schema(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,C,D,E,F> Schema<Tuple6<A,B,C,D,E,F>> schema(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,C,D,E,F,G> Schema<Tuple7<A,B,C,D,E,F,G>> 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
.- 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,C,D,E,F,G,H> Schema<Tuple8<A,B,C,D,E,F,G,H>> 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
.- 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
-
-