2 ms·
I don't know. To me, sum $ map (^2) Is pretty clear as a sum of squares is a quite common mathematical idiom. The zipWith part could probably be avoided.
by wz1000 10y ago
I don't know. To me,
sum $ map (^2)
Is pretty clear as a sum of squares is a quite common mathematical idiom. The zipWith part could probably be avoided.
guard $ (6 ==) $
sum $ map (^2)
[(a%k),...]
- conistonwater 10y agoI think the original is still a lot cleaner, though.