    {-# OPTIONS_GHC -fno-warn-orphans -fno-warn-warnings-deprecations #-}
    {-# LANGUAGE CPP            #-}

    -- Note re: "-fno-warn-warnings-deprecations" above: transformers has
    -- deprecated Control.Monad.Trans.Error (which we like) but we are going to
    -- provide an ErrorT instance for compatibility until the deprecated modules
    -- are removed.

    module Snap.Internal.Instances () where
    ------------------------------------------------------------------------------
    import           Control.Monad.Trans.Class         (MonadTrans (lift))
    #if !MIN_VERSION_transformers(0,6,0)
    import           Control.Monad.Trans.Error         (Error, ErrorT)
    #endif
    #if MIN_VERSION_transformers(0,4,0)
    import           Control.Monad.Trans.Except        (ExceptT)
    #endif
    #if !MIN_VERSION_transformers(0,6,0)
    import           Control.Monad.Trans.List          (ListT)
    #endif
    import           Control.Monad.Trans.Reader        (ReaderT)
    import qualified Control.Monad.Trans.RWS.Lazy      as LRWS (RWST)
    import           Control.Monad.Trans.RWS.Strict    (RWST)
    import qualified Control.Monad.Trans.State.Lazy    as LState (StateT)
    import           Control.Monad.Trans.State.Strict  (StateT)
    import qualified Control.Monad.Trans.Writer.Lazy   as LWriter (WriterT)
    import           Control.Monad.Trans.Writer.Strict (WriterT)
    import           Snap.Internal.Core                (MonadSnap (..))
    #if !MIN_VERSION_base(4,8,0)
    import           Data.Monoid                       (Monoid)
    #endif
    ------------------------------------------------------------------------------

    ------------------------------------------------------------------------------
    #if !MIN_VERSION_transformers(0,6,0)
    instance (MonadSnap m, Error e) => MonadSnap (ErrorT e m) where
        liftSnap = lift . liftSnap

    ------------------------------------------------------------------------------
    instance MonadSnap m => MonadSnap (ListT m) where
        liftSnap = lift . liftSnap
    #endif

    #if MIN_VERSION_transformers(0,4,0)
    instance (MonadSnap m, Monoid e) => MonadSnap (ExceptT e m) where
        liftSnap :: forall a. Snap a -> ExceptT e m a
    liftSnap = m a -> ExceptT e m a
    forall (m :: * -> *) a. Monad m => m a -> ExceptT e m a
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
    (MonadTrans t, Monad m) =>
    m a -> t m a
    lift (m a -> ExceptT e m a)
    -> (Snap a -> m a) -> Snap a -> ExceptT e m a
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Snap a -> m a
    forall a. Snap a -> m a
    forall (m :: * -> *) a. MonadSnap m => Snap a -> m a
    liftSnap
    #endif

    ------------------------------------------------------------------------------
    instance (MonadSnap m, Monoid w) => MonadSnap (RWST r w s m) where
        liftSnap :: forall a. Snap a -> RWST r w s m a
    liftSnap = m a -> RWST r w s m a
    forall (m :: * -> *) a. Monad m => m a -> RWST r w s m a
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
    (MonadTrans t, Monad m) =>
    m a -> t m a
    lift (m a -> RWST r w s m a)
    -> (Snap a -> m a) -> Snap a -> RWST r w s m a
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Snap a -> m a
    forall a. Snap a -> m a
    forall (m :: * -> *) a. MonadSnap m => Snap a -> m a
    liftSnap

    ------------------------------------------------------------------------------
    instance (MonadSnap m, Monoid w) => MonadSnap (LRWS.RWST r w s m) where
        liftSnap :: forall a. Snap a -> RWST r w s m a
    liftSnap = m a -> RWST r w s m a
    forall (m :: * -> *) a. Monad m => m a -> RWST r w s m a
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
    (MonadTrans t, Monad m) =>
    m a -> t m a
    lift (m a -> RWST r w s m a)
    -> (Snap a -> m a) -> Snap a -> RWST r w s m a
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Snap a -> m a
    forall a. Snap a -> m a
    forall (m :: * -> *) a. MonadSnap m => Snap a -> m a
    liftSnap

    ------------------------------------------------------------------------------
    instance MonadSnap m => MonadSnap (ReaderT r m) where
        liftSnap :: forall a. Snap a -> ReaderT r m a
    liftSnap = m a -> ReaderT r m a
    forall (m :: * -> *) a. Monad m => m a -> ReaderT r m a
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
    (MonadTrans t, Monad m) =>
    m a -> t m a
    lift (m a -> ReaderT r m a)
    -> (Snap a -> m a) -> Snap a -> ReaderT r m a
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Snap a -> m a
    forall a. Snap a -> m a
    forall (m :: * -> *) a. MonadSnap m => Snap a -> m a
    liftSnap

    ------------------------------------------------------------------------------
    instance MonadSnap m => MonadSnap (StateT s m) where
        liftSnap :: forall a. Snap a -> StateT s m a
    liftSnap = m a -> StateT s m a
    forall (m :: * -> *) a. Monad m => m a -> StateT s m a
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
    (MonadTrans t, Monad m) =>
    m a -> t m a
    lift (m a -> StateT s m a) -> (Snap a -> m a) -> Snap a -> StateT s m a
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Snap a -> m a
    forall a. Snap a -> m a
    forall (m :: * -> *) a. MonadSnap m => Snap a -> m a
    liftSnap

    ------------------------------------------------------------------------------
    instance MonadSnap m => MonadSnap (LState.StateT s m) where
        liftSnap :: forall a. Snap a -> StateT s m a
    liftSnap = m a -> StateT s m a
    forall (m :: * -> *) a. Monad m => m a -> StateT s m a
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
    (MonadTrans t, Monad m) =>
    m a -> t m a
    lift (m a -> StateT s m a) -> (Snap a -> m a) -> Snap a -> StateT s m a
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Snap a -> m a
    forall a. Snap a -> m a
    forall (m :: * -> *) a. MonadSnap m => Snap a -> m a
    liftSnap

    ------------------------------------------------------------------------------
    instance (MonadSnap m, Monoid w) => MonadSnap (WriterT w m) where
        liftSnap :: forall a. Snap a -> WriterT w m a
    liftSnap = m a -> WriterT w m a
    forall (m :: * -> *) a. Monad m => m a -> WriterT w m a
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
    (MonadTrans t, Monad m) =>
    m a -> t m a
    lift (m a -> WriterT w m a)
    -> (Snap a -> m a) -> Snap a -> WriterT w m a
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Snap a -> m a
    forall a. Snap a -> m a
    forall (m :: * -> *) a. MonadSnap m => Snap a -> m a
    liftSnap

    ------------------------------------------------------------------------------
    instance (MonadSnap m, Monoid w) => MonadSnap (LWriter.WriterT w m) where
        liftSnap :: forall a. Snap a -> WriterT w m a
    liftSnap = m a -> WriterT w m a
    forall (m :: * -> *) a. Monad m => m a -> WriterT w m a
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
    (MonadTrans t, Monad m) =>
    m a -> t m a
    lift (m a -> WriterT w m a)
    -> (Snap a -> m a) -> Snap a -> WriterT w m a
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Snap a -> m a
    forall a. Snap a -> m a
    forall (m :: * -> *) a. MonadSnap m => Snap a -> m a
    liftSnap