[GHC] #11164: No way to import a data instance

GHC ghc-devs at haskell.org
Mon Dec 7 11:14:34 UTC 2015


#11164: No way to import a data instance
-------------------------------------+-------------------------------------
        Reporter:  Feuerbach         |                Owner:  kanetw
            Type:  bug               |               Status:  patch
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  7.10.2
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):  phab:D1573
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by Ben Gamari <ben@…>):

 In [changeset:"8cef8af3286f3c98f2a02e65371b875d8791b687/ghc"
 8cef8af3/ghc]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="8cef8af3286f3c98f2a02e65371b875d8791b687"
 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
 }}}

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11164#comment:8>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list