{-# LANGUAGE FunctionalDependencies #-} import Data.Proxy main :: IO () main = pure () type MyTuple a b = (b, a) class Foo a b | a -> b where something :: a -> (Int, Proxy b) instance Foo (MyTuple a Int) a where something (n, _) = (n, Proxy @a)