concrete functor and monad transformers

#60Require Alternative rather than MonadPlus for `m` in StateT Alternative instance

Hi there,

I'm fairly new to Haskell so I'm likely missing a lot, but I've made this change in a fork: https://hub.darcs.net/bradparker/transformers/patch/56cc76e31f67751fe324b31bb14ff065c95e48ed (also attached).

I came across the MonadPlus requirement when playing around with this: https://gist.github.com/bradparker/b4a7624399754d398b57af35a001e1d4#file-parser-hs-L14-L30

Just thought I'd submit the change in case it was useful / easy to accept.

The oldest GHC/Base I've tested with is 7.10.3/4.8.2.0 which I suspect may not be sufficient.

Thanks :)

Issue Bundle
  • This would raise compatability issues with old versions of base, but I also wonder how useful it would be: the Applicative instance needs Monad m, so the Alternative instance would too, and does anything have Monad+Alternative but not MonadPlus?

    • status set to closed

    Thanks for having a look :)

    I don't know about any types which have Monad+Alternative but not MonadPlus. This did give me an opportunity to have a better look at the differences between MonadPlus and Alternative. It looks like the left catch law might be pretty important for the specific use case I was trying out (even if not applicable for all MonadPlus instances).

    Was also happy to have had a dig around, seeing type Errors e = Lift (Constant e) was particularly cool.

    Thanks again.