diff --git a/exe/Main.idr b/exe/Main.idr index dbb7897..be03398 100644 --- a/exe/Main.idr +++ b/exe/Main.idr @@ -146,11 +146,11 @@ private liftFromParser : Eff FromParserIO a -> Eff CompileStop a liftFromParser act = runEff act $ with Union.(::) - [\g => send g, - handleExcept (\err => throw $ FromParserError err), + [handleExcept (\err => throw $ FromParserError err), handleStateIORef !(asksAt STATE defs), handleStateIORef !(asksAt STATE ns), - handleStateIORef !(asksAt STATE suf)] + handleStateIORef !(asksAt STATE suf), + \g => send g] private liftErase : Q.Definitions -> Eff Erase a -> Eff CompileStop a diff --git a/lib/Quox/Parser/FromParser.idr b/lib/Quox/Parser/FromParser.idr index f34a3d7..84eaed9 100644 --- a/lib/Quox/Parser/FromParser.idr +++ b/lib/Quox/Parser/FromParser.idr @@ -41,7 +41,7 @@ FromParserPure = [Except Error, DefsState, StateL NS Mods, NameGen] public export FromParserIO : List (Type -> Type) -FromParserIO = LoadFile :: FromParserPure +FromParserIO = FromParserPure ++ [LoadFile] export @@ -66,11 +66,11 @@ fromParserIO : (MonadRec io, HasIO io) => Eff FromParserIO a -> io (Either Error a) fromParserIO inc seen suf defs act = liftIO $ fromIOErr $ runEff act $ with Union.(::) - [handleLoadFileIOE LoadError WrapParseError seen inc, - handleExcept (\e => ioLeft e), + [handleExcept (\e => ioLeft e), handleStateIORef defs, handleStateIORef !(newIORef [<]), - handleStateIORef suf] + handleStateIORef suf, + handleLoadFileIOE LoadError WrapParseError seen inc] parameters {auto _ : Functor m} (b : Var n -> m a) (f : PName -> m a)