6.3.1. Hiding things the imported module doesn’t export¶
Technically in Haskell 2010 this is illegal:
module A( f ) where
f = True
module B where
import A hiding( g ) -- A does not export g
g = f
The import A hiding( g )
in module B
is technically an error
(Haskell Report,
5.3.1)
because A
does not export g
. However GHC allows it, in the
interests of supporting backward compatibility; for example, a newer
version of A
might export g
, and you want B
to work in
either case.
The warning -Wdodgy-imports
, which is off by default but included
with -W
, warns if you hide something that the imported module does
not export.