[Haskell-cafe] Re: Point-free style
Peter Simons
simons at cryp.to
Thu Feb 10 10:53:00 EST 2005
Jan-Willem Maessen writes:
> Is it really clear or obvious what
>
> map . (+)
>
> means?
Yes, it is perfectly obvious once you write it like this:
incrEach :: Integer -> [Integer] -> [Integer]
incrEach = map . (+)
Now compare that to the following function, which does the
some thing but without point-free notation:
incrEach' :: Integer -> [Integer] -> [Integer]
incrEach' i is = is >>= \i' -> return (i'+i)
Which one is harder to read? ;-)
Peter
More information about the Haskell-Cafe
mailing list