Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Split up HasServer, HasClient #1731

Open
fisx opened this issue Apr 8, 2024 · 2 comments
Open

Split up HasServer, HasClient #1731

fisx opened this issue Apr 8, 2024 · 2 comments

Comments

@fisx
Copy link
Member

fisx commented Apr 8, 2024

For unit-testing, we need HasClient instance that gives us clientWithRoute, but the instance does not require a RunClient instance.

The easy solution is to write a RunClient instance using undefined, but it would be nicer to keep separate things separate:

type HasClient m api = (RunClient m, HasClient' m api)
class HasClient' m api where ...

... and then require RunClient where necessary in order to implement the HasClient' instance, instead of in the class.

Any concerns or objections? If not I may make a PR.

(ping @pcapriotti)

@fisx
Copy link
Member Author

fisx commented Apr 8, 2024

the down side i guess is that the constraints will say HasClient, and the instances will be of HasClient'. not entirely pretty.

@fisx
Copy link
Member Author

fisx commented Apr 8, 2024

or we could drop HasClient and always add an explicit RunClient where needed, also where the instance is used?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant