[GHC] #12224: Replace placeHolderPunRhs with a PlaceHolder value

GHC ghc-devs at haskell.org
Sun Nov 6 16:56:51 UTC 2016


#12224: Replace placeHolderPunRhs with a PlaceHolder value
-------------------------------------+-------------------------------------
        Reporter:  alanz             |                Owner:  alanz
            Type:  task              |               Status:  new
        Priority:  normal            |            Milestone:  8.2.1
       Component:  Compiler          |              Version:  8.0.1
  (Parser)                           |
      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 alanz):

 I tried that, but get

 {{{
 compiler/hsSyn/HsPat.hs:331:57:
     Couldn't match expected type ‘PostRn id b’ with actual type ‘b’
       ‘b’ is a rigid type variable bound by
           the type signature for
             fmap :: (a -> b) -> HsRecField' id lbl a -> HsRecField' id lbl
 b
           at compiler/hsSyn/HsPat.hs:331:3
     Relevant bindings include
       a :: PostRn id a (bound at compiler/hsSyn/HsPat.hs:331:25)
       f :: a -> b (bound at compiler/hsSyn/HsPat.hs:331:8)
       fmap :: (a -> b) -> HsRecField' id lbl a -> HsRecField' id lbl b
         (bound at compiler/hsSyn/HsPat.hs:331:3)
     In the second argument of ‘HsRecField’, namely ‘(f a)’
     In the expression: HsRecField ln (f a) p
 }}}

 I had to bring in an `id` separate from the `lbl` to get the `Data`
 instances to come out.

 My interpretation of the error message is that it is impossible to define
 `fmap` for this type.

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


More information about the ghc-tickets mailing list