@@ -7,7 +7,6 @@ import Core.TT
7import Core.Evaluate
7import Core.Evaluate
9import Control.Monad.State
9import Control.Monad.State
10−import Control.Monad.Trans.State.Lazy(liftCatch)
11import Data.List
10import Data.List
12import Data.Char
11import Data.Char
@@ -61,6 +60,11 @@ iLOG str = do i <- get
61 $ do lift (putStrLn str)
60 $ do lift (putStrLn str)
62 put (i { idris_log = idris_log i ++ str ++ "\n" } )
61 put (i { idris_log = idris_log i ++ str ++ "\n" } )
63+liftCatch :: (m (a,s) -> (e -> m (a,s)) -> m (a,s)) ->
64+ StateT s m a -> (e -> StateT s m a) -> StateT s m a
65+liftCatch catchError m h =
66+ StateT $ \s -> runStateT m s `catchError` \e -> runStateT (h e) s
64idrisCatch :: Idris a -> (IOError -> Idris a) -> Idris a
68idrisCatch :: Idris a -> (IOError -> Idris a) -> Idris a
65idrisCatch op handler = liftCatch catch op handler
69idrisCatch op handler = liftCatch catch op handler