[GHC] #10644: Option GADTs specialises a polymorphic value in local bindings

GHC ghc-devs at haskell.org
Wed Jul 15 22:18:28 UTC 2015


#10644: Option GADTs specialises a polymorphic value in local bindings
-------------------------------------+-------------------------------------
        Reporter:  bales             |                   Owner:
            Type:  bug               |                  Status:  closed
        Priority:  normal            |               Milestone:
       Component:  Compiler          |                 Version:  7.10.1
      Resolution:  invalid           |                Keywords:
Operating System:  Linux             |            Architecture:  x86_64
 Type of failure:  GHC rejects       |  (amd64)
  valid program                      |               Test Case:
      Blocked By:                    |                Blocking:
 Related Tickets:                    |  Differential Revisions:
-------------------------------------+-------------------------------------
Changes (by simonpj):

 * status:  new => closed
 * resolution:   => invalid


Comment:

 This is just a consequence of `MonoLocalBinds`, as specified in
 [https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/other-
 type-extensions.html#mono-local-binds 7.13.9.3 of the user manual].  GADTs
 switches on `MonoLocalBinds`, so the definition of `p` is not generalised,
 and that in turn leads to the error you encountered.

 You might reasonably think that GADTs have nothing do to with
 generalisation, but alas they do, as the papers mentioned in the manual
 describe.

 I'm not saying it's brilliant behaviour, just that I don't know how to do
 better.

 Simon

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


More information about the ghc-tickets mailing list