@@ -50,12 +50,15 @@ fillApp :: String -> String -> M.MVar Queue -> IO ()
50fillApp modu func mqueue =
50fillApp modu func mqueue =
51 go Nothing []
51 go Nothing []
53+ constSE :: x -> SomeException -> x
55+ getTimes = handle (constSE $ return []) . mapM getModificationTime
53 go prevError prevFiles = do
56 go prevError prevFiles = do
54 toReload <-
57 toReload <-
55 if null prevFiles
58 if null prevFiles
56 then return True
59 then return True
58− times <- mapM (getModificationTime . fst) prevFiles
61+ times <- getTimes $ map fst prevFiles
59 return $ times /= map snd prevFiles
62 return $ times /= map snd prevFiles
60 (newError, newFiles) <-
63 (newError, newFiles) <-
61 if toReload
64 if toReload
@@ -76,10 +79,8 @@ fillApp modu func mqueue =
76 putStrLn "Interpreting success, new app loaded"
79 putStrLn "Interpreting success, new app loaded"
77 E.handle onInitErr $ do
80 E.handle onInitErr $ do
78 swapApp app mqueue
81 swapApp app mqueue
79− files' <- forM files $ \f -> do
82+ times <- getTimes files
80− t <- getModificationTime f
82− return (Nothing, files')
83+ return (Nothing, zip files times)
83 onInitErr e = do
84 onInitErr e = do
84 putStrLn $ "Error initializing application: " ++ show e
85 putStrLn $ "Error initializing application: " ++ show e
85 loadingApp' (Just e) mqueue
86 loadingApp' (Just e) mqueue