/** * Compute the hash code from this list as a function of the hash codes of its members. * Delegates to Hash.listHash, using the anyHash() rule, which uses the hash codes of the contents. * * @return the hash code for this list. */ @Override public final int hashCode() { return Hash.listHash(Hash.<A>anyHash()).hash(this); }
/** * A hash instance for the {@link NonEmptyList} type. * * @param ha A hash for the elements of the non-empty list. * @return A hash instance for the {@link NonEmptyList} type. */ public static <A> Hash<NonEmptyList<A>> nonEmptyListHash(final Hash<A> ha) { return listHash(ha).contramap(NonEmptyList.toList_()); }