<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">The documentation for the Show typeclass has this very example:&nbsp;<a href="http://hackage.haskell.org/packages/archive/base/latest/doc/html/Prelude.html#t:Show">http://hackage.haskell.org/packages/archive/base/latest/doc/html/Prelude.html#t:Show</a><div><br></div><div><a href="http://hackage.haskell.org/packages/archive/base/latest/doc/html/Prelude.html#t:Show"></a>The summary? you need to define either showPrec or show, the latter of which is simpler, it is just a -&gt; String.</div><div><br></div><div>So:</div><div><br></div><div>instance Show (Tree Int Int) where</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>show (Tree (Node (k,v)) left right) = ...<br><div><br><div><div>On Jul 21, 2011, at 10:55 AM, Александр wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Hello, &nbsp;thank you for reply. I know that i can derive this. But i want to know how can i make it by hand.<br><br>Thank you.<br>_______________________________________________<br>Haskell-Cafe mailing list<br><a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>http://www.haskell.org/mailman/listinfo/haskell-cafe<br></div></blockquote></div><br></div></div></body></html>