Repository navigation
Remove re-exports of Control.Monad, ... - #99
Conversation
a44cd3a to
930cda7
Compare
|
I'd actually prefer to not re-export |
... Control.Monad.Fix and Data.Monoid modules. Import Identity, MonadIO, MonadTrans explicitly in Control.Monad.Identity, Control.Monad.Trans and other modules to avoid potential future API fluctuations.
930cda7 to
cba4b82
Compare
|
@phadej approved with one small grammatical wibble |
|
LGTM pending Emily's comments. |
Co-authored-by: Emily Pillmore <[email protected]>
|
I've noticed some breakage due to this change. See #101. |
|
E.g. Having an explicit set list of re-exports is an option too. Though #68 would repeat when e.g. |
| import Control.Monad.Writer.Class | ||
|
|
||
| import Control.Monad.Trans | ||
| import Control.Monad.Trans (MonadTrans (lift)) |
There was a problem hiding this comment.
Control.Monad.Trans used to re-export MonadIO(liftIO) too. I don't think that is a good idea. MonadTrans(lift) is somewhat justified, but MonadIO seems to be there out-of-blue.
|
Re explicit export list: Note that msum :: MonadPlus m => [m a] -> m awhich changed its type to msum :: (MonadPlus m, Foldable t) => f (m a) -> m aalso Also the We could either:
All of these would still preserve a potential problem that a future TBH, I looks like there are only bad options
Long term the latter is better, but right now is quite a bad moment for that :( |
|
I think it would be fine to drop support for some older GHCs, eg 7.x. If
type signatures still shift, we should try to find the most compatible one,
probably by testing with some affected packages.
Oleg Grenrus ***@***.***> schrieb am Fr., 19. Nov. 2021,
16:35:
… Re explicit export list: Note that Control.Monad has functions like:
msum :: MonadPlus m => [m a] -> m a
which changed its type to
msum :: (MonadPlus m, Foldable t) => f (m a) -> m a
also foldM is similarly Foldable-generalized. Also forever, guard are
generalized to Applicative / Alternative.
Also the <$!> is present since base-4.8.0.0 only.
We could either:
1. not re-export these functions
2. redefine them to always have "new" types
3. drop support from pre-AMP GHCs.
All of these would still preserve a potential problem that a future base
change would force a major version of mtl due change in type. (Or mtl
could continue to re-export the name with an old type, if possible).
------------------------------
TBH, I looks like there are only bad options
- Try to not break downstream, making maintenance harder (the base <5
bound won't cut, has to be reviewed every major base release, if there
are explicit re-export lists)
- Annoy folks buy cleaning up the API surface.
Long term the latter is better, but right now is quite a bad moment for
that :(
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#99 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA36VCZM27BRPS7JE4S5PV3UMZVDXANCNFSM5IAF776A>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
|
As I said, this will just delay the "inevitable". Folks shouldn't import I'd rather do this right at once. If now is a bad moment (due |
I don't understand this. It seems quite viable to find a set of re-exports that would substantially reduce the breakage I reported in #101, and at the same time avoid the PVP problems reported in #68. In principle I agree that I'm not fundamentally opposed to getting rid of the re-exports eventually, but I think it should be done separately from the migration to |
This is "break big but rarely" vs. "break often in small parts" trade-off. In general people prefer no breakages at all.
For the removal of re-exports change the migration is adding import Control.Monadlike import on top of import Control.Monad.ReaderNot painful. Requires more packages to be patched, but if we are going to do that anyway, why not now? Anyway. I won't write a patch for a set of re-exports that..., and I'm fine with this patch being reverted if it's a blocker for release of |
... Control.Monad.Fix and Data.Monoid modules.
Import Identity and MonadIO explicitly
in Control.Monad.Identity and Control.Monad.Trans
to avoid potential future API fluctuations.
Resolves #68