Ticket #4529: Test2.2.hs
| File Test2.2.hs, 493 bytes (added by mitar, 3 years ago) |
|---|
| Line | |
|---|---|
| 1 | {-# LANGUAGE TypeFamilies, DeriveDataTypeable #-} |
| 2 | |
| 3 | module Test2 where |
| 4 | |
| 5 | import Data.Data |
| 6 | import System.Random |
| 7 | |
| 8 | data (Real r, Show r, Random r, Data r) => RandomFoo r = RandomFoo (RandomBar r) deriving (Typeable, Data) |
| 9 | |
| 10 | class Foo n where |
| 11 | data FooBar n |
| 12 | |
| 13 | type RandomBar r = FooBar (RandomFoo r) |
| 14 | |
| 15 | instance (Real r, Show r, Random r, Data r) => Foo (RandomFoo r) where |
| 16 | data FooBar (RandomFoo r) = RandomBar { |
| 17 | a :: [r], |
| 18 | b :: [Int] |
| 19 | } deriving (Eq, Ord, Read, Show, Typeable, Data) |
