treeExtAny :: WatchManager-> FilePathDirectory to watch
-> Textextension
-> (FilePath -> IO ())action to run on file
-> IO StopListening
In the given directory tree, watch for any events for files with the given file extension
:: a typeCtrl KGHC 9.14.1 · lts/ghc-9.14.x · d82dee8 · 2026-10-12
Modulefsnotify-0.4.4.0Haskell2010
Some additional functions on top of System.FSNotify.
Example of compiling scss files with compass
compass :: WatchManager -> FilePath -> m ()
compass man dir = do
putStrLn $ "compass " ++ encodeString dir
treeExtExists man dir "scss" $ fp ->
when ("deploy" notElem splitDirectories fp) $ do
let d = encodeString $ head (splitDirectories rel)
system "cd " ++ d ++ "&& bundle exec compass compile"
return ()
treeExtAny :: WatchManager-> FilePathDirectory to watch
-> Textextension
-> (FilePath -> IO ())action to run on file
-> IO StopListeningIn the given directory tree, watch for any events for files with the given file extension
treeExtExists :: WatchManager-> FilePathDirectory to watch
-> Textextension
-> (FilePath -> IO ())action to run on file
-> IO StopListeningTurn a FilePath predicate into an Event predicate that accepts only Added, Modified, and ModifiedAttributes event types