class A a where f :: a class A a => B a where g :: a f = g instance B Int where g = 42 main = print (f :: Int)
Standard input is empty
[1 of 1] Compiling Main ( prog.hs, prog.o ) prog.hs:6:3: `f' is not a (visible) method of class `B'
Standard output is empty
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!