Skip to content

Improve error for when an expression cannot have visible type arguments

Currently the error for trying to use visible type arguments for a binding without signature looks like this:

ghci> f x y = show x ++ y
ghci> :t f @Int
<interactive>:1:1: error: [GHC-95781]
     Cannot apply expression of type a0 -> [Char] -> [Char]
      to a visible type argument Int
     In the expression: f @Int

It would be better if the error

  1. Explained why the visible type argument can't be applied (explanation in the user guide)
  2. Suggested adding a signature
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information