[GHC] #10653: PatternSynonyms should be imported/exported as part of the wildcard notation

GHC ghc-devs at haskell.org
Sun Sep 20 03:27:13 UTC 2015


#10653: PatternSynonyms should be imported/exported as part of the wildcard
notation
-------------------------------------+-------------------------------------
        Reporter:  gridaphobe        |                   Owner:  mpickering
            Type:  feature request   |                  Status:  new
        Priority:  high              |               Milestone:  8.0.1
       Component:  Compiler          |                 Version:  7.11
      Resolution:                    |                Keywords:
                                     |  PatternSynonyms, pattern synonyms
Operating System:  Unknown/Multiple  |            Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |               Test Case:
      Blocked By:                    |                Blocking:
 Related Tickets:                    |  Differential Revisions:
-------------------------------------+-------------------------------------

Comment (by gridaphobe):

 > A possible restriction might be that you can only add P to an export of
 a data type T if P's type has form ... -> T t1 ..tn.

 I also prefer having this restriction.

 >Richard is right that I removed it because I thought there was some worry
 that the typechecker would have to get involved but if he says not then I
 think it's a good idea.

 As I recall, I had previously suggested that `T(..)` export '''every'''
 pattern with a type whose result is headed by `T`, which would have
 required running the typechecker just to determine which things `T(..)`
 refers to. This, I believe, is what was really concerning Simon.

 If on the other hand, the export list has to '''explicitly''' name
 patterns to associate with `T`, then we can do a simple validity/sanity
 check during typechecking, as Richard says.

 Thanks for forging ahead with this ticket Matthew!

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


More information about the ghc-tickets mailing list