[GHC] #8581: Pattern synonym used in an expression context could have different constraints to pattern used in a pattern context

GHC ghc-devs at haskell.org
Fri Dec 18 20:23:59 UTC 2015


#8581: Pattern synonym used in an expression context could have different
constraints to pattern used in a pattern context
-------------------------------------+-------------------------------------
        Reporter:  cactus            |                Owner:
            Type:  feature request   |               Status:  new
        Priority:  normal            |            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:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------
Description changed by mpickering:

Old description:

> > The two directions of an explicitly-bidirectional pattern might have
> utterly different class constraints. After all, the two directions are
> specified by quite different code. Suppose that
>
> > * Pattern `P` (used in a pattern) requires constraints `CR`, and
> provides constraints `CP`
> > * Constructor `P` (used in an expression) requires constraints `CE`
> >
> > Then I think the only required relationship is this: `CP` must be
> provable from `CE` (since CP is packaged up in a P-object).
>
> Currently, `CE := CP + CR.

New description:

 > The two directions of an explicitly-bidirectional pattern might have
 utterly different class constraints. After all, the two directions are
 specified by quite different code. Suppose that
 >
 > * Pattern `P` (used in a pattern) requires constraints `CR`, and
 provides constraints `CP`
 > * Constructor `P` (used in an expression) requires constraints `CE`
 >
 > Then I think the only required relationship is this: `CP` must be
 provable from `CE` (since CP is packaged up in a P-object).

 Currently, `CE := CP + CR`.

--

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


More information about the ghc-tickets mailing list