Re-export data family when exporting a data instance without an export list
authorDavid Kraeutmann <kane@kane.cx>
Mon, 7 Dec 2015 10:19:28 +0000 (11:19 +0100)
committerBen Gamari <ben@smart-cactus.org>
Mon, 7 Dec 2015 10:20:57 +0000 (11:20 +0100)
commit8cef8af3286f3c98f2a02e65371b875d8791b687
tree98dbb8851c8496d1266d7a91625026ecd314de53
parent3d55e41e72dc32281744c52afea380c1db577ee1
Re-export data family when exporting a data instance without an export list

Whenever a data instance is exported, the corresponding data family
is exported, too. This allows one to write

```
     -- Foo.hs
     module Foo where

     data family T a

     -- Bar.hs
     module Bar where

     import Foo

     data instance T Int = MkT

     -- Baz.hs
     module Baz where

     import Bar (T(MkT))
```

In previous versions of GHC, this required a workaround
explicit export list in `Bar`.

Reviewers: bgamari, goldfire, austin

Reviewed By: bgamari, goldfire

Subscribers: goldfire, thomie

Differential Revision: https://phabricator.haskell.org/D1573

GHC Trac Issues: #11164
compiler/rename/RnNames.hs
docs/users_guide/7.12.1-notes.rst
docs/users_guide/glasgow_exts.rst
testsuite/tests/ghci/scripts/T5417.stdout
testsuite/tests/indexed-types/should_fail/Over.stderr
testsuite/tests/rename/should_compile/T11164.hs [new file with mode: 0644]
testsuite/tests/rename/should_compile/T11164a.hs [new file with mode: 0644]
testsuite/tests/rename/should_compile/T11164b.hs [new file with mode: 0644]
testsuite/tests/rename/should_compile/all.T