TruePath
TruePath copied to clipboard
Separate NuGet for IO methods (`TruePath.Extensions.IO`)
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()