summaryrefslogtreecommitdiff
path: root/Library/Usage.hs
diff options
context:
space:
mode:
authorJed Barber <jjbarber@y7mail.com>2014-03-12 02:17:25 +1100
committerJed Barber <jjbarber@y7mail.com>2014-03-12 02:17:25 +1100
commitb5ff89d417c73d74a42a1756cb3ecd99b7a3e7f4 (patch)
tree97bf2d3ad4e5eac7aec320b932ccf09fdf127871 /Library/Usage.hs
parentef81889c1eccb08acc27d47c9df652541134e3db (diff)
Removed some superfluous lambdas in intermediate functions
Diffstat (limited to 'Library/Usage.hs')
-rw-r--r--Library/Usage.hs11
1 files changed, 5 insertions, 6 deletions
diff --git a/Library/Usage.hs b/Library/Usage.hs
index 58fb0e0..a307274 100644
--- a/Library/Usage.hs
+++ b/Library/Usage.hs
@@ -29,23 +29,22 @@ type UsageMap = Map Node (Map (LEdge (Int,Int)) (Int,[Int]))
-- will encounter the nodes of interest through.
usageMap :: PGraph -> [Node] -> Set Node -> UsageMap
usageMap graph order interest =
- let unionFunc = (\a b ->
- Map.unionWith min a b)
+ let unionFunc a b = Map.unionWith min a b
- addFunc = (\index prev umap edge ->
+ addFunc index prev umap edge =
let node = snd3 edge
curIn = Graph.outdeg graph (fst3 edge)
prev' = (curIn - (fst . thd3 $ edge)):prev
toAdd = Map.singleton node (Map.singleton edge (index,prev'))
in if (Set.member node interest)
then Map.unionWith unionFunc toAdd umap
- else umap)
+ else umap
- f = (\umap (index,node,prev) ->
+ f umap (index,node,prev) =
let edgeList = Graph.out graph node
sucMapList = map (f Map.empty) (map (\x -> (index, snd3 x, (length edgeList - (fst . thd3 $ x)):prev)) edgeList)
umap' = foldl' (addFunc index prev) umap edgeList
- in Map.unionsWith unionFunc (umap':sucMapList))
+ in Map.unionsWith unionFunc (umap':sucMapList)
in foldl' f Map.empty (zip3 [1..] order (repeat []))