From 9cd2944ce482eeb2ac91b415023189fe10c66ec1 Mon Sep 17 00:00:00 2001 From: Jed Barber Date: Thu, 14 Jun 2012 09:27:08 +1000 Subject: Fixed bug with remove/ref --- Graph.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Graph.hs b/Graph.hs index 8fdc399..38feaab 100644 --- a/Graph.hs +++ b/Graph.hs @@ -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) -- cgit