Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
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 not a whimper to be heard...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (14)
As of 2017-01-20 16:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you watch meteor showers?




    Results (175 votes). Check out past polls.