guibou / krank

Krank checks your code source comments for important markers
BSD 3-Clause "New" or "Revised" License
21 stars 3 forks source link

Introducing MonadKrank #55

Closed guibou closed 4 years ago

guibou commented 4 years ago

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.

guibou commented 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.

gbataille commented 4 years ago

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