Closed guibou closed 4 years ago
@gbataille please review.
Most of the changes are just change of interface: concrete ReaderT KrankConfig IO t
becomes 'MonadKrank m => m tand renamed effects (e.g.
asks->
krankAsks`)
The MonadKrank
interfaces extracts all the effect and the two implementations realizes them. The instace for Krank
just restores the previous effect when the instance for KrankTest
mock them in a pure context.
looks a bit heavy but I think that's the pattern we need. What I like is that the effects are documented, and therefore easily mocked/replaced
LGTM
This deprecates #52
This typeclass represents all the effect that krank needs to do in order to function.
We have two instances:
This also introduce two new tests in order to show the idea. More tests will come.