diff options
author | Jed Barber <jjbarber@y7mail.com> | 2012-06-14 09:27:08 +1000 |
---|---|---|
committer | Jed Barber <jjbarber@y7mail.com> | 2012-06-14 09:27:08 +1000 |
commit | 9cd2944ce482eeb2ac91b415023189fe10c66ec1 (patch) | |
tree | e1ea912c0f9d0e0d7f0494816bd1985b5d6b17d6 | |
parent | 533dcc1b4ab16bf167a8f9b08000be30cd0a39c2 (diff) |
Fixed bug with remove/ref
-rw-r--r-- | Graph.hs | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -75,12 +75,12 @@ parse gs@(graph,stack,dictionary) str = "ref" -> let num = read . contents . fromJust $ stack `at` 0 node = fromJust (Map.lookup num dictionary) - stack' = node <:> stack + stack' = node <:> (Stack.pop 1 stack) in (graph, stack', dictionary) "remove" -> let num = read . contents . fromJust $ stack `at` 0 node = fromJust (Map.lookup num dictionary) - stack' = node <:> stack + stack' = node <:> (Stack.pop 1 stack) dictionary' = Map.delete num dictionary in (graph, stack', dictionary') @@ -106,5 +106,5 @@ main = do args <- getArgs list <- getLines $ head args let result = doGraphGen (map (stripReturn) list) - printf $ show result + printf $ show (case result of (graph, state, dictionary) -> graph) |