[GHC] #16319: unexpected difference between newtype and data

GHC ghc-devs at haskell.org
Thu Feb 14 15:43:58 UTC 2019


#16319: unexpected difference between newtype and data
---------------------------------+----------------------------------------
        Reporter:  pjljvdlaar    |                Owner:  (none)
            Type:  bug           |               Status:  new
        Priority:  normal        |            Milestone:
       Component:  Compiler      |              Version:  8.2.2
      Resolution:                |             Keywords:
Operating System:  Windows       |         Architecture:  Unknown/Multiple
 Type of failure:  None/Unknown  |            Test Case:
      Blocked By:                |             Blocking:
 Related Tickets:                |  Differential Rev(s):
       Wiki Page:                |
---------------------------------+----------------------------------------

Comment (by RyanGlScott):

 Indeed, `GeneralizedNewtypeDeriving` (and `DerivingVia`) have never taken
 the "stupid theta" (i.e., `DatatypeContexts`) into account when generating
 code for whatever reason. Fixing this wouldn't be too difficult (I think
 you'd just need to change the relevant bits in `TcDeriv`), but is it
 really worth it? `DatatypeContexts` is a deprecated feature:

 {{{
 λ> :set -XDatatypeContexts

 <no location info>: warning:
     -XDatatypeContexts is deprecated: It was widely considered a
 misfeature, and has been removed from the Haskell language.
 }}}

 And I'm not sure if it's worthwhile to continue to maintain it.

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


More information about the ghc-tickets mailing list