Skip to content

Commit

Permalink
style changes
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszcz committed Apr 10, 2024
1 parent 97c83e6 commit 90ea5fa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion app/Commands/Dev/Casm/FromCairo.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 changes: 3 additions & 6 deletions src/Juvix/Compiler/Backend/Cairo/Data/Result.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit 90ea5fa

Please sign in to comment.