[GHC] #13307: Record pattern synonym fields have to be manually exported

GHC ghc-devs at haskell.org
Mon Feb 20 15:03:45 UTC 2017


#13307: Record pattern synonym fields have to be manually exported
-------------------------------------+-------------------------------------
        Reporter:  ocharles          |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.0.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):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by ocharles):

 Specifically, I only want to export the type of the newtype (`T`), and the
 pattern synonym `MkT2`. The "real" constructor `MkT` for the newtype is
 internal to the module and not exported. In my actual work, `Impl` is a
 record with ~10 fields, and I want to have a `newtype` over `Impl` that
 looks like a record with 10 fields, though they will have different names
 (proxying to the underlying fields in `Impl`). So yes, what Simon comments
 with is indeed what I would like to be able to do (though I wouldn't
 export `MkT`).

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


More information about the ghc-tickets mailing list