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. If we lay his function out on a few more lines, and
> replace his (|.) = flip (.) operator with the standard functional
> composition (.), we get the following:
Truthfully I think the forward composition ie (flip (.) ) makes the code
more natural to read as it can be read do this, than this, than this,
etc... As opposed to do this to the result of this to the result of
this, etc... The former can be read as a sequence of actions to
perform.
I just wish a standard operator is chosen for a) flip (.) and b) flip
($) instead of having everyone make up their own. I don't really care
what it is. I truthfully like >.> for flip (.) and # for flip ($) but I
can easily change.
--
Kevin Atkinson
[EMAIL PROTECTED]
http://metalab.unc.edu/kevina/