Simon Peyton-Jones wrote:
I wrote:
I'm totally
confused. What does
module M1(module M2)
import M2 hiding (H)
...
exactly mean?
The intention is this: M1 exports everything that M1 imports from M2.
Since H is not imported, it should not be exported either. It does
OK, then I'll rephrase my question: What's the rationale of throwing
different namespaces together in the hiding clause?
Maybe they shouldn't be -- but if not, then
hiding( Ding )
would hide a type constructor or class Ding, but not a constructor Ding,
which is arguably odd. But
Simon Peyton-Jones wrote:
I wrote:
Another question: What is visible in Bar when the name of MakeDing
is changed to Ding, too?
Discussed explicitly on page 66 (item 2 in Section 5.3). The
constructor is hidden too.
OK, then I'll rephrase my question: What's the rationale of throwing
The strange thing about this part of Haskell 98 is that given
-- Baz.hs --
module Baz where
newtype Ding = MakeDing Int
-- Bar.hs --
module Bar(module Baz) where
import Baz hiding (Ding)
After some experiments and a look into the Haskell 98 report I'm totally
confused. What does
module M1(module M2)
import M2 hiding (H)
...
exactly mean? GHC's and Hugs' behaviour in different cases is
inconsistent, and the report is unclear. So here are the tests:
The module Baz stays