From f4a45b6c52c3632c3b5466818bbbafc63d3209c5 Mon Sep 17 00:00:00 2001 From: rhiannon morris Date: Fri, 3 Nov 2023 17:45:02 +0100 Subject: [PATCH] keep the Except effect at the start of the list --- exe/Main.idr | 6 +++--- lib/Quox/Parser/FromParser.idr | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) 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)