-1

I've been studying the Swift programming language for iOS, and I have a very small Haskell background. I'm very curious to know if the concept of list comprehension can be implemented in Swift?

Any thoughts, advice, etc., would be greatly appreciated!

1 Answers1

3

As a general rule, list comprehensions are a syntactic feature that a language either has or doesn't have. Swift doesn't have them. For some concise ways of achieving similar results, see this question.

Community
  • 1
  • 1
Mark Reed
  • 91,912
  • 16
  • 138
  • 175
  • 1
    This should have been marked as a duplicate, rather than posting an answer that links to another post on Stack Overflow. – JAL Mar 02 '16 at 15:18
  • I voted to close it as a duplicate of that question. I submitted the answer in case there weren't four other votes agreeing with me.. – Mark Reed Mar 02 '16 at 16:27