Confusing error message when illegally using `forall` in type signature.
with -XNoExplicitForAll
and the snippet
my_id :: forall a. a -> a
my_id x = x
ghc throws an error and suggests the following:
Perhaps you intended to use RankNTypes
or a similar language extension to enable explicit-forall syntax: forall <tvs>. <type>
this seems entirely wrong to me, because the extension for enabling this syntax is -XExplicitForAll
which could be suggested here. RankNTypes
implies ExplicitForAll
, but you get the same error message if you attempt to compile the above with -XRankNTypes -XNoExplicitForAll
.
In my opinion the error message should instead say:
Perhaps you intended to use the ExplicitForAll language extension
to enable explicit-forall syntax: forall <tvs>. <type>