Add a `maybe` function for `MaybeT` like the `except` for `ExceptT`
I definitely support this, however, should it be named maybe? as it would clash with maybe.
Perhaps maybeT?
We can rely on qualified imports to disambiguate, at least. I would expect the naming to be the same as is used for ExceptT, which would be to follow @garyb’s proposal for the name
:-1: to both maybe and maybeT. When I see a function with the lowercase name of a type, I expect that function to be a destructor (bool, maybe, either, etc).
In Haskell this function is called hoistMaybe. Why doesn't that work?
If readability/succinctness is an issue, something like the following might work
class Hoist m n a | m -> a, m -> n where
hoist :: n a -> m a
instance Hoist (MaybeT m) Maybe a where -- ...
instance Hoist (ExceptT e m) (Either e) a where -- ...