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))
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe