Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
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?


Comment on Re^2: Golf: Length of longest line in a file
Select or Download Code

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: (7)
As of 2015-07-30 04:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (269 votes), past polls