From 90ea5fadc318d46d8bc1d4c7db7c29d105a320bf Mon Sep 17 00:00:00 2001 From: Lukasz Czajka Date: Wed, 10 Apr 2024 18:35:17 +0200 Subject: [PATCH] style changes --- app/Commands/Dev/Casm/FromCairo.hs | 2 +- src/Juvix/Compiler/Backend/Cairo/Data/Result.hs | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/app/Commands/Dev/Casm/FromCairo.hs b/app/Commands/Dev/Casm/FromCairo.hs index b8a3b0325e..09df338017 100644 --- a/app/Commands/Dev/Casm/FromCairo.hs +++ b/app/Commands/Dev/Casm/FromCairo.hs @@ -18,7 +18,7 @@ runCommand opts = do let Casm.Result {..} = Casm.fromCairo (Cairo.deserialize r) renderStdOut (Casm.ppProgram _resultCode) Nothing -> - exitMsg (ExitFailure 1) "error reading input file" + exitFailMsg "error reading input file" where file :: AppPath File file = opts ^. casmFromCairoInputFile diff --git a/src/Juvix/Compiler/Backend/Cairo/Data/Result.hs b/src/Juvix/Compiler/Backend/Cairo/Data/Result.hs index 62364745c2..e099119e98 100644 --- a/src/Juvix/Compiler/Backend/Cairo/Data/Result.hs +++ b/src/Juvix/Compiler/Backend/Cairo/Data/Result.hs @@ -103,12 +103,9 @@ instance FromJSON Result where parseHints val' = case val' of Object obj -> do lst <- - mapM - ( \(k, v) -> do - v' <- parseHint v - return (Aeson.toText k, v') - ) - (KeyMap.toList obj) + forM (KeyMap.toList obj) $ \(k, v) -> do + v' <- parseHint v + return (Aeson.toText k, v') mapM (firstM (maybe (typeMismatch "Integer" val') return . T.readMaybe . unpack)) lst _ -> typeMismatch "Object" val'