[GHC] #14112: bang patterns on pattern synonyms? (left vs right hand sides)

GHC ghc-devs at haskell.org
Mon Aug 14 00:41:19 UTC 2017


#14112: bang patterns on pattern synonyms? (left vs right hand sides)
-------------------------------------+-------------------------------------
           Reporter:  carter         |             Owner:  (none)
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  8.2.1
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 I'm trying to define my own fancy strict maybe types, and so i've written
 some pattern synonyms to wrap them up.

 imagine my surprise when i find i can write bang patterns on the *right*
 hand side, but not the left hand!

 {{{
 data MyMaybe a = JustC a | NothingC

 pattern MyJust :: a -> MyMaybe a
 -- pattern MyJust !a = JustC a -- this fails
 pattern MyJust a = JustC !a -- this is fine
 }}}

 is this deliberate or a leakage of how desugaring works?

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


More information about the ghc-tickets mailing list