Opened 7 years ago

Closed 7 years ago

#2856 closed merge (fixed)

GeneralizedNewtypeDeriving doesn't work with data families

Reported by: guest Owned by: igloo
Priority: normal Milestone:
Component: Compiler Version: 6.10.1
Keywords: Cc: lennart@…
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Test Case: deriving/should_compile/T2856
Blocked By: Blocking:
Related Tickets: Differential Revisions:

Description

Observe:

{-# LANGUAGE TypeFamilies, GeneralizedNewtypeDeriving #-}
module Bug9 where

class C a where
    data D a

instance C Bool where
    newtype D Bool = DInt Int deriving (Eq, Show, Num)

The deriving of Num fails, whereas the corresponding standalone newtype works fine.

Change History (3)

comment:1 Changed 7 years ago by chak

  • Owner set to chak

comment:2 Changed 7 years ago by simonpj

  • difficulty set to Unknown
  • Owner changed from chak to igloo
  • Test Case set to deriving/should_compile/T2856
  • Type changed from bug to merge

Good point, thank you. Fixed by

Wed Dec 31 14:41:51 GMT 2008  [email protected]
  * Fix Trac #2856: make deriving work for type families

Merge this only if it's easy.

Simon

comment:3 Changed 7 years ago by igloo

  • Resolution set to fixed
  • Status changed from new to closed

Merged

Note: See TracTickets for help on using tickets.