# Pastebin D5CfI3xJ {-# LANGUAGE AllowAmbiguousTypes #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeApplications #-} import Data.Proxy data Alice class C x where silly :: String instance C Alice where silly = "Silly Alice" data Foo where Foo :: C a => Proxy a -> Foo f :: Foo -> String f foo = case foo of Foo (Proxy :: Proxy a) -> silly @a