{-# LANGUAGE GADTs #-}
{-# LANGUAGE RankNTypes #-}
data T k where
A :: Eq k => T k
g :: T k -> (Eq k => a) -> a
g A = id
f :: T k -> k -> k -> Bool
f tt x y = g tt (x == y)
main :: IO ()
main = do
print $ f (A :: T Int) 1 2
print $ f (A :: T Bool) True False