Ticket #4529: Test2.2.hs

File Test2.2.hs, 493 bytes (added by mitar, 3 years ago)

Correct file for this ticket

Line 
1{-# LANGUAGE TypeFamilies, DeriveDataTypeable #-}
2
3module Test2 where
4
5import Data.Data
6import System.Random
7
8data (Real r, Show r, Random r, Data r) => RandomFoo r = RandomFoo (RandomBar r) deriving (Typeable, Data)
9
10class Foo n where
11  data FooBar n
12
13type RandomBar r = FooBar (RandomFoo r)
14
15instance (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)