@@ -140,13 +140,14 @@ import Control.Monad.Fail
140140import Data.Char (toLower )
141141import Data.List (isPrefixOf )
142142import Data.Maybe (fromMaybe , listToMaybe , catMaybes )
143+ #if !MIN_VERSION_base(4,8,0)
143144import Control.Applicative (Applicative (.. ), (<$>) )
144- #ifdef MTL1
145- import Control.Monad (filterM , forM_ , when , ap )
146- #else
147- import Control.Monad (filterM , forM_ , when )
148145#endif
149- import Control.Monad.State (StateT (.. ), MonadIO (.. ), modify , gets , withStateT , evalStateT , MonadState (.. ))
146+ import Control.Monad (filterM , forM_ , when )
147+ import Control.Monad.IO.Class
148+ ( MonadIO (.. ) )
149+ import Control.Monad.State
150+ ( MonadState (.. ), gets , modify , StateT (.. ), evalStateT , withStateT )
150151
151152import qualified System.IO
152153 ( hSetBuffering , hPutStr , stdout , stdin , hGetChar
@@ -418,20 +419,12 @@ instance Show (BrowserState t) where
418419-- | @BrowserAction@ is the IO monad, but carrying along a 'BrowserState'.
419420newtype BrowserAction conn a
420421 = BA { unBA :: StateT (BrowserState conn ) IO a }
421- #ifdef MTL1
422- deriving (Functor , Monad , MonadIO , MonadState (BrowserState conn))
423-
424- instance Applicative (BrowserAction conn ) where
425- pure = return
426- (<*>) = ap
427- #else
428422 deriving
429423 ( Functor , Applicative , Monad , MonadIO , MonadState (BrowserState conn )
430424#if MIN_VERSION_base(4,9,0)
431425 , MonadFail
432426#endif
433427 )
434- #endif
435428
436429runBA :: BrowserState conn -> BrowserAction conn a -> IO a
437430runBA bs = flip evalStateT bs . unBA
0 commit comments