
26 Jun
2007
26 Jun
'07
11:27 a.m.
I pasted the wrong show code. Here is the version I actually ran:
instance Show a => Show (UpTree a) where show u@(UpTree {parent=Nothing}) = "ROOT_UpTree "++show (value u)++"\n" ++(indent 3 $ show (children u)) show u@(UpTree {parent=Just p,children=[]}) = "LEAF UpTree "++show (value u)++"\n" ++" parent value is "++show (value p)++"\n" show u@(UpTree {parent=Just p}) = "BRANCH UpTree "++show (value u)++"\n" ++" parent value is "++show (value p)++"\n" ++(indent 3 $ show (children u))