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

Separate NuGet for IO methods (TruePath.Extensions.IO) #86

Open
ForNeVeR opened this issue Jul 30, 2024 · 0 comments
Open

Separate NuGet for IO methods (TruePath.Extensions.IO) #86

ForNeVeR opened this issue Jul 30, 2024 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@ForNeVeR
Copy link
Owner

Slowly but surely, constant mentioning of .Value when performing file IO becomes a nuisance. One example I had just now:

let ReadValue (filePath: LocalPath) (key: string): Task<string> = task {
    let! toml = File.ReadAllTextAsync filePath.Value

Our path types lack implicit conversion to string (for a reason!), and thus you have to call .ToString() or .Value to convert them before passing to the system file-related API.

I propose we introduce a new package, say TruePath.Extensions.IO to provide some extension methods over our paths, so that this example would look like

let ReadValue (filePath: LocalPath) (key: string): Task<string> = task {
    let! toml = filePath.ReadAllTextAsync()
@ForNeVeR ForNeVeR added enhancement New feature or request help wanted Extra attention is needed labels Jul 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant