-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Opinionated filesystem watcher.
--
-- A thin opinionated wrapper around INotify. Fires
-- AddedChangedMoved/Removed events on files, and that's it.
-- Watches (only files) recursively on a given directory. Designed for
-- simple filesystem watchers that don't want to mess with INotify.
-- Inherits all of INotify's limitations surrounding moved files: Events
-- are not fired for overwritten files nor for files moved out of the
-- watched directory.
@package watcher
@version 0.0.2
module Watcher
-- | Creates a watch for a single handler on a single directory.
watch :: Handler -> FilePath -> IO Watcher
-- | Shuts down all watching and the inotifier.
unwatch :: Watcher -> IO [Warning]
-- | The types of actions that are reported.
data Action
Added :: Action
Changed :: Action
Moved :: FilePath -> Action
Removed :: Action
-- | Badness that happened during a watch, usually due to inotify
-- limitations.
data Warning
MovedOutOfScope :: FilePath -> Warning
-- | A handler used to mutate and reference watchers.
data Watcher
-- | Functions that handle events The filepaths passed will be joined with
-- the path used to set up the watcher. If you have mydir/ file1 file2
-- And you do (watch myHandler mydir) and file1 changes, myHandler
-- will be passed mydir/file1 as the FilePath.
type Handler = Action -> FilePath -> IO ()
instance Eq Action
instance Show Action
instance Eq Warning
instance Show Warning
instance Eq Watcher