git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Switch to ExceptT and transformers/mtl 0.4.*
e005ea0Harry Garrood
psc-make/Main.hs+4−4
@@ -17,7 +17,7 @@
17module Main where
17module Main where
18
18
19import Control.Applicative
19import Control.Applicative
20−import Control.Monad.Error
20+import Control.Monad.Except
21import Control.Monad.Reader
21import Control.Monad.Reader
22
22
23import Data.Version (showVersion)
23import Data.Version (showVersion)
@@ -52,14 +52,14 @@ readInput InputOptions{..} = do
52 content <- forM ioInputFiles $ \inFile -> (Right inFile, ) <$> readFile inFile
52 content <- forM ioInputFiles $ \inFile -> (Right inFile, ) <$> readFile inFile
53 return (if ioNoPrelude then content else (Left P.RebuildNever, P.prelude) : content)
53 return (if ioNoPrelude then content else (Left P.RebuildNever, P.prelude) : content)
54
54
55−newtype Make a = Make { unMake :: ReaderT (P.Options P.Make) (ErrorT String IO) a }
55+newtype Make a = Make { unMake :: ReaderT (P.Options P.Make) (ExceptT String IO) a }
56 deriving (Functor, Applicative, Monad, MonadIO, MonadError String, MonadReader (P.Options P.Make))
56 deriving (Functor, Applicative, Monad, MonadIO, MonadError String, MonadReader (P.Options P.Make))
57
57
58runMake :: P.Options P.Make -> Make a -> IO (Either String a)
58runMake :: P.Options P.Make -> Make a -> IO (Either String a)
59−runMake opts = runErrorT . flip runReaderT opts . unMake
59+runMake opts = runExceptT . flip runReaderT opts . unMake
60
60
61makeIO :: IO a -> Make a
61makeIO :: IO a -> Make a
62−makeIO = Make . lift . ErrorT . fmap (either (Left . show) Right) . tryIOError
62+makeIO = Make . lift . ExceptT . fmap (either (Left . show) Right) . tryIOError
63
63
64instance P.MonadMake Make where
64instance P.MonadMake Make where
65 getTimestamp path = makeIO $ do
65 getTimestamp path = makeIO $ do
psci/Main.hs+4−4
@@ -31,7 +31,7 @@ import qualified Data.Map as M
31
31
32import Control.Applicative
32import Control.Applicative
33import Control.Monad
33import Control.Monad
34−import Control.Monad.Error (ErrorT(..), MonadError)
34+import Control.Monad.Except (ExceptT(..), MonadError, runExceptT)
35import Control.Monad.Reader (MonadReader, ReaderT, runReaderT)
35import Control.Monad.Reader (MonadReader, ReaderT, runReaderT)
36import Control.Monad.Trans.Class
36import Control.Monad.Trans.Class
37import Control.Monad.Trans.Maybe (MaybeT(..), runMaybeT)
37import Control.Monad.Trans.Maybe (MaybeT(..), runMaybeT)
@@ -325,14 +325,14 @@ newtype PSCI a = PSCI { runPSCI :: InputT (StateT PSCiState IO) a } deriving (Fu
325psciIO :: IO a -> PSCI a
325psciIO :: IO a -> PSCI a
326psciIO io = PSCI . lift $ lift io
326psciIO io = PSCI . lift $ lift io
327
327
328−newtype Make a = Make { unMake :: ReaderT (P.Options P.Make) (ErrorT String IO) a }
328+newtype Make a = Make { unMake :: ReaderT (P.Options P.Make) (ExceptT String IO) a }
329 deriving (Functor, Applicative, Monad, MonadError String, MonadReader (P.Options P.Make))
329 deriving (Functor, Applicative, Monad, MonadError String, MonadReader (P.Options P.Make))
330
330
331runMake :: Make a -> IO (Either String a)
331runMake :: Make a -> IO (Either String a)
332−runMake = runErrorT . flip runReaderT options . unMake
332+runMake = runExceptT . flip runReaderT options . unMake
333
333
334makeIO :: IO a -> Make a
334makeIO :: IO a -> Make a
335−makeIO = Make . lift . ErrorT . fmap (either (Left . show) Right) . tryIOError
335+makeIO = Make . lift . ExceptT . fmap (either (Left . show) Right) . tryIOError
336
336
337instance P.MonadMake Make where
337instance P.MonadMake Make where
338 getTimestamp path = makeIO $ do
338 getTimestamp path = makeIO $ do
purescript.cabal+1−1
@@ -31,7 +31,7 @@ library
31 filepath -any,
31 filepath -any,
32 mtl >= 2.1.0 && < 2.3.0,
32 mtl >= 2.1.0 && < 2.3.0,
33 parsec -any,
33 parsec -any,
34− transformers >= 0.3 && < 0.5,
34+ transformers >= 0.4.0 && < 0.5,
35 utf8-string >= 1 && < 2,
35 utf8-string >= 1 && < 2,
36 pattern-arrows >= 0.0.2 && < 0.1,
36 pattern-arrows >= 0.0.2 && < 0.1,
37 monad-unify >= 0.2.2 && < 0.3,
37 monad-unify >= 0.2.2 && < 0.3,