{-# OPTIONS -fglasgow-exts #-}
module Datatype where
import Test.HUnit
import Data.Tree
import Data.Generics
data MyDataType a = MyDataType a
deriving (Typeable, Data)
myTerm = undefined :: MyDataType Int
myTypeRep = typeOf myTerm
myTyCon = typeRepTyCon myTypeRep
myDataType = dataTypeOf myTerm
myString1 = tyConName myTyCon
myString2 = dataTypeName myDataType
tests = show ( myTypeRep
, ( myDataType
, ( tyconModule myString1
, ( tyconUQname myString1
, ( tyconModule myString2
, ( tyconUQname myString2
))))))
~=? output
output = "(MyDataType Int,(DataType {tycon = \"Datatype.MyDataType\", datarep = AlgRep [MyDataType]},(\"\",(\"MyDataType\",(\"Datatype\",\"MyDataType\")))))"