pufuwozu/roy — pull request #170 by joneshf (2013-01-28 03:58:24+00:00)
Title: List comp

So here's an idea for list comprehensions. I tried to stay in line with what I know from erlang and haskell. It compiles it all to for loops. I also added integer sequences, since I was getting tired of writing the generators by hand.

The basic syntax is: [` | [, generator*[, guard* [, let_binding*]]]`]

So things like this should compile:
```haskell
[x | x ← [1..10]]
[(x, y, z) | x ← [1, 2, 3, 4, 5, 6], y ← [4..4], let z = 7, x > 2]
[f x | f ← [λarg → 3 * arg, λid → id], x ← [1, 2, 3]]
```
These should be the same:
```haskell
[odd * even | odd ← [1, 3, 5, 7, 9], even ← [2, 4, 6, 8, 10]]
[o * e | o ← [1..10], e ← [1..10], odd o, even e]
```

The types, however, usually show up as `Native`. So that's kind of an issue. There's probably more things that I forgot.