4 ms·
I'm no Haskell expert, but it's a couple chars shorter AND solves the premise of the entire post. [x*x | x <- s, x `mod` 3 == 0] And the function definiti
by fogus 16y ago
I'm no Haskell expert, but it's a couple chars shorter AND solves the premise of the entire post.
[x*x | x <- s, x `mod` 3 == 0]
And the function definition doesn't need all of the type clutter:
let playWithSeq s = [x*x | x <- s, x `mod` 3 == 0]
playWithSeq [0..10]
-- [0,9,36,81]