[GHC] #8582: Record syntax for pattern synonyms
GHC
ghc-devs at haskell.org
Fri Oct 2 11:37:59 UTC 2015
#8582: Record syntax for pattern synonyms
-------------------------------------+-------------------------------------
Reporter: cactus | Owner: mpickering
Type: feature request | Status: new
Priority: high | Milestone: 8.0.1
Component: Compiler | Version:
Resolution: | Keywords:
| PatternSynonyms
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: 5144 | Blocking:
Related Tickets: | Differential Rev(s): Phab:D1152
-------------------------------------+-------------------------------------
Comment (by mpickering):
Simon, I didn't want to write an explicit specification for this patch
because it would amount to copying the specification for records.
Which bit did you find confusing in the example I gave? In retrospect, the
phrase "relevant data constructor" is confusing. So to explain, by
"relevant" I mean an isomorphic (normally defined) data constructor. Does
the example not make this any clearer?
The problem with the implementation is with the record updates. Pattern
synonym builders have required constraints which normal data constructors
don't have. When the record update is desugared, it is necessary to
provide the dictionaries for these constraints to the builder. My question
was, how was I meant to do this. I ended up adding a field to the
RecordUpd constructor which carried around the HsWrapper which then
applied the dictionaries. More details are to be found in the last comment
on the phab ticket.
I don't have much time anymore to work on this ticket but I would be very
disappointed it if did make it into GHC 8.0 as I started working on it
several months ago.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8582#comment:15>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list