blob: 2479ed75c855131c8eb97e5695c735d66da38ad1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
module Main where
class C a where
op :: (Show a, Show b) => a -> b -> String
-- This class op adds a constraint on 'a'
-- In GHC 7.0 this is fine, and it's a royal
-- pain to reject it when in H98 mode, so
-- I'm just allowing it
instance C Int where
op x y = show x ++ " " ++ show y
main = print (op (1::Int) 2)
|