
13 Mar
2012
13 Mar
'12
7:08 p.m.
On 03/13/2012 10:33 PM, Johan Tibell wrote:
value = Bin 1 (Bin 2 Leaf Leaf) (Bin 3 Leaf Leaf)
I'm usually using the following snippet which is a tweak of the gshow function from syb. However everything need to be a member of Data/Typeable, and also list are not particularly well handled with this. gshowHier :: Data a => Int -> a -> String gshowHier il a = intercalate "\n" (constr : gmapQ (gshowHier (il+2)) a) where constr = replicate il ' ' ++ (showConstr $ toConstr a) -- Vincent