Ovelapping Show instances for monadic values
Got another one for you.
Try this:
debug [d|
f :: Int -> m Int
f _ = undefined
|]
You get an Overlapping instances for Show (m0 Int) error. This can be "fixed" by adding a instance {-# INCOHERENT #-} Show (m Int) somewhere because the arcane rules of instance selection pick this one.
I'm not really sure what you can really do about this.
Thanks! I think the Show a instance I added is proving actively harmful - it works well in the same module, but is of no use in a different module, where it must live in the Debug library. Or I could inject a Show, but then you probably get other nasty problems.
Perhaps however _ => is enough to have GHC infer whatever Show instances it needs? Will try that tonight - Show (m Int) would be ideal.
I went with _ => and it's vastly simpler - great news!
I had to comment out the type2 example, so that still needs work.