
#14331: Overzealous free-floating kind check causes deriving clause to be rejected -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: (none) Type: bug | Status: merge Priority: normal | Milestone: 8.2.2 Component: Compiler (Type | Version: 8.2.1 checker) | Resolution: | Keywords: deriving Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: GHC rejects | Test Case: valid program | deriving/should_compile/T14331 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by RyanGlScott): Replying to [comment:29 goldfire]:
I do think it's worth asking if anyone ever really needs variables shared between the data decl and the `deriving` (Simon's last point in comment:28).
We certainly do. Here's an example from #3955: {{{#!hs newtype T a x = T (Reader a x) deriving (Monad, MonadReader a) }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14331#comment:30 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler