Replies: 1 comment 2 replies
-
|
Use |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Use of
Streamly.FileSystem.File.readFilewill not result in any compiler warning/error, even though it is an operation with the potential for errors (e.g. a filenotfound will result in an exception).I currently have a wrapper over
readFilewhich will catch (usingStream.handle) anIOExceptionand then throw aneffectfulErrorwhich MUST be handled by the caller (otherwise compilation will fail). HOWEVER this solution inhibits stream fusion :(Is it possible to have a variant of
readFilethat has some explicit error returning (perhaps anEither)?tl;dr: I am looking for the best of both worlds, how to have a version of
readFilewith 1. errors that MUST be handled by the caller and 2. still has good performance.Beta Was this translation helpful? Give feedback.
All reactions