Skip to content

"Break early" from monad CE #135

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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