2 ms·
Conversely, Julia's comprehension syntax is very powerful and quite a bit more general than what is described here — but in a different way. - They're not list
by mbauman 5y ago
Conversely, Julia's comprehension syntax is very powerful and quite a bit more general than what is described here — but in a different way.
- They're not list comprehensions, they're one-dimensional vector comprehensions. And they seamlessly extend to multidimensional array comprehensions.
- Just drop the square brackets and instead of a dense array you get a lazy generator!
- anyfoo 5y agoCorrect me if I'm wrong, but doesn't them being Monad comprehensions in Haskell automatically mean that Haskell's "list" comprehensions can be all of those things as well, and more? As well as the language's laziness by default that pretty much encompasses the generator aspect in general anyways. (Although I'm not really trying to pit anything against each other here, they are different languages with different requirements.)
- mbauman 5y agoSee the cousin discussion below on multidimensional arrays in Haskell.