<div dir="ltr">I&#39;m not a Haskell expert but here the solution to your problem that I can think of.<br><br>import Data.List<br><br>prettyStr :: Int -&gt; String -&gt; IO ()<br>prettyStr maxlen str = do<br>&nbsp;&nbsp; putStr (&quot;\&quot;&quot; ++ head brokenStr)<br>
&nbsp;&nbsp; mapM_ (\str -&gt; putStr (&quot;\\\n\\&quot; ++ str)) (tail brokenStr)<br>&nbsp;&nbsp; putStr &quot;\&quot;\n&quot;<br>&nbsp;&nbsp; where brokenStr = map (snd.unzip) $ groupBy (\_ (i,_) -&gt; i `mod` maxlen /= 0) $ zip [0..] str<br><br>Ed<br>
<br><div class="gmail_quote">On Sat, Sep 20, 2008 at 4:14 PM, Maurí­cio <span dir="ltr">&lt;<a href="mailto:briqueabraque@yahoo.com">briqueabraque@yahoo.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br>
<br>
I&#39;m using Language.Haskell.* and would<br>
like to know if it&#39;s possible to<br>
pretty-print big strings like this:<br>
<br>
&quot;aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&quot;<br>
<br>
into something like this:<br>
<br>
&quot;aaaaaaaa\<br>
\aaaaaaaa\<br>
\aaaaaaaa\<br>
\aaaaaaaa\<br>
\aaaaaaaa\<br>
\aaaaaaaa\<br>
\aaaaaaaa&quot;<br>
<br>
to respect the limit on number of<br>
columns. Can you help me? Is it<br>
possible to do that?<br>
<br>
Thanks,<br>
Maurício<br>
<br>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org" target="_blank">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
</blockquote></div><br></div>