Skip to content

"Break early" from monad CE #135

@cmeeren

Description

@cmeeren

I have a result CE in Cvdm.ErrorHandling for monadic error handling. For the example below, sideEffect1 and sideEffect2 are never invoked, since do! binds an error (I think also Delay is involved, but I don't have a clear grasp of CE builders).

let _ = result {
  if true then
    do! Error err
    sideEffect1 ()
  sideEffect2 ()
}

However, if I replace result with monad (or monad.fx or others, I've tried them all), the side effects are invoked.

Is it possible to get my desired behavior using a generic CE from FSharpPlus?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions