[GHC] #9563: Support for deriving Generic1 for data families

#9563: Support for deriving Generic1 for data families -------------------------------------+------------------------------------- Reporter: mnislaih | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.2 Keywords: | Operating System: MacOS X Architecture: Unknown/Multiple | Type of failure: GHC Difficulty: Unknown | rejects valid program Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- The following code: {{{#!hs import GHC.Generics data family F typ :: * -> * data A data instance F A a = AData a deriving Generic1 }}} produces an error when run with ghc 7.8.2 or 7.8.3: {{{ Couldn't match type ‘Rep1 (F A)’ with ‘M1 t0 t1 (M1 t2 t3 (M1 t4 t5 Par1))’ The type variables ‘t0’, ‘t1’, ‘t2’, ‘t3’, ‘t4’, ‘t5’ are ambiguous Expected type: Rep1 (F A) a Actual type: M1 t0 t1 (M1 t2 t3 (M1 t4 t5 Par1)) a In the pattern: M1 (M1 (M1 g1)) In an equation for ‘to1’: to1 (M1 (M1 (M1 g1))) = AData (unPar1 g1) In the instance declaration for ‘Generic1 (F A)’ }}} whereas ghc 7.6.3 simply refuses to go ahead with the message: {{{ generic1.hs:14:40: Derived instance `Generic1 (F A)' requires illegal partial application of data type family F In the data instance declaration for `F' }}} Either a check has gone missing in 7.8.x, or a bug has crept up in the Generic1 support. I have gone through past tickets and https://ghc.haskell.org/trac/ghc/ticket/5936 suggests that it is the latter. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9563 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9563: Support for deriving Generic1 for data families -------------------------------------+------------------------------------- Reporter: mnislaih | Owner: dreixel Type: bug | Status: new Priority: high | Milestone: 7.10.1 Component: Compiler | Version: 7.8.2 Resolution: | Keywords: Operating System: MacOS X | Architecture: Unknown/Multiple Type of failure: GHC | Difficulty: Unknown rejects valid program | Blocked By: Test Case: | Related Tickets: Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Changes (by simonpj): * owner: => dreixel * priority: normal => high * milestone: => 7.10.1 Comment: Pedro, might you look at this? Simon -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9563#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9563: Support for deriving Generic1 for data families
-------------------------------------+-------------------------------------
Reporter: mnislaih | Owner: dreixel
Type: bug | Status: new
Priority: high | Milestone: 7.10.1
Component: Compiler | Version: 7.8.2
Resolution: | Keywords:
Operating System: MacOS X | Architecture: Unknown/Multiple
Type of failure: GHC | Difficulty: Unknown
rejects valid program | Blocked By:
Test Case: | Related Tickets:
Blocking: |
Differential Revisions: |
-------------------------------------+-------------------------------------
Comment (by Jose Pedro Magalhaes

#9563: Support for deriving Generic1 for data families -------------------------------------+------------------------------------- Reporter: mnislaih | Owner: dreixel Type: bug | Status: merge Priority: high | Milestone: 7.10.1 Component: Compiler | Version: 7.8.2 Resolution: | Keywords: Operating System: MacOS X | Architecture: Unknown/Multiple Type of failure: GHC | Difficulty: Unknown rejects valid program | Blocked By: Test Case: | Related Tickets: generics/T9563 | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Changes (by dreixel): * status: new => merge * testcase: => generics/T9563 Comment: Thanks for reporting. That code now compiles with HEAD. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9563#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9563: Support for deriving Generic1 for data families -------------------------------------+------------------------------------- Reporter: mnislaih | Owner: dreixel Type: bug | Status: merge Priority: high | Milestone: 7.8.4 Component: Compiler | Version: 7.8.2 Resolution: | Keywords: Operating System: MacOS X | Architecture: Unknown/Multiple Type of failure: GHC | Difficulty: Unknown rejects valid program | Blocked By: Test Case: | Related Tickets: generics/T9563 | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Changes (by thomie): * milestone: 7.10.1 => 7.8.4 Comment: I don't know whether this actually needs to go into 7.8.4, but status=merge and milestone=7.10.1 doesn't make sense (there's no 7.10 branch yet, so there's nothing to merge). -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9563#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9563: Support for deriving Generic1 for data families -------------------------------------+------------------------------------- Reporter: mnislaih | Owner: dreixel Type: bug | Status: merge Priority: high | Milestone: 7.8.4 Component: Compiler | Version: 7.8.2 Resolution: | Keywords: Operating System: MacOS X | Architecture: Unknown/Multiple Type of failure: GHC | Difficulty: Unknown rejects valid program | Blocked By: Test Case: | Related Tickets: generics/T9563 | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Comment (by dreixel): Thanks. Merging into 7.8.4 would be good, if possible. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9563#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9563: Support for deriving Generic1 for data families -------------------------------------+------------------------------------- Reporter: mnislaih | Owner: dreixel Type: bug | Status: closed Priority: high | Milestone: 7.8.4 Component: Compiler | Version: 7.8.2 Resolution: fixed | Keywords: Operating System: MacOS X | Architecture: Unknown/Multiple Type of failure: GHC | Difficulty: Unknown rejects valid program | Blocked By: Test Case: | Related Tickets: generics/T9563 | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Changes (by thoughtpolice): * status: merge => closed * resolution: => fixed Comment: Merged to 7.8.4. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9563#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9563: Support for deriving Generic1 for data families -------------------------------------+------------------------------------- Reporter: mnislaih | Owner: dreixel Type: bug | Status: closed Priority: high | Milestone: 7.8.4 Component: Compiler | Version: 7.8.2 Resolution: fixed | Keywords: Generics Operating System: MacOS X | Architecture: | Unknown/Multiple Type of failure: GHC rejects | Test Case: valid program | generics/T9563 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * keywords: => Generics -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9563#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC