Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data CallbackWatcher w
- data CallbackId
- withCallbacks :: FileWatcher a => a -> IO (CallbackWatcher a)
- withDeleteCallback :: FileWatcher a => CallbackWatcher a -> (FilePath -> IO ()) -> IO CallbackId
- withChangedCallback :: FileWatcher a => CallbackWatcher a -> (FileInfo -> IO ()) -> IO CallbackId
- withNewCallback :: FileWatcher a => CallbackWatcher a -> (FilePath -> IO ()) -> IO CallbackId
- unregisterCallback :: FileWatcher a => CallbackWatcher a -> CallbackId -> IO ()
- removeAllCallbacks :: FileWatcher a => CallbackWatcher a -> IO ()
- closeCallbackWatcher :: FileWatcher a => CallbackWatcher a -> IO ()
Documentation
data CallbackWatcher w
Provides a callback based interface to an FRP base FileWatcher
Construction
withCallbacks :: FileWatcher a => a -> IO (CallbackWatcher a)
Wrap a file watcher in a datatype that allows adding callbacks
Adding callbacks
:: FileWatcher a | |
=> CallbackWatcher a | |
-> (FilePath -> IO ()) | An IO action on the deleted path |
-> IO CallbackId |
Add a callback that is executed when file deletion is detected
:: FileWatcher a | |
=> CallbackWatcher a | |
-> (FileInfo -> IO ()) | Action on changed file |
-> IO CallbackId |
Add a callback on a changed file
:: FileWatcher a | |
=> CallbackWatcher a | |
-> (FilePath -> IO ()) | An IO action on the new path |
-> IO CallbackId |
Add a callback that is executed when file creation is detected
Removing callbacks
unregisterCallback :: FileWatcher a => CallbackWatcher a -> CallbackId -> IO ()
Unregister the given CallbackId from the FileWatcher does nothing if the CallbackId is not in the watcher
removeAllCallbacks :: FileWatcher a => CallbackWatcher a -> IO ()
Remove all callbacks form the watcher. They will not be called after this
Closing the watcher
closeCallbackWatcher :: FileWatcher a => CallbackWatcher a -> IO ()
Remove all callbacks and close the underlying FileWatcher