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
- Re: how to write a simple cat Friedrich Dominicus
- Re: how to write a simple cat Hannah Schroeter
- Re: how to write a simple cat Sven Panne
- Re: how to write a simple cat Friedrich Dominicus
- Re: how to write a simple cat S. Alexander Jacobson
- Re: how to write a simple cat Sven Panne
- Re: how to write a simple cat Friedrich Dominicus
- Re: how to write a simple cat Jan Skibinski
- Re: how to write a simple cat Lars Henrik Mathiesen
- Re: how to write a simple cat Keith Wansbrough
- Re: how to write a simple cat Lennart Augustsson
- Re: how to write a simple cat Kevin Atkinson
- RE: how to write a simple cat Frank A. Christoph
- Re: how to write a simple cat Friedrich Dominicus
- RE: how to write a simple cat Simon Peyton-Jones
- RE: how to write a simple cat trb
- RE: how to write a simple cat Hans Aberg
- RE: how to write a simple cat Peter Hancock
- RE: how to write a simple cat Hans Aberg
- RE: how to write a simple cat Jan Skibinski
- Re: how to write a simple cat Sven Panne
