Document special "this" module name for PackageImports extension
Migrated from http://comments.gmane.org/gmane.comp.lang.haskell.glasgow.user/22794:
I just found out that in combination with the PackageImports extension there's a special module name "this" which according to (1.) always refers to the current package. But I couldn't find this rather useful feature mentioned in the GHC 7.6.1 Manual PackageImports section(2.).
A simple addition to the documentation such as the example below would be helpful:
diff --git a/docs/users_guide/glasgow_exts.xml b/docs/users_guide/glasgow_exts.xml
index 541b309..5508c23 100644
--- a/docs/users_guide/glasgow_exts.xml
+++ b/docs/users_guide/glasgow_exts.xml
@@ -1999,6 +1999,9 @@ import "network" Network.Socket
available from multiple packages, or is present in both the
current package being built and an external package.</para>
+ <para>The special package name <literal>this</literal> can be used to
+ refer to the current package being built.</para>
+
<para>Note: you probably don't need to use this feature, it was
added mainly so that we can build backwards-compatible versions of
packages when APIs change. It can lead to fragile dependencies in
- https://github.com/ghc/ghc/commit/436a5fdbe0c9a466569abf1d501a6018aaa3e49e
- http://www.haskell.org/ghc/docs/latest/html/users_guide/syntax-extns.html#package-imports
Trac metadata
Trac field | Value |
---|---|
Version | 7.6.1 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |