[GHC] #12001: RFC: Add pattern synonyms to base

GHC ghc-devs at haskell.org
Thu Oct 27 05:57:02 UTC 2016


#12001: RFC: Add pattern synonyms to base
-------------------------------------+-------------------------------------
        Reporter:  Iceland_jack      |                Owner:
            Type:  feature request   |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  libraries/base    |              Version:  7.10.3
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by Iceland_jack):

 See #12767:

 {{{#!hs
 pattern Cont :: ((a -> r) -> r) -> Cont r a
 pattern Cont a <- (runCont -> a)
   where Cont a = cont a

 pattern Writer :: (a, w) -> Writer w a
 pattern Writer a <- (runWriter -> a)
   where Writer a = WriterT (Identity a)

 pattern Reader :: (r -> a) -> Reader r a
 pattern Reader a <- (runReader -> a)
   where Reader a = reader a

 pattern State :: (s -> (a, s)) -> State s a
 pattern State a <- (runState -> a)
   where State a = state a
 }}}

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


More information about the ghc-tickets mailing list