class Foo a where foo :: a -> a bar :: Foo a => a -> abar x = foo a instance Foo Int where foo x = x + 1 main = do let x = 1 :: Int print (bar x)
Standard input is empty
[1 of 1] Compiling Main ( prog.hs, prog.o ) prog.hs:5:12: Not in scope: `a'
Standard output is empty
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!