1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE RankNTypes #-}
module LocalQuantors () where
-- A datatype with a locally quantified component
-- Seems to be too polymorphic to descend into structure!
-- Largely irrelevant?!
import Data.Generics
data Test = Test (GenericT) deriving Typeable
instance Data Test
where
gfoldl _ z x = z x -- folding without descent
toConstr (Test _) = testConstr
gunfold _ _ = error "gunfold"
dataTypeOf _ = testDataType
testConstr = mkConstr testDataType "Test" [] Prefix
testDataType = mkDataType "Main.Test" [testConstr]
|