[Haskell-cafe] Re: Tree Guidance

Chris Kuklewicz haskell at list.mightyreason.com
Tue Jun 26 11:27:05 EDT 2007


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))




More information about the Haskell-Cafe mailing list