3 ms·
In Haskell, I have the luxury of infix arithmetic, but I'll still happily write sum [a,b,c,d,e] when I have a lot of summands. It's just neater, especial
by Chattered 12y ago
In Haskell, I have the luxury of infix arithmetic, but I'll still happily write
sum [a,b,c,d,e]
when I have a lot of summands.
It's just neater, especially when you format as
sum [summand1
,summand2
,summand3]
This is more natural in Lisp. Because of this, I always go to Lisp for things like my weekly shopping budget. For bonus points, I can put my cursor at the end of a close bracket and get Emacs to evaluate the enclosed subexpression, which I do lots to figure out the value of individual terms.
- grayclhn 12y agoWe do this in math too: ∑_{i=1,...,n} x_i is a lot more readable than x_1 + x_2 + x_3 + ... + x_n. (Underscore means "subscript" here.)