[GHC] #14728: Is (GeneralizedNewtypeDeriving + associated type classes) completely bogus?
GHC
ghc-devs at haskell.org
Sun Feb 18 16:59:53 UTC 2018
#14728: Is (GeneralizedNewtypeDeriving + associated type classes) completely bogus?
-------------------------------------+-------------------------------------
Reporter: RyanGlScott | Owner: (none)
Type: bug | Status: merge
Priority: normal | Milestone: 8.4.1
Component: Compiler (Type | Version: 8.2.2
checker) | Keywords: deriving,
Resolution: | TypeFamilies
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s): Phab:D4402
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Ben Gamari <ben@…>):
In [changeset:"1ede46d415757f53af33bc6672bd9d3fba7f205d/ghc"
1ede46d4/ghc]:
{{{
#!CommitTicketReference repository="ghc"
revision="1ede46d415757f53af33bc6672bd9d3fba7f205d"
Implement stopgap solution for #14728
It turns out that one can produce ill-formed Core by
combining `GeneralizedNewtypeDeriving`, `TypeInType`, and
`TypeFamilies`, as demonstrated in #14728. The root of the problem
is allowing the last parameter of a class to appear in a //kind// of
an associated type family, as our current approach to deriving
associated type family instances simply doesn't work well for that
situation.
Although it might be possible to properly implement this feature
today (see https://ghc.haskell.org/trac/ghc/ticket/14728#comment:3
for a sketch of how this might work), there does not currently exist
a performant implementation of the algorithm needed to accomplish
this. Until such an implementation surfaces, we will make this corner
case of `GeneralizedNewtypeDeriving` an error.
Test Plan: make test TEST="T14728a T14728b"
Reviewers: bgamari
Reviewed By: bgamari
Subscribers: rwbarton, thomie, carter
GHC Trac Issues: #14728
Differential Revision: https://phabricator.haskell.org/D4402
}}}
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14728#comment:13>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list