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

Define MonadClientUIFrontend monad that communicates with the frontend #266

Open
Mikolaj opened this issue Aug 28, 2021 · 1 comment
Open

Comments

@Mikolaj
Copy link
Member

Mikolaj commented Aug 28, 2021

Then the current MonadClientUI can only read and write to UI session state (and read form client and main game states) and probably most of the code will remain in MonadClientUI, making it easier to test and perhaps suggesting refactorings that minimize MonadClientUIFrontend usage.

Bonus points if liftIO can be removed from MonadClientRead after this change, so that mocking is easier and more obviously safe.

@Mikolaj
Copy link
Member Author

Mikolaj commented Aug 28, 2021

I'm surprised this is not done already, so there may be some good reasons I forgot. But probably the MonadClientUI code was not as large and nasty last time I considered that.

[Edit: possibly, almost everywhere the frontend is called directly or indirectly. If so, that's a challenge and the new monad class will help monitor success in unravelling that. Getting rid of liftIO will be useful regardless.]

[Edit2: no, it's not so bad, e.g., all the messages-related code does not touch the frontend.]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant