#7409: Document special "this" module name for PackageImports extension
------------------------------+---------------------------------------------
Reporter:  hvr                |          Owner:  simonmar        
    Type:  bug                |         Status:  new             
Priority:  normal             |      Component:  Compiler        
 Version:  7.6.1              |       Keywords:                  
      Os:  Unknown/Multiple   |   Architecture:  Unknown/Multiple
 Failure:  Documentation bug  |      Blockedby:                  
Blocking:                     |        Related:                  
------------------------------+---------------------------------------------
 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
 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
 }}}

  1.
 https://github.com/ghc/ghc/commit/436a5fdbe0c9a466569abf1d501a6018aaa3e49e
  2. http://www.haskell.org/ghc/docs/latest/html/users_guide/syntax-
 extns.html#package-imports

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/7409>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to