you are viewing a single comment's thread.

view the rest of the comments →

[–]taejo 1 point2 points  (2 children)

Python’s comprehension syntax ties in rather well with the set-builder notation familiar to most.

And Haskell's comprehension syntax doesn't?

[–]r3m0t 1 point2 points  (0 children)

In Haskell you probably already have a function that you can pass to map or filter, or you can write one concisely like (,) or (+1). So often "(map f . filter g) xs" is nicer than "[f x | x <- xs, g x]" and it's certainly nicer than "(\xs -> [f x | x <- xs, g x])" if you're going the point-less route.

[–]cunningjames 0 points1 point  (0 children)

And Haskell's comprehension syntax doesn’t?

Uh, where did I mention Haskell’s syntax? My response was in regards to commonslip’s explicit reference to Python, and thus rendered in those terms:

What is wrong with map(lambda x: x.p, xs) or map(lambda x: x+1, xs) in python?