I currently have a structure similar to the following:
class F a where
f :: ...
default f :: (G a...) => ...
f = (some definition in terms of g)
class F a => G a where
g :: ...
default g :: (C a...) => ...
g = (some definition in terms of f)
Hoping for some simple English, I can always write fin terms g. Sometimes I can write gin terms f, namely when it asatisfies the condition C.
The problem I see here is if someone writes, for example, a type TsatisfyingC T
instance F T
instance G T
This will compile and loop at runtime. Although both definitions are correct by default, it is important to define at least one.
I could solve this by using MINIMALa pragma if fand gwere in the same class, but in this case they are not.
f, g , g f, g f. g f, C a, g a, C a.
, , ?