-
Notifications
You must be signed in to change notification settings - Fork 156
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
pipe map operator #469
Comments
ref satyr/coco#187 |
Coco definitely seems to be on-par with Perl in terms of syntax. What's wrong with |
One of coco's principle is "Perl over Ruby.", so it makes sense. |
Remembered #319 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I seem to specialize in reporting feature requests that I find interesting but even I am not entirely convinced by.
In this case it's the idea of vector pipes, AKA
|> map
. I like the idea of being able to represent this action with a single operator.:>
fits because it looks like|>
and:
looks a bit like an array of little dots (cute).When we want to pipe we will soon want to flatten so we can extend this syntax so that
.>
means|> concat-map
and.:>
means|> (concat-map . map)
etcetera.So that for example
x .:..:> f
means map f over the 5-deep array x, flattening the top three and bottom two levels togethere.g.
I don't think that there are that many places in people's code involving 5-deep arrays but the syntax pleases me so I thought I would suggest it.
Finally. You could add a
|
to make the syntax more robust to ambiguity:|:>
,|.:>
, and so on. With this addition it is easier to safely add more to the syntax such as mapping over objects without being too greedy with the syntax-space.The text was updated successfully, but these errors were encountered: