File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed
Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -166,11 +166,16 @@ spine' g@(Node l r) mm stack = spine' (getNode l mm) mm (g:stack)
166166 Nothing -> error $ " deref " ++ show p ++ " in " ++ show mm
167167 Just g -> g
168168
169- spine :: IORef Graf -> [IORef Graph ]-> (IORef Graph , [IORef Graph ])
170- spine ioRefGraph stack = case ioRefGraph of
171- IORef (Com c) -> (ioRefGraph, stack)
172- IORef (Numb i) -> (ioRefGraph, stack)
173- IORef (Node l r) -> spine l (ioRefGraph: stack)
169+ spine :: IORef Graf -> [IORef Graf ]-> IO (IORef Graf , [IORef Graf ])
170+ spine ioRefGraph stack = do
171+ derefGraph <- readIORef ioRefGraph
172+ case derefGraph of
173+ Com c -> return (ioRefGraph, stack)
174+ Numb i -> return (ioRefGraph, stack)
175+ Nod l r -> do
176+ derefL <- l
177+ spine derefL (ioRefGraph: stack)
178+
174179
175180-- spine c@(Comb _) mm stack = (c, stack)
176181-- spine n@(Num _) mm stack = (n, stack)
You can’t perform that action at this time.
0 commit comments