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.
|
|---|