Skip to content

Suggest adding Proxy in ambiguous type error message

Krzysztof Gogolewski requested to merge wip/ambiguous-err-msg into master

The error message for an ambiguous type suggests enabling AllowAmbiguousTypes. However, this forces users to rely on TypeApplications and in some cases it's not enough (https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/ambiguous_types.html)

This adds a suggestion to use Proxy. There's a larger accepted GHC proposal but at least this is an incremental step.

Minor cleanup: there's no point in checking allow_ambiguous in the message, since it is used inside of an unless allow_ambiguous block.

Edited by Krzysztof Gogolewski

Merge request reports