[Haskell-cafe] Re: Point-free style

Daniel Fischer daniel.is.fischer at web.de
Fri Feb 11 07:43:48 EST 2005


Am Donnerstag, 10. Februar 2005 20:50 schrieben Sie:
> > >   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.

I think so, too.
And in general, I think that sometimes points-free is more readable than 
pointed, sometimes it's the other way round and sometimes a mixed form is 
best to read. 

So I choose not to consistently write points-free nor pointed (sorry, Matthew)
but what I judge to be most readable.

> --
> Hal Daume III                                   | hdaume at isi.edu
> "Arrest this man, he talks in maths."           | www.isi.edu/~hdaume

Daniel


More information about the Haskell-Cafe mailing list