[Haskell-cafe] Records (was Re: [Haskell] Improvements to GHC)
tomasz.zielonka at gmail.com
Fri Nov 18 02:23:40 EST 2005
On Thu, Nov 17, 2005 at 06:56:09PM +0100, Sebastian Sylvan wrote:
> Personally I think that the dot is way to good of a symbol to be
> "wasted" on function composition.
> I mean, how often do you really use function composition in a way
> which doesn't obfuscate your code?
I just checked in two recent projects, and it's about one (.) in 100
lines of code. I wanted to disagree with you, but in the end I could
accept pressing more keys when I wanted function composition, especially
if I got something in return.
BTW, I think there was some tool to calculate various metrics on Haskell
code. It would be interesting to make some graphs showing how often you
use various features of Haskell, how it changed with time.
> I use ($) way more often than (.).
Me too, measurement shows it's about four times more often. However,
I like my uses of (.) much more than uses of ($). I often turn $'s
into parentheses, because I feel it looks better this way. Of course,
there are cases where $ is indispensable.
> Some people do use it more often than I do, but I find that in most
> cases except simple "pipelined" functions it only makes the code
> harder to read.
But this case is quite important, isn't it?
More information about the Haskell-Cafe