[GHC] #8503: New GeneralizedNewtypeDeriving check still isn't permissive enough

GHC ghc-devs at haskell.org
Wed Nov 20 08:51:12 UTC 2013


#8503: New GeneralizedNewtypeDeriving check still isn't permissive enough
-------------------------------------+------------------------------------
        Reporter:  goldfire          |            Owner:  goldfire
            Type:  bug               |           Status:  new
        Priority:  normal            |        Milestone:
       Component:  Compiler          |          Version:  7.7
      Resolution:                    |         Keywords:
Operating System:  Unknown/Multiple  |     Architecture:  Unknown/Multiple
 Type of failure:  None/Unknown      |       Difficulty:  Unknown
       Test Case:                    |       Blocked By:
        Blocking:                    |  Related Tickets:  #8541
-------------------------------------+------------------------------------

Comment (by simonpj):

 For the recurisve-newtype problem (ie the main topic of this ticket, now
 that we have moved polykinded `Coercible` to #8541), the approach
 (developed by Joachim and me) is to

 A) Add a feature to the constraint solver to prevent recursive
 dictionaries for specially marked instances (for now only used for
 Coercible). Rationale: Such dictionaries (which are fine for most classes
 like Show) would make coerce diverge. Implementation: Use the depth
 counter and do not use lower depths to solver constraints with a higher
 depth. This is of course a very conservative approximation, but should be
 sufficient.

 B) Use the regular constraint depth bound to prevent looping at compile
 time. In order for that to be more useful, count constraint solving and
 type function resolving separately.

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


More information about the ghc-tickets mailing list