fork download
  1. class Foo a where
  2. foo :: a -> a
  3.  
  4. bar :: Foo a => a -> a
  5. bar a = foo a
  6.  
  7. instance Foo Int where
  8. foo x = x + 1
  9.  
  10. main = do
  11. let x = 1 :: Int
  12. print (bar x)
Success #stdin #stdout 0.02s 3580KB
stdin
Standard input is empty
stdout
2