@@ -1,76 +0,0 @@
1−{-# OPTIONS_GHC -Wall #-}
2−module File.Watcher where
4−import Control.Concurrent (forkIO, threadDelay)
5−import Control.Concurrent.Chan (newChan, readChan, writeChan)
6−import qualified System.FSNotify as Notify
8−import qualified Elm.Project as Project
9−import Elm.Project (Project)
18− { _elm :: Map.Map Module.Raw Node
19− , _js :: Map.Map Module.Raw FilePath
27− , _needs :: Set.Set Module.Raw
28− , _blocks :: Set.Set Module.Raw
29− , _iface :: Maybe (UTCTime, Interface)
37−action :: Notify.Event -> IO ()
40− Notify.Added path time ->
43− Notify.Modified path time ->
46− Notify.Removed path time ->
50−watcher :: Project -> IO ()
54− Project.toSourceDir project
61− Notify.Modified path time ->
63− Notify.Removed path time ->
67− mapM_ (watcherHelp killer action) [srcDir]
71−watcherHelp :: Notify.Action -> FilePath -> IO ()
72−watcherHelp killer action dir =
73− void $ forkIO $ Notify.withManager $ \manager ->
74− do stop <- Notify.watchTree manager dir (const True) action