3 ms·
How you handle this gets into the details of the programming language used for implementation. The usual implementation technique is type classes, and the issu
by noelwelsh 7y ago
How you handle this gets into the details of the programming language used for implementation.
The usual implementation technique is type classes, and the issue of having multiple type classes (implementations of, say, monoid) for a given type is known as "type class coherence".
In Scala you could just pass a type class instance explicitly. If Haskell you'd have to change the type.