-
Notifications
You must be signed in to change notification settings - Fork 60
Discord module uses IO, add separate MTL module #112
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
Conversation
|
Using The disadvantage is that the |
|
I dislike this change for two reasons.
Not sure if it exists already, but a function like In the case of needing unliftio as an external dependency, couldn't discord-haskell variants of lifts be exported that, under the hood, are just calls to unliftio? Regardless, I think this would be a step back for the library. |
Yeah, it's a price of backwards-compatibility. Removing all the MTL stuff would be simpler, but would require more work for all the code written today. Saving backwards compatibility requires supporting two versions of the code.
I don't think this changes anything.
True. discord-haskell could also re-export the unliftio stuff. The current version re-exports Another thing in favor of your point is that importing unliftio fixes my pain point with the MTL stuff. I really don't like Roughly my conclusion is that if I could go back I would not have introduced the ReaderT. But since it's here, it's not big enough of a problem to justify breaking backwards compatibility to change it. The best solution is probably adding more docs about ReaderT to the readme. |
|
Closing this, as mentioned. Might add some notes about the ReaderT into the Readme. |
All the existing code can change
import Discordintoimport DiscordMonadTransformerLibraryand will compile and run correctly.New code (and examples) can use the new
import Discordto getIO ()based functions, instead ofDiscordHandler = ReaderT DiscordHandle IO.The long and explicit name is make
import Discordthe clear default UI to the library, so it's easy as possible for those newer to the haskell language.An alternate design I considered was leaving
import Discordas is, and adding aDiscord.IOmodule for theIOutilities. This is nice because old code works with no change, but could be confusing.