[Swift-devel] Problem with iterate

Ben Clifford benc at hawaga.org.uk
Sun Feb 21 13:39:32 CST 2010


> There's also the list comprehension way with C-like syntax, which
> involves no array indices:

yeah, I had forgotten about that. It seems to keep the shape a bit better.

This is the same as your example (if I understand your example), in 
Haskell:

a = do
  p <- [1,2,3]
  return $ do
     q <- [10,20,30]
     return (p + q)

main = print a

-- 



More information about the Swift-devel mailing list