[GHC] #12767: Pattern synonyms for Cont, Writer, Reader, State, ...

GHC ghc-devs at haskell.org
Sun Nov 20 18:34:01 UTC 2016


#12767: Pattern synonyms for Cont, Writer, Reader, State, ...
-------------------------------------+-------------------------------------
        Reporter:  Iceland_jack      |                Owner:
            Type:  feature request   |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Core Libraries    |              Version:  8.0.1
      Resolution:                    |             Keywords:
                                     |  PatternSynonyms
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #12001            |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by Iceland_jack):

 Started a
 [https://mail.haskell.org/pipermail/libraries/2016-November/027442.html
 discussion] on the library mailing list.

 See #12857 for associating pattern synonyms with a type synonym:

 {{{#!hs
 module State ( State (State, runState) ) where

 ...

 type State s = StateT s Identity

 pattern State { runState } <- ((runIdentity .) . runStateT -> runState)
   where State runState      = StateT (Identity . runState)
 }}}

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


More information about the ghc-tickets mailing list