Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
F#-style addition, lightweight "inline" arrows #93
This idea is based on the example in the comment here: #89 (comment). Note: In the comment, ■ is used as a token placeholder to avoid bikehshedding on the actual token.
While some parts of this example could be converted into arrow-function syntax for the F# approach, we cannot concisely move
One option might be to introduce a lightweight "inline" arrow syntax using
While this could be limited to the RHS of
The grammar could be something like the following (though more time needs to be spent investigating necessary cover grammars):
This wouldn't be valid outside of
You can think of
let x = ...; let y = (a -> a * 2 + f(a))(x)
In general its the same behavior as
I'm like 70-30 against.
Additionally, I don't see much benefit for this compared to just using fat-arrows. We still have to type the