Commit 151d9113 authored by simonpj's avatar simonpj
Browse files

Test Trac #2856

parent 15bb7799
{-# LANGUAGE TypeFamilies, GeneralizedNewtypeDeriving, StandaloneDeriving, FlexibleInstances #-}
-- Test Trac #2856
module T2856 where
import Ratio
class C a where
data D a
instance C Bool where
newtype D Bool = DInt Int deriving (Eq, Show, Num)
instance C a => C [a] where
newtype D [a] = DList (Ratio a) deriving (Eq, Show, Num)
data family W a
newtype instance W Bool = WInt Int deriving( Eq, Show )
newtype instance W [a] = WList (Ratio a) deriving( Eq, Show )
deriving instance Num (W Bool)
deriving instance (Integral a, Num a) => Num (W [a])
-- Integral needed because superclass Eq needs it,
-- because of the stupid context on Ratio
......@@ -17,3 +17,4 @@ test('drv020', normal, compile, [''])
test('drv021', normal, compile, [''])
test('deriving-1935', normal, compile, [''])
test('T2378', normal, compile, [''])
test('T2856', normal, compile, [''])
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment