Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

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

by mellon85 (Monk)
on Jul 04, 2010 at 08:15 UTC ( [id://847962]=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

well, you could have used liftM and merge map length in the fold function

liftM (foldl (\x y -> max x $ length y) 0 . lines) $hGetContents stdin

oh.. wait.. what is this?

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (6)
As of 2024-04-18 13:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found