Skip to content
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

Pipeline + arrow function grammar #60

Closed
littledan opened this issue Sep 30, 2017 · 5 comments
Closed

Pipeline + arrow function grammar #60

littledan opened this issue Sep 30, 2017 · 5 comments

Comments

@littledan
Copy link
Member

In the explained and babel implementation, cases like x |> y => z are permitted. The current grammar does not permit these, throwing a syntax error. It seems like a useful case, but I haven't figured out how to spec it.

@littledan
Copy link
Member Author

Cc @waldemarhowat @jridgewell @hzoo @gilbert

@jridgewell
Copy link
Member

Is this the parenthesis vs no parenthesis thing we talked about? If so we can lock down how Babylon parses it.

@danny-andrews
Copy link

Not sure if there's an issue for this already, or if this is a bug with babel, but I'm having an issue with the opposite. This:

const RightReaderPromise = a => (a |> Either.Right |> ReaderPromise.of);

Gives:

  return a |> _monet.Either.Right |> _readerPromise2.default.of;
            ^

SyntaxError: Unexpected token >

@jridgewell
Copy link
Member

jridgewell commented Dec 13, 2017

It's a bug with your babel setup, you have to enable the transform. This is not the right thread for that.

@tabatkins
Copy link
Collaborator

Closing this issue, as the proposal has advanced to stage 2 with Hack-style syntax. We're still working on the precise details of some precedence issues, but at least putting arrow functions in pipe bodies is a lot less common of a thing to do now, so it's a much smaller issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants