@@ -42,7 +42,7 @@ public int hash(final A a) {
4242 * @param g The function to map.
4343 * @return A new hash.
4444 */
45- public <B > Hash <B > comap (final F <B , A > g ) {
45+ public <B > Hash <B > contramap (final F <B , A > g ) {
4646 return hash (compose (f , g ));
4747 }
4848
@@ -165,7 +165,7 @@ public static <A, B> Hash<Either<A, B>> eitherHash(final Hash<A> ha, final Hash<
165165 * @return A hash instance for the {@link Validation} type.
166166 */
167167 public static <A , B > Hash <Validation <A , B >> validationHash (final Hash <A > ha , final Hash <B > hb ) {
168- return eitherHash (ha , hb ).comap (Validation .<A , B >either ());
168+ return eitherHash (ha , hb ).contramap (Validation .<A , B >either ());
169169 }
170170
171171 /**
@@ -196,7 +196,7 @@ public static <A> Hash<List<A>> listHash(final Hash<A> ha) {
196196 * @return A hash instance for the {@link NonEmptyList} type.
197197 */
198198 public static <A > Hash <NonEmptyList <A >> nonEmptyListHash (final Hash <A > ha ) {
199- return listHash (ha ).comap (NonEmptyList .<A >toList_ ());
199+ return listHash (ha ).contramap (NonEmptyList .<A >toList_ ());
200200 }
201201
202202 /**
@@ -264,7 +264,7 @@ public static <A> Hash<Array<A>> arrayHash(final Hash<A> ha) {
264264 * @return A hash instance for the {@link Tree} type.
265265 */
266266 public static <A > Hash <Tree <A >> treeHash (final Hash <A > ha ) {
267- return streamHash (ha ).comap (Tree .<A >flatten_ ());
267+ return streamHash (ha ).contramap (Tree .<A >flatten_ ());
268268 }
269269
270270 public static <K , V > Hash <TreeMap <K , V >> treeMapHash (final Hash <K > h , final Hash <V > v ) {
@@ -278,7 +278,7 @@ public static <K, V> Hash<TreeMap<K, V>> treeMapHash(final Hash<K> h, final Hash
278278 * @return A hash instance for a product-1.
279279 */
280280 public static <A > Hash <P1 <A >> p1Hash (final Hash <A > ha ) {
281- return ha .comap (P1 .<A >__1 ());
281+ return ha .contramap (P1 .<A >__1 ());
282282 }
283283
284284 /**
@@ -473,7 +473,7 @@ public static <A, B, C, D, E> Hash<P5<A, B, C, D, E>> p5Hash(final Hash<A> ha, f
473473 * @return A hash instance for a vector-2.
474474 */
475475 public static <A > Hash <V2 <A >> v2Hash (final Hash <A > ea ) {
476- return streamHash (ea ).comap (V2 .<A >toStream_ ());
476+ return streamHash (ea ).contramap (V2 .<A >toStream_ ());
477477 }
478478
479479 /**
@@ -483,7 +483,7 @@ public static <A> Hash<V2<A>> v2Hash(final Hash<A> ea) {
483483 * @return A hash instance for a vector-3.
484484 */
485485 public static <A > Hash <V3 <A >> v3Hash (final Hash <A > ea ) {
486- return streamHash (ea ).comap (V3 .<A >toStream_ ());
486+ return streamHash (ea ).contramap (V3 .<A >toStream_ ());
487487 }
488488
489489 /**
@@ -493,7 +493,7 @@ public static <A> Hash<V3<A>> v3Hash(final Hash<A> ea) {
493493 * @return A hash instance for a vector-4.
494494 */
495495 public static <A > Hash <V4 <A >> v4Hash (final Hash <A > ea ) {
496- return streamHash (ea ).comap (V4 .<A >toStream_ ());
496+ return streamHash (ea ).contramap (V4 .<A >toStream_ ());
497497 }
498498
499499 /**
@@ -503,7 +503,7 @@ public static <A> Hash<V4<A>> v4Hash(final Hash<A> ea) {
503503 * @return A hash instance for a vector-5.
504504 */
505505 public static <A > Hash <V5 <A >> v5Hash (final Hash <A > ea ) {
506- return streamHash (ea ).comap (V5 .<A >toStream_ ());
506+ return streamHash (ea ).contramap (V5 .<A >toStream_ ());
507507 }
508508
509509 /**
@@ -513,7 +513,7 @@ public static <A> Hash<V5<A>> v5Hash(final Hash<A> ea) {
513513 * @return A hash instance for a vector-6.
514514 */
515515 public static <A > Hash <V6 <A >> v6Hash (final Hash <A > ea ) {
516- return streamHash (ea ).comap (V6 .<A >toStream_ ());
516+ return streamHash (ea ).contramap (V6 .<A >toStream_ ());
517517 }
518518
519519 /**
@@ -523,7 +523,7 @@ public static <A> Hash<V6<A>> v6Hash(final Hash<A> ea) {
523523 * @return A hash instance for a vector-7.
524524 */
525525 public static <A > Hash <V7 <A >> v7Hash (final Hash <A > ea ) {
526- return streamHash (ea ).comap (V7 .<A >toStream_ ());
526+ return streamHash (ea ).contramap (V7 .<A >toStream_ ());
527527 }
528528
529529 /**
@@ -533,6 +533,6 @@ public static <A> Hash<V7<A>> v7Hash(final Hash<A> ea) {
533533 * @return A hash instance for a vector-8.
534534 */
535535 public static <A > Hash <V8 <A >> v8Hash (final Hash <A > ea ) {
536- return streamHash (ea ).comap (V8 .<A >toStream_ ());
536+ return streamHash (ea ).contramap (V8 .<A >toStream_ ());
537537 }
538538}
0 commit comments