delta-0.1.2.0: A library for detecting file changes

Safe HaskellNone
LanguageHaskell2010

System.Delta.Class

Synopsis

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:

  • changedFiles is a stream of FileInfos on changed files
  • newFiles is a stream of canonicalized FilePaths of newly created files
  • deletedFiles is a stream of canonicalized FilePaths of deleted files

Methods

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