Opened 8 years ago

Closed 8 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: None/Unknown Test Case: deriving/should_compile/T2856
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

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 8 years ago by chak

Owner: set to chak

comment:2 Changed 8 years ago by simonpj

difficulty: Unknown
Owner: changed from chak to igloo
Test Case: deriving/should_compile/T2856
Type: bugmerge

Good point, thank you. Fixed by

Wed Dec 31 14:41:51 GMT 2008  simonpj@microsoft.com
  * Fix Trac #2856: make deriving work for type families

Merge this only if it's easy.

Simon

comment:3 Changed 8 years ago by igloo

Resolution: fixed
Status: newclosed

Merged

Note: See TracTickets for help on using tickets.