News for hackers. Stuff that matters.
Re:Map/Reduce for Mortals by lgas on Tuesday January 14, 2020 @02:36PM (#22048411)
In actual Haskell I would write it as

    sum [ n^2 | n <- [1..5], n % 3 == 1 ]
which seems to express the idea fairly directly and I'm fairly sure has a close analog in python.
Re:Map/Reduce for Mortals by lightsighter on Tuesday January 14, 2020 @03:28PM (#22048924)
python: sum([n * n for n in range(1,5,3)])
Re:Map/Reduce for Mortals by marai2 on Tuesday January 14, 2020 @05:30PM (#22049904)
haskell: sum [n^2 | n <- [1,3..5]]

I just remembered haskell's "range" operator ".." can also take a step size.

['a', 'd' .. 'z'] => "adgjmpsvy"