haskell / mtl

The Monad Transformer Library
http://www.haskell.org/haskellwiki/Monad_Transformers
Other
366 stars 65 forks source link

No MaybeT #6

Closed adek05 closed 11 years ago

adek05 commented 11 years ago

Why there is no MaybeT transformer in library? There is a implemenation of it here: http://www.haskell.org/haskellwiki/New_monads/MaybeT Why not to put it inside?

ekmett commented 11 years ago

It is already in transformers and mtl depends on transformers.

There is no class required for MaybeT, however. It is described entirely by MonadPlus

Just import Control.Monad.Trans.Maybe.

ekmett commented 11 years ago

A case might be made that perhaps we should offer a Control.Monad.Maybe to re-export it here though.

adek05 commented 11 years ago

Actually the case is that it will not offer these lovely instances which avoid have usage of lifting common in transformers library.

ekmett commented 11 years ago

If we're missing instances for lifting over MaybeT then I should definitely fix that. It just doesn't have/need a class of its own.

ekmett commented 11 years ago

They are all here. e.g. there is already an

instance MonadState s m => MonadState s (MaybeT m)

etc.

sdroege commented 9 years ago

They are in the MaybeT package, but the version in transformers does not have them. Compare: https://hackage.haskell.org/package/MaybeT-0.1.2/docs/Control-Monad-Maybe.html https://hackage.haskell.org/package/transformers-0.4.2.0/docs/Control-Monad-Trans-Maybe.html

For example the above mentioned MonadState s m => MonadState s (MaybeT m) is not there in the transformers version.

sdroege commented 9 years ago

Ah nevermind. The instances are on MonadState (etc) in mtl.