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

Suggesting to highlight the let bound value, asyncResult to aid auto-importing the open FsToolkit.ErrorHandling library in the file. #688

Open
aguluman opened this issue Aug 6, 2024 · 2 comments

Comments

@aguluman
Copy link

aguluman commented Aug 6, 2024

I have attached 3 images of my experience trying to auto-import open FsToolkit.ErrorHandling in my projct file,

Image one
image

image two
image

image three
image

I hope these examples help you understand the issue being raised here.

@aguluman aguluman changed the title Suggesting to highlight the let boud value, asyncResult to aid auto-importing the open FsToolkit.ErrorHandling library in the file. Suggesting to highlight the let bound value, asyncResult to aid auto-importing the open FsToolkit.ErrorHandling library in the file. Aug 6, 2024
@auduchinok
Copy link
Collaborator

@aguluman Thank you for writing about it! Could you please share a small repro project, so it would be easier to reproduce the exact scenario that you see?

@aguluman
Copy link
Author

aguluman commented Aug 6, 2024

Hello @auduchinok here a project repo, https://github.com/aguluman/TimeTrackingExercise, I am working on, you can clone and use it. Go to the Features folder in the Accounting and the Rental Project.

You will see this code in Accounting\Features etc,
`namespace Accounting.Features

open System
open Accounting
open Accounting.Wallet
open FsToolkit.ErrorHandling

[]
module CreateWallet =
type Data = { UserId: UserId }

let execute (persistWalletEvent: WalletEvent -> Async<unit>) (getInstant: unit -> Instant) walletId (data: Data) =
    asyncResult {
        do!
            persistWalletEvent
                { WalletEvent.WalletId = walletId
                  UserId = data.UserId
                  EventId = Guid.NewGuid()
                  Data = WalletEventData.Created
                  Instant = getInstant () }
    }

`

I hope it helps you to understand.

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

No branches or pull requests

2 participants