[GHC] #8584: Pattern synonym type signatures

GHC ghc-devs at haskell.org
Fri Oct 10 11:22:02 UTC 2014


#8584: Pattern synonym type signatures
-------------------------------------+-------------------------------------
              Reporter:  cactus      |            Owner:  cactus
                  Type:  feature     |           Status:  new
  request                            |        Milestone:  7.10.1
              Priority:  normal      |          Version:
             Component:  Compiler    |         Keywords:  pattern synonyms
  (Type checker)                     |     Architecture:  Unknown/Multiple
            Resolution:              |       Difficulty:  Unknown
      Operating System:              |       Blocked By:  5144
  Unknown/Multiple                   |  Related Tickets:  8581
       Type of failure:              |
  None/Unknown                       |
             Test Case:              |
              Blocking:  8968        |
Differential Revisions:              |
-------------------------------------+-------------------------------------
Description changed by simonpj:

Old description:

> Currently, the only way to specify a type signature for a pattern synonym
> is by adding type annotations to the right-hand side, like this:
>
> {{{
> {-# LANGUAGE PatternSynonyms, ScopedTypeVariables #-}
>
> pattern Single x = ([x] :: [Int])
> }}}
>
> Bespoke syntax for adding type signatures for pattern synonyms would
> probably be useful.

New description:

 Currently, the only way to specify a type signature for a pattern synonym
 is by adding type annotations to the right-hand side, like this:

 {{{
 {-# LANGUAGE PatternSynonyms, ScopedTypeVariables #-}

 pattern Single x = ([x] :: [Int])
 }}}

 Bespoke syntax for adding type signatures for pattern synonyms would
 probably be useful.

 Link to [wiki:PatternSynonyms] for pattern synonym signatures for
 specification.

--

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


More information about the ghc-tickets mailing list