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

Support and keyword in computation expression #690

Closed
nojaf opened this issue Feb 18, 2020 · 1 comment · Fixed by #693
Closed

Support and keyword in computation expression #690

nojaf opened this issue Feb 18, 2020 · 1 comment · Fixed by #693

Comments

@nojaf
Copy link
Contributor

nojaf commented Feb 18, 2020

Issue created from fantomas-ui

Support https://github.com/fsharp/fslang-design/blob/master/RFCs/FS-1063-support-letbang-andbang-for-applicative-functors.md

Code

// Reads the values of x, y and z concurrently, then applies f to them
parallel {
    let! x = slowRequestX()
    and! y = slowRequestY()
    and! z = slowRequestZ()
    return f x y z
}

Result

// Reads the values of x, y and z concurrently, then applies f to them
``parallel`` {
    let! x = slowRequestX()
    return f x y z }

Options

Fantomas Next - 3.2.0-2/10/2020

Name Value
IndentOnTryWith false
IndentSpaceNum 4
KeepNewlineAfter false
MaxIfThenElseShortWidth 40
PageWidth 120
ReorderOpenDeclaration false
SemicolonAtEndOfLine false
SpaceAfterComma true
SpaceAfterSemicolon true
SpaceAroundDelimiter true
SpaceBeforeArgument true
SpaceBeforeColon false
StrictMode false
@nojaf
Copy link
Contributor Author

nojaf commented Feb 18, 2020

Other examples:

// Outputs a + b, which is recomputed every time foo or bar outputs a new value,
// avoiding any unnecessary resubscriptions
observable {
    let! a = foo
    and! b = bar
    return a + b
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant