Because Semigroup is invariant and there is no instance defined for HashMap , just Map . Invariance basically means that the syntax |+| cannot use a Semigroup instance for Map for a type that displays as HashMap , although HashMap is a subtype of Map .
In some cases, Scalaz scales are uselessly invariant. However, this is not one of these cases. Because of the function signature |+| variance (either co-or contra) does not make much sense, and therefore the vertex class is in its maximum generality.
source share