From f7c397b9f7d38bb07d6127fc11bcb1885d772fbf Mon Sep 17 00:00:00 2001 From: Lukasz Czajka Date: Thu, 8 Dec 2022 22:38:07 +0100 Subject: [PATCH] make ormolu happy --- src/Juvix/Compiler/Core/Transformation.hs | 2 +- .../Compiler/Core/Transformation/MoveApps.hs | 32 ++++++++++--------- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/src/Juvix/Compiler/Core/Transformation.hs b/src/Juvix/Compiler/Core/Transformation.hs index 653997e697..ac5e55779e 100644 --- a/src/Juvix/Compiler/Core/Transformation.hs +++ b/src/Juvix/Compiler/Core/Transformation.hs @@ -13,9 +13,9 @@ import Juvix.Compiler.Core.Transformation.Base import Juvix.Compiler.Core.Transformation.Eta import Juvix.Compiler.Core.Transformation.Identity import Juvix.Compiler.Core.Transformation.LambdaLifting +import Juvix.Compiler.Core.Transformation.MoveApps import Juvix.Compiler.Core.Transformation.RemoveTypeArgs import Juvix.Compiler.Core.Transformation.TopEtaExpand -import Juvix.Compiler.Core.Transformation.MoveApps applyTransformations :: [TransformationId] -> InfoTable -> InfoTable applyTransformations ts tbl = foldl' (flip appTrans) tbl ts diff --git a/src/Juvix/Compiler/Core/Transformation/MoveApps.hs b/src/Juvix/Compiler/Core/Transformation/MoveApps.hs index 7aad2d3e50..0798f91683 100644 --- a/src/Juvix/Compiler/Core/Transformation/MoveApps.hs +++ b/src/Juvix/Compiler/Core/Transformation/MoveApps.hs @@ -14,21 +14,23 @@ convertNode = dmap go go node = case node of NApp {} -> let (tgt, args) = unfoldApps node - in - case tgt of - NLet lt@(Let {..}) -> - NLet lt{_letBody = mkApps _letBody (map (second (shift 1)) args)} - NCase cs@(Case {..}) -> - NCase cs{ - _caseBranches = - map (\br@CaseBranch{..} -> - br{ - _caseBranchBody = mkApps _caseBranchBody (map (second (shift _caseBranchBindersNum)) args) - }) - _caseBranches, - _caseDefault = fmap (`mkApps` args) _caseDefault - } - _ -> node + in case tgt of + NLet lt@(Let {..}) -> + NLet lt {_letBody = mkApps _letBody (map (second (shift 1)) args)} + NCase cs@(Case {..}) -> + NCase + cs + { _caseBranches = + map + ( \br@CaseBranch {..} -> + br + { _caseBranchBody = mkApps _caseBranchBody (map (second (shift _caseBranchBindersNum)) args) + } + ) + _caseBranches, + _caseDefault = fmap (`mkApps` args) _caseDefault + } + _ -> node _ -> node moveApps :: InfoTable -> InfoTable