I've been getting some strange typeclass errors of the form "No instance for (Test a0) arising from an expression type signature". Here is the simplest version of the offending code I could come up with:
class Test a where
test :: a
foo = test
Adding the type doesn't help:
foo = test :: Test a => a
However, adding an instance of Test does make it compile:
instance Test Int where
test = 0
This isn't really acceptable, as I want my instances declared elsewhere.
Finally, passing -XNoMonomorphismRestriction
to ghc(i) also allows it to compile. While this is good enough for now, I don't understand what this extension does, why it is necessary, or what downsides may be lurking.