Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^2: Golf: Length of longest line in a file

by ambrus (Abbot)
on Jul 04, 2010 at 10:44 UTC ( [id://847968]=note: print w/replies, xml ) Need Help??


in reply to Re: Golf: Length of longest line in a file
in thread Golf: Length of longest line in a file

Wouldn't getContents from the prelude work instead of IO.getContents? This shortens a lot because now you can use ghc -e instead of runhaskell, eg.

#!/bin/sh ghc -e 'getContents>>=print.maximum.map length.lines'

We also use some other functions of the Prelude for brevity. Note that the code can't be in the same argument as -e.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://847968]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (3)
As of 2024-04-24 22:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found