[GHC] #11416: GHC mistakenly believes datatype with type synonym in its type can't be eta-reduced

GHC ghc-devs at haskell.org
Mon Feb 15 16:55:43 UTC 2016


#11416: GHC mistakenly believes datatype with type synonym in its type can't be
eta-reduced
-------------------------------------+-------------------------------------
        Reporter:  RyanGlScott       |                Owner:
            Type:  bug               |               Status:  closed
        Priority:  normal            |            Milestone:  8.0.1
       Component:  Compiler (Type    |              Version:  8.0.1-rc1
  checker)                           |
      Resolution:  fixed             |             Keywords:  TypeInType
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  GHC rejects       |  Unknown/Multiple
  valid program                      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):  Phab:D1772
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by simonpj):

 Maybe. If you type it in manually you'll get a spuriously polymorphic
 instance, which will result in some uses of `Any`. I think the same will
 happen if you allow this data instance.  Perhaps it's no more than using
 `exactTyCoVarsofType` in `eta_reduce` in `tcDataFamInstDecl`.

 You'd need to make sure you quantify over the tyvar anyway; but I think
 that will happen.

 I don't feel strongly. It would be good to document it.

 Crumbs if I had a pound for every hour I've spent on
 `GeneralisedNewtypeDeriving` I'd be a rich man.

 Thanks for digging into this

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


More information about the ghc-tickets mailing list