Ticket #2856 (closed merge: fixed)

Opened 4 years ago

Last modified 4 years ago

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: Difficulty: Unknown
Test Case: deriving/should_compile/T2856 Blocked By:
Blocking: Related Tickets:

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

Changed 4 years ago by chak

  • owner set to chak

Changed 4 years ago by simonpj

  • owner changed from chak to igloo
  • difficulty set to Unknown
  • type changed from bug to merge
  • testcase set to deriving/should_compile/T2856

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

Changed 4 years ago by igloo

  • status changed from new to closed
  • resolution set to fixed

Merged

Note: See TracTickets for help on using tickets.