Keith Wansbrough wrote:

> Sven Panne wrote:
>
> > > Don't fear! Mr. One-Liner comes to the rescue:    ;-)
> > >
> > >    longerThan fn lenlim = readFile fn >>= lines .| filter (length .| (>lenlim)) 
>.| zip [1..] .| map (\(n,l) -> shows n ") " ++ l) .| unlines .| putStr
>
> Friedrich wrote:
>
> > Do you want to drive me away from learning Haskell? Who the hell can try
> > to write such functions? Is readabilty not a concern in Haskell?
>
> I would have to agree, Sven does seem to be working hard to drive a
> beginner away from Haskell.  But he is illustrating an important
> coding style.

Not only that, but it's also a style that many of us find readable.  I would not have
used reverse composition, but otherwise it looks much like I think it should.
Of course, this can be a little hard to read if you're not used to it, but all you need
is practise. :-)

--

        -- Lennart





Reply via email to