Skip to content

Why is UnorderedTraverseForHashMap requiring a Hash constraint #821

Description

@loladenney

The hash constraint is expanded to an implicit evidence parameter with type Hash[K], which is never used. Every method defined in the body of this implicit conversion definition has a parameter fa of type HashMap[K, A], from which the constraint K:Hash can be obtained. Furthermore for binary compatibility reasons any additions methods defined must start from existing ones so any future method will also have the same property. The implicit unused evidence parameter seems like it will never see any use, so it might be best to remove it (from what I understand this mean to mark the current one deprecated and have it point to the new one without the constraint).

sealed abstract private[collections] class HashMapInstances extends HashMapInstances1 {
implicit def catsCollectionsUnorderedTraverseForHashMap[K: Hash]: UnorderedTraverse[HashMap[K, *]] =
new UnorderedTraverse[HashMap[K, *]] {

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions