<br><div class="gmail_quote">On Dec 12, 2007 10:36 AM, Arie Groeneveld &lt;<a href="mailto:bradypus@xs4all.nl">bradypus@xs4all.nl</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Reinier Lamers schreef:<br><div class="Ih2E3d">&gt;<br>&gt; printint :: Int -&gt; [Char]<br>&gt; printint = map chr . map (+0x30) . reverse . map (`mod` 10) .<br>&gt; takeWhile (&gt;0) . iterate (`div`10)<br>&gt;<br></div>
Most of the time I use this:<br><br>digits :: Integer -&gt; [Int]<br>digits = map (flip(-)48.ord) . show<br></blockquote><br>One can also use Data.Char.digitToInt in place of (flip (-) 48 . ord).<br><br>-Brent<br></div><br>