From 3d480ee358cf1c34d4b780850b828fc9cc4c376b Mon Sep 17 00:00:00 2001 From: joshvera Date: Wed, 12 Sep 2018 10:16:52 -0400 Subject: [PATCH] brackets --- src/Data/Abstract/ScopeGraph.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Data/Abstract/ScopeGraph.hs b/src/Data/Abstract/ScopeGraph.hs index dacb640ac..86d3a13b3 100644 --- a/src/Data/Abstract/ScopeGraph.hs +++ b/src/Data/Abstract/ScopeGraph.hs @@ -94,8 +94,8 @@ reference ref declaration graph = let traverseEdges edge = do linkMap <- linksOfScope address graph scopes <- Map.lookup edge linkMap - getFirst (flip foldMap scopes $ (First . (\nextAddress -> - go currentScope nextAddress (path . (EPath edge nextAddress))))) + getFirst (flip foldMap scopes . First $ \nextAddress -> + go currentScope nextAddress (path . EPath edge nextAddress)) in traverseEdges P <|> traverseEdges I in case lookupScope currentAddress graph of Just currentScope -> fromMaybe graph (go currentScope currentAddress id) @@ -118,7 +118,7 @@ pathOfRef ref graph = do Map.lookup ref pathsMap scopeOfDeclaration :: Ord scope => Declaration -> ScopeGraph scope ddata -> Maybe scope -scopeOfDeclaration declaration graph = go . Map.keys . fst $ (unScopeGraph graph) +scopeOfDeclaration declaration graph = go . Map.keys . fst $ unScopeGraph graph where go (s : scopes') = case ddataOfScope s graph of Just ddataMap -> case Map.lookup declaration ddataMap of @@ -167,7 +167,7 @@ setSlot :: (Ord address, Ord declaration) => address -> declaration -> value -> setSlot address declaration value heap = case frameLookup address heap of Just frame -> let slotMap = slots frame in - Heap $ Map.insert address (frame { slots = (Map.insert declaration value slotMap) }) (unHeap heap) + Heap $ Map.insert address (frame { slots = Map.insert declaration value slotMap }) (unHeap heap) Nothing -> heap lookup :: (Ord address, Ord scope) => Heap scope address declaration value -> address -> Path scope -> declaration -> Maybe scope