# Pastebin 2JZN7jmT {-# LANGUAGE AllowAmbiguousTypes #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeApplications #-} import Data.Proxy import Data.Constraint data Alice class C x where silly :: String instance C Alice where silly = "Silly Alice" data Foo where Foo :: Dict (C a) -> Foo f :: Foo -> String f (Foo (dict :: Dict (C a))) = withDict dict $ silly @a