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 ( #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
Node Status?
node history
Node Type: note [id://847962]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2016-09-25 20:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Extraterrestrials haven't visited the Earth yet because:







    Results (473 votes). Check out past polls.