-
Notifications
You must be signed in to change notification settings - Fork 13
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
feat: instance MonadLogic
for WriterT
#33
Conversation
Old GHCs were removed from cabal files and CI as a result of the mtl version upgrade. |
May I ask who are "we" making decisions here? I appreciate your contribution, but please wrap the new instance (and tests) into |
Sorry, I am typing the text via machine translation DeepL so the first person is not stable. I understand that logict's policy is to try to support older GHCs as well. I will make the correction as you suggest next time I get time to work on it. |
I tested |
MonadLogic
for WriterT
MonadLogic
for WriterT
FWIW I'll accept a (separate) PR, dropping support of GHC < 8.0. |
I'll try some more... |
Maybe, It's OK. |
Thanks, LGTM. Could you please rebase? |
I have implemented `MonadLogic` in `WriterT` as well. Until now, `WriterT` should not be used because it easily causes space leaks. However, [Control.Monad.Trans.Writer.CPS](https://www.stackage.org/haddock/nightly-2022-12-08/transformers-0.5.6.2/Control-Monad-Trans-Writer-CPS.html) no longer causes space leaks and can be used. Therefore, we would like to use `WriterT`, but it is inconvenient if it cannot be combined with `MonadLogic`. Therefore, I implemented it and added tests where `ReaderT` and `StateT` are tested. To use the CPS version of `WriterT`, I raised the mtl version requirement to [feat(Control.Monad.Writer.CPS): re export runWriterT by ncaq · Pull Request #136 · haskell/mtl](haskell/mtl#136) has not yet been imported, so we have no choice but to rely directly on transformers. In the end, mtl depends on transformers, so we have determined that this is not a critical problem. We have taken care to make it easy to remove them when they are no longer needed by doing a limited `import`.
dfd5085
to
10dbf8f
Compare
I did a git rebase. |
Great, thanks @ncaq! |
I have implemented
MonadLogic
inWriterT
as well.Until now,
WriterT
should not be used because it easily causes space leaks. However, Control.Monad.Trans.Writer.CPS no longer causes space leaks and can be used. Therefore, we would like to useWriterT
, but it is inconvenient if it cannot be combined withMonadLogic
.Therefore, I implemented it and added tests where
ReaderT
andStateT
are tested.To use the CPS version of
WriterT
, I raised the mtl version requirement to feat(Control.Monad.Writer.CPS): re export runWriterT by ncaq · Pull Request #136 · haskell/mtl has not yet been imported, so we have no choice but to rely directly on transformers. In the end, mtl depends on transformers, so we have determined that this is not a critical problem. We have taken care to make it easy to remove them when they are no longer needed by doing a limitedimport
.I was surprised myself that many of the CPP macros in the test code were removed. It was not my intention.
I believe it was probably done by the HLS plugin.
I've been trying to find out why it deleted them. I found out that the new mtl raises the lower limit for the base library in the cabal file. So when raising the lower version limit of mtl, we thought that it is certainly not a very effective practice to control the base version here. Therefore, we decided to leave the deleted part as it is.