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

GHC ghc-devs at haskell.org
Mon Sep 28 07:49:33 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 Rev(s):  Phab:D1258
-------------------------------------+-------------------------------------

Comment (by simonpj):

 I've added a pointer to the new specification page to the ticket
 Description.

 Personally I think we should Keep It Simple.  All this talk of
 satisfiability makes me shiver.  I suggest this: allow T( P ) in all
 situations except where `P`'s type is ''visibly incompatible'' with `T`.

 What does "visibly incompatible" mean?  `P` is visibly incompatible with
 `T` if
  * `P`'s type is of form `... -> S t1 t2`
  * `S` is a data/newtype constructor distinct from `T`

 Nothing harmful happens if we allow `P` to be exported with a type it
 can't possibly be useful for, but specifying a tighter relationship is
 very awkward as you have discovered.

 BTW, you'd better say that `T( P )` is ''not'' ok if `T` is a type
 synonym.

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


More information about the ghc-tickets mailing list