On Thu, Sep 18, 2008 at 1:02 PM, Creighton Hogg <[EMAIL PROTECTED]> wrote:
> Hey Haskell,
> So for a fairly inane reason, I ended up taking a couple of minutes
> and writing a program that would spit out, to the console, the number
> of lines in a file.  Off the top of my head, I came up with this which

Yay, golf! I love playing golf from my Perl days. How about this:

  main = print . length . lines =<< readFile . head =<< getArgs

Salt with Bytestring for extra flavor (and speed).

Kurt
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to