module Control.Monad.Ology.General.Extract where
import Control.Monad.Ology.General.Function
import Control.Monad.Ology.General.Inner
import Import
class MonadInner m => m where
mToValue :: Extract m
instance MonadExtract Identity where
mToValue :: Extract Identity
mToValue (Identity a
a) = a
a
instance Monoid p => MonadExtract ((,) p) where
mToValue :: Extract ((,) p)
mToValue (p
_, a
a) = a
a
instance MonadExtract (Either Void) where
mToValue :: Extract (Either Void)
mToValue (Left Void
p) = forall a. Void -> a
absurd Void
p
mToValue (Right a
a) = a
a