error-messages
error-messages copied to clipboard
`TypeApplications` not suggested when used with function arrow `->`
GHCi, version 8.10.7: https://www.haskell.org/ghc/ :? for help
Prelude> :t fmap @(Either _)
<interactive>:1:1: error:
Pattern syntax in expression context: fmap@(Either _)
Did you mean to enable TypeApplications?
Prelude> :t fmap @((->) _)
<interactive>:1:9: error: parse error on input ‘->’
Enabling -XTypeOperators doesn't help either.
This one will be hard to fix, sadly. The problem is that, without -XTypeApplications, GHC is still parsing a term when it sees the (->). I think the way forward would be to allow GHC to parse the (->) syntax in a term, only to then reject it after the parser. But maybe that's not so bad? Perhaps someone wants to have a go at editing the parser in this way? I don't think it would be difficult.