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
withRunInIO
as the foundation of the library
#13
Comments
snoyberg
added a commit
that referenced
this issue
Jan 2, 2018
I like it. I'd like to do this in two phases, first with a non-breaking change moving this into the typeclass, and second with a breaking change. That will make it easy to write code that works with both the old and the new version. I'm going to open up a PR with that first bit. |
snoyberg
added a commit
that referenced
this issue
Jan 2, 2018
I'm going to skip the breaking change part and consider this done, thanks again! |
No problem, thanks for the great library! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
After my recent pull request gets merged, there will be no uses of
withUnliftIO
in the codebase. Instead it will beeverywhere. I think, the library should be build around this function instead of
askUnliftIO
. Consider a type class with a very similar shape:It's not something like
This would be less readable and more clunky.
So I think it should be
Regarding laws for
withRunInIO
, how about this one:?
Having both
withRunInIO
andaskUnliftIO
in the type class along with aMINIMAL
pragma is an option, but to me it looks like it complicates the library. It is more convenient to definewithRunInIO
thanaskUnliftIO
, because there are no newtypes involved:I also like that
return
is not used in the definition ofwithRunInIO
. This makes it possible to generalizeMonadUnliftIO
to other things, maybe some functors. Just in a case.All in all, I think,
withRunInIO
is the way to go.The text was updated successfully, but these errors were encountered: