33import com .jnape .palatable .lambda .functor .Applicative ;
44import com .jnape .palatable .lambda .functor .Functor ;
55import com .jnape .palatable .lambda .functor .Profunctor ;
6- import com .jnape .palatable .lambda .lens .Iso ;
7- import com .jnape .palatable .lambda .lens . LensLike ;
6+ import com .jnape .palatable .lambda .optics .Iso ;
7+ import com .jnape .palatable .lambda .optics . Optic ;
88
99import java .util .Objects ;
1010
2323 */
2424public interface TypeSafeKey <A , B > extends Iso .Simple <A , B > {
2525
26+
2627 @ Override
27- default <U > TypeSafeKey <A , B > discardR (Applicative <U , LensLike <A , ?, B , B , Iso <?, ?, ?, ?> >> appB ) {
28+ default <U > TypeSafeKey <A , B > discardR (Applicative <U , Iso <A , ?, B , B >> appB ) {
2829 Iso .Simple <A , B > discarded = Iso .Simple .super .discardR (appB );
2930 return new TypeSafeKey <A , B >() {
3031 @ Override
31- public <P extends Profunctor <?, ?, P >, F extends Functor <?, F >, FB extends Functor <B , F >,
32- FT extends Functor <A , F >, PAFB extends Profunctor <B , FB , P >,
33- PSFT extends Profunctor <A , FT , P >> PSFT apply (PAFB pafb ) {
32+ public <CoP extends Profunctor <?, ?, ? extends Profunctor <?, ?, ?>>, CoF extends Functor <?, ? extends Functor <?, ?>>, FB extends Functor <B , ? extends CoF >, FT extends Functor <A , ? extends CoF >, PAFB extends Profunctor <B , FB , ? extends CoP >, PSFT extends Profunctor <A , FT , ? extends CoP >> PSFT apply (
33+ PAFB pafb ) {
3434 return discarded .apply (pafb );
3535 }
3636
@@ -49,7 +49,7 @@ public boolean equals(Object obj) {
4949 /**
5050 * Left-to-right composition of this {@link TypeSafeKey} with some other {@link Iso}. Because the first parameter
5151 * fundamentally represents an already stored value type, this is the only composition that is possible for
52- * {@link TypeSafeKey}, which is why only this (and not {@link Iso#compose(Iso )}) is overridden.
52+ * {@link TypeSafeKey}, which is why only this (and not {@link Iso#compose(Optic )}) is overridden.
5353 * <p>
5454 * Particularly of note is the fact that values stored at this key are still stored as their original manifest
5555 * type, and are not duplicated - which is to say, putting a value at a key, yielding a new key via composition,
@@ -61,13 +61,12 @@ public boolean equals(Object obj) {
6161 * @return the new {@link TypeSafeKey}
6262 */
6363 @ Override
64- default <C > TypeSafeKey <A , C > andThen (Iso .Simple <B , C > f ) {
64+ default <C > TypeSafeKey <A , C >andThen (Iso .Simple <B , C > f ) {
6565 Iso .Simple <A , C > composed = Iso .Simple .super .andThen (f );
6666 return new TypeSafeKey <A , C >() {
6767 @ Override
68- public <P extends Profunctor <?, ?, P >, F extends Functor <?, F >, FB extends Functor <C , F >,
69- FT extends Functor <A , F >, PAFB extends Profunctor <C , FB , P >,
70- PSFT extends Profunctor <A , FT , P >> PSFT apply (PAFB pafb ) {
68+ public <CoP extends Profunctor <?, ?, ? extends Profunctor <?, ?, ?>>, CoF extends Functor <?, ? extends Functor <?, ?>>, FB extends Functor <C , ? extends CoF >, FT extends Functor <A , ? extends CoF >, PAFB extends Profunctor <C , FB , ? extends CoP >, PSFT extends Profunctor <A , FT , ? extends CoP >> PSFT apply (
69+ PAFB pafb ) {
7170 return composed .apply (pafb );
7271 }
7372
@@ -112,9 +111,13 @@ interface Simple<A> extends TypeSafeKey<A, A> {
112111
113112 @ Override
114113 @ SuppressWarnings ("unchecked" )
115- default <P extends Profunctor <?, ?, P >, F extends Functor <?, F >, FB extends Functor <A , F >,
116- FT extends Functor <A , F >, PAFB extends Profunctor <A , FB , P >,
117- PSFT extends Profunctor <A , FT , P >> PSFT apply (PAFB pafb ) {
114+ default <CoP extends Profunctor <?, ?, ? extends Profunctor <?, ?, ?>>,
115+ CoF extends Functor <?, ? extends Functor <?, ?>>,
116+ FB extends Functor <A , ? extends CoF >,
117+ FT extends Functor <A , ? extends CoF >,
118+ PAFB extends Profunctor <A , FB , ? extends CoP >,
119+ PSFT extends Profunctor <A , FT , ? extends CoP >> PSFT apply (
120+ PAFB pafb ) {
118121 return (PSFT ) pafb ;
119122 }
120123 }
0 commit comments