[GHC] #13324: Allow PartialTypeSignatures in the instance context of a standalone deriving declaration

GHC ghc-devs at haskell.org
Thu Mar 16 15:59:27 UTC 2017


#13324: Allow PartialTypeSignatures in the instance context of a standalone
deriving declaration
-------------------------------------+-------------------------------------
        Reporter:  RyanGlScott       |                Owner:  (none)
            Type:  feature request   |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler (Type    |              Version:  8.0.1
  checker)                           |
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #10607            |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by RyanGlScott):

 bgamari, yes, I believe #8510 is what you are looking for. I don't think
 that implementing this feature would be that difficult, either, since:

 1. We already have a `Extension` datatype for representing all GHC
 extensions
 2. The GHC API already has `setXOptM`/`unsetXOptM` for enabling/disabling
 `Extensions` within the scope of some computation

 So I think we'd just need a Template Haskell function `qWithExtensions ::
 Quasi m => [OnOff Extension] -> m a -> m a` that enabled/disables whatever
 the user provides. Then libraries like `deriveTopDown` could just use
 `qWithExtensions [On PartialTypeSignatures]` to wrap any splices that
 contain wildcard types.

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


More information about the ghc-tickets mailing list