Skip to content

Commit dbef3dd

Browse files
committed
ghciWatch: Ensure that reload happened without errors before evaluating
1 parent 8e88d6c commit dbef3dd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Reflex/Process/GHCi.hs

+3-3
Original file line numberDiff line numberDiff line change
@@ -163,11 +163,11 @@ ghciWatch p mexpr reload shutdown = do
163163

164164
rec g <- ghci p sendExpr reloadEvents shutdown
165165
sendExpr <- delay 0.1 $ fforMaybe (_repl_finished g) $ \finished -> case reverse (Map.elems finished) of
166-
c@(Cmd cmd _ _):_ -> if displayCommand cmd == ":r" && hasErrors c
167-
then Nothing
168-
else case mexpr of
166+
c@(Cmd cmd _ _):_ -> if displayCommand cmd == ":r" && not (hasErrors c)
167+
then case mexpr of
169168
Nothing -> Nothing
170169
Just expr -> Just [expr]
170+
else Nothing
171171
_ -> Nothing
172172
pure g
173173

0 commit comments

Comments
 (0)