
5 Mar
2008
5 Mar
'08
1:53 a.m.
Consider the following modules module A class A t module T import A data T a module B import A import T class A t => B t instance B t => A (T t) GHC emits warning about orphan instance A (T t), since neither A nor T are defined in B. However I can't move the instance to A or T since it depends on B. Would it be fine to lift the restriction, such that it is accepted to declare the instance in a module where the type or the class or a superclass (this is new) is defined? In my example class B provides conversion toInteger (that is Integral), class A provides conversion toRational (that is Real) and T is Ratio.