diff options
author | Jed Barber <jjbarber@y7mail.com> | 2012-06-14 09:31:12 +1000 |
---|---|---|
committer | Jed Barber <jjbarber@y7mail.com> | 2012-06-14 09:31:12 +1000 |
commit | 9a2264088eec608c3fbf06264a8196b468802362 (patch) | |
tree | cf54b776aa3a899c36e6f109b3a50a67bf325de3 | |
parent | 9cd2944ce482eeb2ac91b415023189fe10c66ec1 (diff) |
Changed doGraphGen function to return only the graph
-rw-r--r-- | Graph.hs | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -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 |