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

Multiline let bang should have newline before #838

Closed
nojaf opened this issue May 16, 2020 · 0 comments · Fixed by #840
Closed

Multiline let bang should have newline before #838

nojaf opened this issue May 16, 2020 · 0 comments · Fixed by #840

Comments

@nojaf
Copy link
Contributor

nojaf commented May 16, 2020

Issue created from fantomas-online

There is still an inconsistency when it comes to computation expressions.
If the first expression was short and the second long, it should have a newline between the first and second.

In general, Fantomas add newlines between multiline constructs and this doesn't apply here.

Code

let AddEvents (req: HttpRequest, log: ILogger) =
    task {
        let! user = req.Authenticate(log)
        let! response =
            user
            |> Result.mapError sendUnAuthorizedRequest
            |> Result.bind (decodeEvents req.Body)
            |> Result.bind (validateEvents)
            |> Result.bind (authenticateEvents)
            |> Result.map (persistEvents)
            |> Result.either

        return response
    }

let AddEventsX (req: HttpRequest, log: ILogger) =
        let user = req.Authenticate(log)
        let response =
            user
            |> Result.mapError sendUnAuthorizedRequest
            |> Result.bind (decodeEvents req.Body)
            |> Result.bind (validateEvents)
            |> Result.bind (authenticateEvents)
            |> Result.map (persistEvents)
            |> Result.either

        response

Result

let AddEvents (req: HttpRequest, log: ILogger) =
    task {
        let! user = req.Authenticate(log)
        let! response =
            user
            |> Result.mapError sendUnAuthorizedRequest
            |> Result.bind (decodeEvents req.Body)
            |> Result.bind (validateEvents)
            |> Result.bind (authenticateEvents)
            |> Result.map (persistEvents)
            |> Result.either

        return response
    }

let AddEventsX (req: HttpRequest, log: ILogger) =
    let user = req.Authenticate(log)

    let response =
        user
        |> Result.mapError sendUnAuthorizedRequest
        |> Result.bind (decodeEvents req.Body)
        |> Result.bind (validateEvents)
        |> Result.bind (authenticateEvents)
        |> Result.map (persistEvents)
        |> Result.either

    response

Options

Fantomas Next - 4.0.0-alpha-001-1/1/1990

Name Value
IndentSpaceNum 4
PageWidth 120
SemicolonAtEndOfLine false
SpaceBeforeParameter true
SpaceBeforeLowercaseInvocation true
SpaceBeforeUppercaseInvocation false
SpaceBeforeClassConstructor false
SpaceBeforeMember false
SpaceBeforeColon false
SpaceAfterComma true
SpaceBeforeSemicolon false
SpaceAfterSemicolon true
IndentOnTryWith false
SpaceAroundDelimiter true
MaxIfThenElseShortWidth 40
MaxInfixOperatorExpression 50
MaxRecordWidth 40
MaxArrayOrListWidth 40
MaxLetBindingWidth 40
MultilineBlockBracketsOnSameColumn false
NewlineBetweenTypeDefinitionAndMembers false
StrictMode false
nojaf added a commit to nojaf/fantomas that referenced this issue May 17, 2020
nojaf added a commit that referenced this issue May 21, 2020
* Extend LetOrUseBang to deal with short expression followed by a multiline expression. Fixes #838

* Start refactoring of computation expressions.

* Added additional ComputationExpressionTests.

* Some more CE tests

* Removed unused code
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