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)
166
166
Nothing -> error $ " deref " ++ show p ++ " in " ++ show mm
167
167
Just g -> g
168
168
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
+
174
179
175
180
-- spine c@(Comb _) mm stack = (c, stack)
176
181
-- spine n@(Num _) mm stack = (n, stack)
You can’t perform that action at this time.
0 commit comments