{-# LANGUAGE TypeFamilies, DeriveDataTypeable #-}

module Test2 where

import Data.Data
import System.Random

data (Real r, Show r, Random r, Data r) => RandomFoo r = RandomFoo (RandomBar r) deriving (Typeable, Data)

class Foo n where
  data FooBar n

type RandomBar r = FooBar (RandomFoo r)

instance (Real r, Show r, Random r, Data r) => Foo (RandomFoo r) where
  data FooBar (RandomFoo r) = RandomBar {
      a :: [r],
      b :: [Int]
    } deriving (Eq, Ord, Read, Show, Typeable, Data)
