-
Notifications
You must be signed in to change notification settings - Fork 4
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
Effect system integrations #4
Comments
Since I've split servant and haxl into their own issues, I'm claiming this issue for effect system integrations. This includes:
and perhaps others. |
I imagine this will eventually look something like the following:
|
There are currently a lot of dependency circles involving MockT in HMock's implementation, so the real trick here is going to be finding the best way to disentangle all of this stuff that shares as much of the test writer experience as possible while still working for different effect systems. In particular, we need to be able to share the expectation combinators: I have deliberately left HMock in a pre-1.0 version number, and warned people to use upper bounds on dependencies, in anticipation of needing to make significant changes so that this will work. |
Migrated from TODO file.
There are a lot of libraries in Haskell that can be used to define an API to some external system. Ideally, there would be a way to mock all of these with HMock. This includes:
polysemy
,fused-effects
,freer-simple
, andeff
.haxl
andservant
This needs some serious thought about how to separate mtl-isms from the more reusable core of HMock, so that as much as reasonable can be shared with other systems. I suppose the right way to go about this is to take a few examples, ask how you'd reimplement HMock for that specific system, and then look for the right refactorings to share the common bits. The HMock core expectation language, surface expectation language, and most of the
MockableBase
class should hopefully be shared.Many of these systems already have their own action types, which could be trivially wrapped rather than deriving a new
Action
class. This might mean thatAction
should be an injective type family rather than a data family. However, we might need to lose some type safety for this to occur, since the method name isn't encoded into the type any longer. This definitely might interfere with any type tricks of the sort I'm contemplating to implement polymorphic return values, too.The text was updated successfully, but these errors were encountered: