newtype T1 = T1 {unT1 :: String} newtype T2 = T2 {unT2 :: String} f :: a -> a -> () f = undefined g = f (T1 "S1") (T1 "S2") h = f (T1 "S2") (T2 "S2")