3 ms·
well that first example in the article would be foldl (+) 0 (map (+2) [1..10]) or sum $ map (+2) [1..10] So... make up your own mind. As someone wh
by rtpg 11y ago
well that first example in the article would be
foldl (+) 0 (map (+2) [1..10])
or
sum $ map (+2) [1..10]
So... make up your own mind.
As someone who has written only small chunks of lisp but at many different points in life, I do find the whole parens game to be a bit disorienting, but usually I can counter it by using newlines.
I would write something like
(reduce + (map (comp inc inc) (range 10)))
as
(reduce +
(map (comp inc inc)
(range 10)))
- crimsonalucard 11y agoI deal with it by using an IDE or plugin for paren highlighting.
- zeekay 11y agoRanges are inclusive, so: sum $ map (+2) [0..9] Nitpick, but it confused me for a second.