type myInt int
func (mi myInt) f() myInt { ... }type Int int
func (i Int) Hash() uintptr { /* do the hash */ }
But I didn't want to deal with it in this code. I agree that it isn't optimal and would be curious to see if the situation can be improved.
It's emphasizing writeability over understandability, which is totally backwards from the point of view of engineering robust systems.
Except it's barely even writeability, it's some bizarre notion that code should read like English where possible. And of course, since it's not actually English, it's only possible in limited ways and trying to generalize past those limits will break. So you have to learn exactly where the limits are anyway, which is as much effort as learning to use a proper library, except harder because a proper library will have the decency to stay in its own namespace.