Suggest use of ExplicitNamespaces when importing type operator
The following import
import GHC.TypeLits ((+))
gives rise to the error:
Module ‘GHC.TypeLits’ does not export ‘(+)’
which is patently false. What it means is "does not export ‘(+)’ as a term-level operator (though it might as a type)".
Per #9146 (closed) the correct way to write this import is using ExplicitNamespaces
:
import GHC.TypeLits (type (+))
This isn't at all obvious from the error message, however. It would be nice if GHC suggested this in the error message, e.g. with something like the following when there is a type-level export with the same name:
Module ‘GHC.TypeLits’ does not export ‘(+)’ at the term level.
Import ‘type (+)’ (using the ExplicitNamespaces extension) if you
intended to import the type-level operator.