concrete functor and monad transformers

#22Removal of Either orphan instances not listed in changelog, incorrectly identified in comments

In 0.5.0.0, the orphan instances Alternative (Either e) and MonadPlus (Either e) were removed. This change is not listed in the changelog.

Additionally, the source indicated that these instances were moved to base, but that is not the case (only the IO instances were moved).

  • This is worse than I though: the removal is only present on GHC 8. So you can have a library that works fine with GHC 7.10 and transformers 0.5, and even with GHC 8 and transformers 0.4, but fails with GHC 8 and transformers 0.5! The only fix for a library author is very specific CPP pragmas.

    I'd suggest either removing the instance for all GHC/base versions, or adding it back for GHC 8. Ideally this would be done before GHC 8 ships and included in the bundled transformers version.

  • Now that these two instances are back in, the cleanest solution is probably to do another release and include it in GHC 8.0.

    BTW, there is another workaround: to avoid Control.Monad.Trans.Error, which has been deprecated since 0.4.

  • Thanks for the quick response! Doing another release and getting it into GHC 8.0 seems like the best course of action. Should I raise a GHC ticket for that somewhere, or can you include a new version into GHC yourself?

    Regarding avoiding Error: that's the plan in the long term, sadly there are two issues:

    • This would be a breaking change, since sadly the type synonym containing the Either is exposed to users. So I'd rather get a maintenance release out first which works with GHC 8.
    • We didn't see the warnings about this. As far as I can see, we just use Either, and get the instance through mtl (Reader, State and Writer all import it). So this was the first time I realized we were using the deprecated module.
  • Hmm, the orphan instances are leaking through the .Class modules in mtl.

    I've made a new release and the GHC folk say they can include it.

    But I'd recommend that you migrate away from using those two instances: they rely on the Error class, which won't last indefinitely.

    • status set to closed

    Thanks! And yes, I do plan on migrating away from Error in the next major release of fclabels.