Hi All,
I got this far:
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DeriveDataTypeable #-}
import Data.Text
import Data.Typeable
import Data.Data
data Thing = Thing { foo :: Int, bar :: String}
deriving (Read, Show, Typeable, Data)
thing :: Thing
thing = Thing 1 "wop"
con = toConstr thing
fields = constrFields con
main = putStrLn $ show con ++ show fields ++ ( Prelude.concat $ gmapQ show thing )
But it's barfing like this:
Could not deduce (Show d) arising from a use of `show'
from the context (Data d)
bound by a type expected by the context: Data d => d -> [Char]
at w.hs:76:65-80
I can see why, but not how to fix it.
Any help much appreciated,
Adrian.