Closed sjakobi closed 6 years ago
I think this is simply due to the use of pprExport
in pprModIface
:
{-
When printing export lists, we print like this:
Avail f f
AvailTC C [C, x, y] C(x,y)
AvailTC C [x, y] C!(x,y) -- Exporting x, y but not C
-}
pprExport :: IfaceExport -> SDoc
pprExport (Avail n) = ppr n
pprExport (AvailTC _ [] []) = Outputable.empty
pprExport (AvailTC n ns0 fs)
= case ns0 of
(n':ns) | n==n' -> ppr n <> pp_export ns fs
_ -> ppr n <> vbar <> pp_export ns0 fs
where
pp_export [] [] = Outputable.empty
pp_export names fs = braces (hsep (map ppr names ++ map (ppr . flLabel) fs))
(Note the apparently outdated comment)
As I was wondering whether the format of the export list is unambiguous: It is!
In the case of
class C m where
f :: m ()
g :: m ()
We get Lib.C{Lib.f Lib.g}
if C
is exported, Lib.C|{Lib.f Lib.g}
otherwise.
In the case of data types like Maybe
there seems to be no way of exporting any constructors without the type constructor.
The strange bit is that
Maybe
is listed in the exports aswhile docs_structure lists it as
Is the re-export of the
Maybe
type constructor implicit in the export list?