[GHC] #12006: Can't infer constraint of pattern synonyms

GHC ghc-devs at haskell.org
Mon May 2 22:47:27 UTC 2016


#12006: Can't infer constraint of pattern synonyms
-------------------------------------+-------------------------------------
           Reporter:  Iceland_jack   |             Owner:
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  8.1
           Keywords:  TypeSynonyms   |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 Can't infer constraint of:

 {{{#!hs
 -- pattern Real' :: Num a => a -> Complex a
 pattern Real' r <- r :+ _
   where Real' r =  r :+ 0
 }}}

 {{{
 teR4.hs:12:25: error: …
     • No instance for (Num t) arising from the literal ‘0’
       Possible fix:
         add (Num t) to the context of
           the type signature for:
             Main.$bReal' :: t -> Complex t
     • In the second argument of ‘(:+)’, namely ‘0’
       In the expression: r :+ 0
       In an equation for ‘$bReal'’: $bReal' r = r :+ 0
 Compilation failed.
 }}}

 Should it be able to?

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


More information about the ghc-tickets mailing list