<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 &quot;wop&quot;<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&#39;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&#39;<br>
    from the context (Data d)<br>      bound by a type expected by the context: Data d =&gt; d -&gt; [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>