It seems impossible to introspect class type restrictions on functions and data types, etc. However, ghci seems to be doing this.
Prelude> :t show show :: (Show a) => a -> String
So ... somehow he knows the class type constraint, since it prints it. How it's done?
haskell introspection typeclass ghci
mentics
source share