Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
wz1000
on Jan 1, 2017
|
parent
|
context
|
favorite
| on:
How (Not?) to Use Python’s List Comprehensions
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
on Jan 1, 2017
[–]
I think the original is still a lot cleaner, though.
Consider applying for YC's Summer 2025 batch! Applications are open till May 13
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: