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