[GHC] #11646: Make pattern synonym export type mismatch a warning

GHC ghc-devs at haskell.org
Thu Aug 11 07:24:14 UTC 2016


#11646: Make pattern synonym export type mismatch a warning
-------------------------------------+-------------------------------------
        Reporter:  dfeuer            |                Owner:
            Type:  feature request   |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler (Type    |              Version:  8.0.1-rc2
  checker)                           |             Keywords:
      Resolution:                    |  PatternSynonyms
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  GHC rejects       |  Unknown/Multiple
  valid program                      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
  PatternSynonyms/AssociatingSynonyms|
-------------------------------------+-------------------------------------

Comment (by simonpj):

 So to be concrete, you want to allow this:
 {{{
 module M( Maybe( Nothing, Just, P ) ) where

 pattern P x = [x, True]
 }}}
 So now an importing module can import `Maybe(..)` and will get two data
 constructors for `Maybe` and one for lists.

 I agree that there is nothing unsound about this, just a bit unexpected.
 I'd be perfectly OK with issuing a warning rather than an error.

 But doing anything at all requires ''some'' work from someone.  And it may
 well be that someone then pops up to say "it really really should be an
 error".   So a compelling use-case or two, and evidence of interest from
 other users would help.  Does anyone else have an opinion.

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


More information about the ghc-tickets mailing list