11package com .jnape .palatable .lambda .functor .builtin ;
22
33import com .jnape .palatable .lambda .functor .Profunctor ;
4+ import com .jnape .palatable .lambda .optics .Iso ;
45
56import java .util .function .Function ;
67
@@ -21,30 +22,52 @@ public Exchange(Function<? super S, ? extends A> sa, Function<? super B, ? exten
2122 this .bt = bt ;
2223 }
2324
25+ /**
26+ * Extract the mapping <code>S -> A</code>.
27+ *
28+ * @return a <code>{@link Function}<S, A></code>
29+ */
2430 public Function <? super S , ? extends A > sa () {
2531 return sa ;
2632 }
2733
34+ /**
35+ * Extract the mapping <code>B -> T</code>.
36+ *
37+ * @return a <code>{@link Function}<B, T></code>
38+ */
2839 public Function <? super B , ? extends T > bt () {
2940 return bt ;
3041 }
3142
43+ /**
44+ * {@inheritDoc}
45+ */
3246 @ Override
3347 public <Z , C > Exchange <A , B , Z , C > diMap (Function <? super Z , ? extends S > lFn ,
3448 Function <? super T , ? extends C > rFn ) {
3549 return new Exchange <>(lFn .andThen (sa ), bt .andThen (rFn ));
3650 }
3751
52+ /**
53+ * {@inheritDoc}
54+ */
3855 @ Override
3956 public <Z > Exchange <A , B , Z , T > diMapL (Function <? super Z , ? extends S > fn ) {
4057 return (Exchange <A , B , Z , T >) Profunctor .super .<Z >diMapL (fn );
4158 }
4259
60+ /**
61+ * {@inheritDoc}
62+ */
4363 @ Override
4464 public <C > Exchange <A , B , S , C > diMapR (Function <? super T , ? extends C > fn ) {
4565 return (Exchange <A , B , S , C >) Profunctor .super .<C >diMapR (fn );
4666 }
4767
68+ /**
69+ * {@inheritDoc}
70+ */
4871 @ Override
4972 public <Z > Exchange <A , B , Z , T > contraMap (Function <? super Z , ? extends S > fn ) {
5073 return (Exchange <A , B , Z , T >) Profunctor .super .<Z >contraMap (fn );
0 commit comments