{-# LANGUAGE FlexibleInstances #-}
module Test.Monad.Trans.Mutants where
import Control.Monad.Trans
import Control.Monad.Trans.Maybe
import Data.Functor (($>))
import Test.Mutants
data LiftTwice
instance {-# OVERLAPPING #-}
MonadTrans t => MonadTrans (Mutant LiftTwice t) where
lift m = lift (m >> m)
data LiftMaybeNothing
instance {-# OVERLAPPING #-}
MonadTrans (Mutant LiftMaybeNothing MaybeT) where
lift _ = Mutant . MaybeT $ return Nothing
data LiftMaybeDiscard
instance {-# OVERLAPPING #-}
MonadTrans (Mutant LiftMaybeDiscard MaybeT) where
lift m = Mutant . MaybeT $ m $> Nothing