I noticed that I don't know how to make GHCi print info about composite type. Let's consider example
data X a = X (a Int)
type XList = X []
instance Show XList where show (X l) = "X (" ++ show l ++ ")"
I would like to see some how that "X []" implements Show.
Attempt 1
λ :i (X [])
<interactive>:1:2: error: parse error on input ‘X’
Attempt 2 - prints instances for list but not (X [])
λ :i X []
Attempt 3 - nothing about instances
λ :i XList
type XList = X [] -- Defined at <interactive>:20:1
Nonetheless Show instance is working when it is applicable
λ show (X [1,2,3])
"X ([1,2,3])"
λ show (X ['1'])
<interactive>:31:18: error:
• Couldn't match expected type ‘Int’ with actual type ‘Char’