[Haskell-cafe] Re: Point-free style

Matthew Roberts mattr at ics.mq.edu.au
Thu Feb 10 19:24:56 EST 2005


just a few quick observations

comming from an imperative background, I found point free code very 
difficult to understand when learning Haskell.  It is not that it is 
hard to understand the concepts of point-free style, it is that it is 
hard to know when something is point-free.

It is "another option" and I think the best way to make a language 
"readable" is to stick to a few simple rules and clean semantics.  
Since, you can't write all your code point-free, I say write it all 
pointed - consistency is the thing!

also, the term "point free" confused me for quite a while.  Point-free 
code has lots of points (periods) and so I kept thinking it was the 
other way around.

matt


On 11/02/2005, at 7:19 AM, Henning Thielemann wrote:

>
> On 10 Feb 2005, Peter Simons wrote:
>
>> 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)
>
> point-free again
>
> is >>= return . (i+)
>
> :-]
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe



More information about the Haskell-Cafe mailing list