I have defined a Fine-Grained Functor class (FgFunctor
) in order to apply a constraint to the type of functions that may map over my Ordered Triple datatype (
When the compiler (GHC) looks for instances of a type class for a specific type, it doesn't take contexts of each instance into account. That's why it found two instances of FgFunctor
for OrdTriple
even though OrdTriple
is not an instance of Functor
.
GHC/AdvancedOverlap shows you how you can solve this situation.