@@ -37,14 +37,16 @@ run = do
3737 let dotGhci = unlines
3838 [ ":set args --quiet --port " <> show freePort
3939 , ":set -i" <> intercalate ":" (mconcat hsSrcDirs)
40+ , ":set -XScopedTypeVariables"
4041 , ":add Backend Frontend"
41− , ":module + Control.Concurrent Obelisk.Widget.Run Frontend Backend"
42+ , ":module + System.IO Control.Exception Control.Concurrent Obelisk.Widget.Run Frontend Backend"
4243 ]
4344 testCmd = unlines
44− [ "backendId <- forkIO backend"
45+ [ "let handleBackendErr (_ :: SomeException) = hPutStrLn stderr \"backend stopped; make a change to your code to reload\""
46+ , "backendTid <- forkIO $ handle handleBackendErr backend"
4547 , "let conf = defRunConfig { _runConfig_redirectPort = " <> show freePort <> "}"
4648 , "runWidget conf frontend"
47− , "killThread backendId"
49+ , "killThread backendTid"
4850 ]
4951 withSystemTempDirectory "ob-ghci" $ \fp -> do
5052 let dotGhciPath = fp </> ".ghci"