| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Control.Monad.Ology.General.Inner
Synopsis
- class (Traversable m, MonadException m) => MonadInner (m :: Type -> Type) where
- retrieveInner :: m a -> Result (Exc m) a
- mToMaybe :: MonadInner m => m a -> Maybe a
- commuteInner :: (MonadInner m, Applicative f) => m (f a) -> f (m a)
Documentation
class (Traversable m, MonadException m) => MonadInner (m :: Type -> Type) where Source #
Monads that can compose as the inner monad with any outer monad to make a monad.
See ComposeInner.
Instances of this type are isomorphic to Either P (Q,a) for some types P and Q (with Monoid Q).
Must satisfy:
retrieveInner (fmap f w) = fmap f (retrieveInner w)
case retrieveInner w of {Left w' -> fmap absurd w'; Right a -> fmap (\_ -> a) w;} = w
Methods
retrieveInner :: m a -> Result (Exc m) a Source #
Instances
mToMaybe :: MonadInner m => m a -> Maybe a Source #
commuteInner :: (MonadInner m, Applicative f) => m (f a) -> f (m a) Source #