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