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

suggestion: add explicit type param to ignore to allow specifying type #299

Open
joprice opened this issue Jan 6, 2025 · 2 comments
Open
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@joprice
Copy link
Contributor

joprice commented Jan 6, 2025

It would be convenient to have an explicit type parameter on ignore:

let inline ignore<'a> (x: Task<'a>) =
        x
        |> map ignore

This allows being more strict by specifying the data that's intended to be discarded.

This is similar to the recommendation to supply a type to the string function so it is tolerant to type refactors https://g-research.github.io/fsharp-analyzers/analyzers/TypeAnnotateStringFunction.html

@TheAngryByrd TheAngryByrd added enhancement New feature or request good first issue Good for newcomers labels Jan 7, 2025
@TheAngryByrd
Copy link
Collaborator

Agreed! Would you like to send a PR for this?

@joprice
Copy link
Contributor Author

joprice commented Jan 7, 2025

Done! Let me know if there's anything else to do. I can add a test if you think it's worth it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants