> 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)
> --------------------------------------------------------
> 
> the type Ding itself is not visible within Bar, but its constructor
> MakeDing is. Consequently one can't give a signature for
> 
>    ding = MakeDing 123
> 
> in Bar (the exact opposite of an abstract type? :-).

Well, hiding is a kind of inverse operation, isn't it?

> 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.

Simon



Reply via email to