IagoAbal/haskell-z3

MonadZ3 for ReaderT

Closed this issue · 1 comments

I currently have

instance MonadZ3 m => MonadZ3 (ReaderT r m) where
  getSolver = ReaderT $ const getSolver
  getContext = ReaderT $ const getContext

in my code base which is a pretty straightforward implementation. But:

  1. It's an orphan instance.
  2. It can probably be useful for somebody else if they wish to carry additional context around MonadZ3.

I probably wouldn't have considered wasting time discussing this and just opened a PR with these three lines straight ahead, but I noticed 3ec14bc, so I thought it's worth double-checking if it's a desirable direction, and, if so, if it's the best way to implement this change.

So, what are your thoughts on this?

Actually disregard that. For some reason I thought that it'd require bringing mtl dependency back, which obviously isn't the case. Feel free to close!