[Haskell-cafe] Re: Point-free style
Hal Daume III
hdaume at ISI.EDU
Thu Feb 10 14:50:47 EST 2005
> > incrEach' i is = is >>= \i' -> return (i'+i)
>
> Ugh, but I think the natural way to write it looks more like
>
> incrAll :: Integer -> [Integer] -> [Integer]
> incrAll n ks = map (+n) ks
>
> which is no less readable than map . (+).
I tend to like point-freeing only the last argument, which gives something
like:
> incrAll n = map (+n)
which I think (personally) is the most readable.
--
Hal Daume III | hdaume at isi.edu
"Arrest this man, he talks in maths." | www.isi.edu/~hdaume
More information about the Haskell-Cafe
mailing list