summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJed Barber <jjbarber@y7mail.com>2012-06-14 09:31:12 +1000
committerJed Barber <jjbarber@y7mail.com>2012-06-14 09:31:12 +1000
commit9a2264088eec608c3fbf06264a8196b468802362 (patch)
treecf54b776aa3a899c36e6f109b3a50a67bf325de3
parent9cd2944ce482eeb2ac91b415023189fe10c66ec1 (diff)
Changed doGraphGen function to return only the graph
-rw-r--r--Graph.hs7
1 files changed, 4 insertions, 3 deletions
diff --git a/Graph.hs b/Graph.hs
index 38feaab..80f2536 100644
--- a/Graph.hs
+++ b/Graph.hs
@@ -93,12 +93,13 @@ parse gs@(graph,stack,dictionary) str =
-doGraphGen :: [String] -> GraphState
+doGraphGen :: [String] -> Graph String
doGraphGen list =
let graph = Graph.empty
stack = Stack.empty
dictionary = Map.empty
- in foldl' parse (graph,stack,dictionary) list
+ result = foldl' parse (graph,stack,dictionary) list
+ in case result of (g,s,d) -> g
@@ -106,5 +107,5 @@ main = do
args <- getArgs
list <- getLines $ head args
let result = doGraphGen (map (stripReturn) list)
- printf $ show (case result of (graph, state, dictionary) -> graph)
+ printf $ show result