diff options
author | Edward Z. Yang <ezyang@cs.stanford.edu> | 2014-08-01 18:03:20 +0100 |
---|---|---|
committer | Edward Z. Yang <ezyang@cs.stanford.edu> | 2014-08-05 03:13:27 -0700 |
commit | 00b8f8c5b378fc679639ebe81238cf42d92aa607 (patch) | |
tree | 5679db0a3cfcb74bde35c2c9a01cc56a5774c6e5 /utils | |
parent | de3f0644b8ff1748335c0fe07404dd4502a624e0 (diff) | |
download | haskell-00b8f8c5b378fc679639ebe81238cf42d92aa607.tar.gz |
Refactor package state, also fixing a module reexport bug.
Instead of building a multiply indirected data structure and querying
it on every import, we now have two data structures moduleToPkgConf
and moduleToPkgConfAll. moduleToPkgConf is a single-level UniqFM that
is intended to be used for most valid imports; however, it does not
contain any information useful for error reporting. If an error is
occurred, we then query moduleToPkgConfAll, which contains a more
comprehensive view of the package database. This field is lazily
initialized (so this means we're retaining the package database list,
but this should be fine because we're already maintaining the entries
of the list.) Additionally, the full view doesn't keep track of a boolean
toggle for visibility/exposure anymore, but instead tracks the *provenance*
of how the module binding came to be (the ModuleOrigin data type).
Additionally, we move the logic for determining if a module is exposed
or not from Finder.lhs and put it in Packages.lhs; this information is
communicated via the LookupResult data type. Unfortunately, we can't
directly return a FindResult, because this data type is defined in
HscTypes which depends on Packages. This is going to change some more
in the near future when I add thinning/renaming to package flags; the
error messages will need to be more flexible.
I've also slightly changed the semantics of error messages for package
qualified imports. Previously, if we didn't find any package qualified
imports, but there were hidden modules in a *different* package, the error
message would prefer mentioning those as opposed to providing suggestions.
Now, if a module is hidden but in the wrong package, we won't mention it;
instead, it will get mentioned with the other module suggestions. I
was too lazy to write a test, but I can add one if people would like.
The module reexport bug was, package q reexported p:P as Conflict,
and package r reexported p:P2 as Conflict, this was *not* reported as
a conflict, because the old logic incorrectly decided that P and P2 were
the same module on account of being from the same package. The logic here
has been corrected.
Contains haddock submodule update.
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Diffstat (limited to 'utils')
m--------- | utils/haddock | 0 |
1 files changed, 0 insertions, 0 deletions
diff --git a/utils/haddock b/utils/haddock -Subproject b99b57c0df072d12b67816b45eca2a03cb1da96 +Subproject d59fec2c9551b5662a3507c0011e32a09a9c118 |