blob: e79817d5cb7abefd87f5e3bb2256a68048e2da07 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
module Main where
class C a where
op :: (Show a, Show b) => a -> b -> String
-- This class op has local quantification, but
-- also adds a constraint on 'a'
instance C Bool where
op x y = show x ++ " " ++ show y
main = do { putStrLn (op True 'x'); putStrLn (op False (3::Int)) }
|