4 ms·
Haskell could, trivially, do the first example shorter than python.
by tomjen3 16y ago
Haskell could, trivially, do the first example shorter than python.
- jrockway 16y agoYeah, but then there wouldn't be anything to blog about.
- fogus 16y agoI'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]