1 {-# LANGUAGE ConstrainedClassMethods #-}
6 op
:: (Show a
, Show b
) => a
-> b
-> String
7 -- This class op adds a constraint on 'a'
9 -- In GHC 7.0 this is fine, and it's a royal
10 -- pain to reject it when in H98 mode, so
11 -- I'm just allowing it
14 op x y
= show x
++ " " ++ show y
16 main
= print (op
(1::Int) 2)