From b5ff89d417c73d74a42a1756cb3ecd99b7a3e7f4 Mon Sep 17 00:00:00 2001 From: Jed Barber Date: Wed, 12 Mar 2014 02:17:25 +1100 Subject: Removed some superfluous lambdas in intermediate functions --- Library/WriteProof.hs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'Library/WriteProof.hs') diff --git a/Library/WriteProof.hs b/Library/WriteProof.hs index c7e0a5f..2c15b74 100644 --- a/Library/WriteProof.hs +++ b/Library/WriteProof.hs @@ -148,8 +148,8 @@ next :: Int -> PGraph -> [String] next num graph = let nodeList = filter (isNumber . snd) (Graph.labNodes graph) numList = nub . (map (read . snd)) $ nodeList - f = (\x y -> if (x `elem` y) then f (x + 1) y else x) - g = (\x y -> if (x == 0) then y else g (x - 1) (f 0 (y ++ numList) : y)) + f x y = if (x `elem` y) then f (x + 1) y else x + g x y = if (x == 0) then y else g (x - 1) (f 0 (y ++ numList) : y) in map show (g num []) @@ -177,10 +177,10 @@ writeGraph :: PGraph -> Node -> [String] writeGraph graph node = let label = fromJust (Graph.lab graph node) argList = [1 .. (Graph.outdeg graph node)] - f = (\s a -> let arg = getArg graph node a - in if (isNothing arg) - then s - else (writeGraph graph (fromJust arg)) ++ s) + f s a = let arg = getArg graph node a + in if (isNothing arg) + then s + else (writeGraph graph (fromJust arg)) ++ s in foldl' f [label] argList @@ -195,9 +195,9 @@ writeAll :: PGraph -> [Node] -> [String] writeAll graph nodeList = let ordered = orderNodes graph nodeList resolved = resolve graph ordered - f = (\g n -> if (n == []) - then [] - else (writeGraph g (head n)) ++ (f g (tail n))) + f g n = if (n == []) + then [] + else (writeGraph g (head n)) ++ (f g (tail n)) in f resolved ordered -- cgit