-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
List comprehensions #277
Comments
This paper: https://arxiv.org/abs/1408.1675 talks about forward / backward slicing for set/bag comprehensions. For lists, the complications related to repeatable indexing (that are addressed in the paper using prefix codes) should be avoidable. It also might be interesting to generalize the treatment of "partial collections" to an ordered setting - in the paper, a bag or row can have a "row" or "rest of bag" hole representing unbounded other elements that we don't care about. For lists, we might want partial values to be things of the form [1, □,3] ++ □ ++ [6,7,8] ++ □ ... i.e. with multiple "sublist" holes. If arbitrary computations over lists are allowed, then encountering such a hole probably means you have to give up, but if you know you are doing a map, then you can take advantage of the independence of the different iterations. |
@min-nguyen Ok, looks like you’ve made good progress mocking up the list comprehension and convolution examples to see how they would look in Fluid. The next thing to do is to get the implementation compiling and tests running on your laptop. This should just be a question of making sure Node is installed and then running Once the tests are running locally a good starting task will be changing the grammar to replace the Unicode right arrow by ->. This means making the appropriate changes to If you get stuck I’ll be able to help out on Monday. Once this workflow is in place we can start thinking about the changes needed to support list comprehensions. |
@min-nguyen Good to see progress on
Bit busy today but get me on Slack if you need to. |
The simplest list comprehension notation we can get away with to support #276. Ranges of the form
[e_1..e_2]
are covered by #278.fluid/example/list-comprehension.fld
implement fwd and bwd slicing rules for comprehensions– see Forward and backward slicing for desugaring #391ListComp
should have non-empty list of qualifiersThe text was updated successfully, but these errors were encountered: