<div dir="ltr">On Thu, Sep 18, 2008 at 10:02 AM, Creighton Hogg <span dir="ltr"><<a href="mailto:wchogg@gmail.com">wchogg@gmail.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
If this makes anyone cringe or cry "you're doing it wrong", I'd<br>
actually like to hear it.</blockquote><div><br>Yes, that made me cry :-) Your code seems very convoluted, and quite successfully hides what it's really trying to do. Here's a version that is rather more concise, and which will be far faster besides.<br>
<br>import qualified Data.ByteString.Lazy.Char8 as B<br>import System.Environment<br><br>main = mapM_ ((print =<<) . fmap (B.count '\n') . B.readFile) =<< getArgs<br><br></div></div></div>