Functor supertype has conflicting instances

后端 未结 1 836
野性不改
野性不改 2021-01-19 16:26

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 (

相关标签:
1条回答
  • 2021-01-19 16:55

    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.

    0 讨论(0)
提交回复
热议问题