Safe Haskell | None |
---|---|
Language | Haskell2010 |
- class FileWatcher a where
- defaultWatcher :: FilePath -> IO a
- changedFiles :: a -> Event FileInfo
- newFiles :: a -> Event FilePath
- deletedFiles :: a -> Event FilePath
- cleanUpAndClose :: a -> IO ()
- mergeWatchers :: a -> a -> a
- watchPaths :: FileWatcher a => [FilePath] -> Maybe (IO a)
Documentation
class FileWatcher a where
A class for watching a directory based on functional reactive programming At the core of this class are three event streams:
defaultWatcher :: FilePath -> IO a
Each type provides a default watcher for a pass
changedFiles :: a -> Event FileInfo
An event that gives some info on changed files (disjunct from deleted and new files)
newFiles :: a -> Event FilePath
An event that fires for each new file
deletedFiles :: a -> Event FilePath
An event that fires for each deleted path
cleanUpAndClose :: a -> IO ()
Free all possibly used resources. No event will fire after this.
mergeWatchers :: a -> a -> a
Merge two watchers that are watching different directories
watchPaths :: FileWatcher a => [FilePath] -> Maybe (IO a)
Create a watcher on all of the given paths