[Haskell-cafe] A round of golf

Derek Elkins derek.a.elkins at gmail.com
Fri Sep 19 00:45:26 EDT 2008


On Fri, 2008-09-19 at 06:38 +0200, Daniel Fischer wrote:
> Am Freitag, 19. September 2008 03:14 schrieb Robert Greayer:
> > --- On Thu, 9/18/08, Creighton Hogg <wchogg at gmail.com> wrote:
> > > If this makes anyone cringe or cry
> > > "you're doing it wrong", I'd
> > > actually like to hear it.
> >
> > Just to make everyone cry:
> >
> > main = getArgs >>= \(x:_) -> system ("wc -l " ++ x)
> >
> 
> Ouch!

Indeed.

main = getArgs >>= system . ("wc -l "++) . head



More information about the Haskell-Cafe mailing list