-- | -- This module provides the following instances: -- -- * @instance 'Monad' m => 'Applicative' ('StateT' s m)@ -- -- * @instance 'MonadPlus' m => 'Alternative' ('StateT' s m)@ module StateInstances where import Control.Applicative import Control.Monad.State instance Monad m => Applicative (StateT s m) where pure = return (<*>) = ap instance MonadPlus m => Alternative (StateT s m) where empty = mzero (<|>) = mplus