Safe Haskell | None |
---|---|
Language | Haskell2010 |
Twitch.InternalRule
Synopsis
- type Action = FilePath -> UTCTime -> IO ()
- type FileTest = FilePath -> UTCTime -> Bool
- data InternalRule = InternalRule {}
- toInternalRule :: FilePath -> Rule -> Either RuleIssue InternalRule
- data Config = Config {
- logger :: Issue -> IO ()
- dirs :: [FilePath]
- watchConfig :: WatchConfig
- data Issue
- fireRule :: Event -> InternalRule -> IO ()
- testAndFireRule :: Config -> Event -> InternalRule -> IO ()
- setupRuleForDir :: Config -> WatchManager -> [InternalRule] -> FilePath -> IO ()
- setupRules :: Config -> [InternalRule] -> IO WatchManager
Documentation
type Action = FilePath -> UTCTime -> IO () Source #
The actions that are run when file events are triggered
type FileTest = FilePath -> UTCTime -> Bool Source #
The test function to determine if a event Action
should get fired
data InternalRule Source #
Constructors
InternalRule | |
Instances
Show InternalRule Source # | |
Defined in Twitch.InternalRule Methods showsPrec :: Int -> InternalRule -> ShowS # show :: InternalRule -> String # showList :: [InternalRule] -> ShowS # | |
Default InternalRule Source # | |
Defined in Twitch.InternalRule Methods def :: InternalRule # |
toInternalRule :: FilePath -> Rule -> Either RuleIssue InternalRule Source #
Configuration to run the file watcher
Constructors
Config | |
Fields
|
A sum type for the various issues that can be logged
Constructors
IEvent Event | logged every time an event is fired |
IRuleFired Event InternalRule | logged every time an rule is fired |
testAndFireRule :: Config -> Event -> InternalRule -> IO () Source #
Test to see if the rule should fire and fire it
setupRuleForDir :: Config -> WatchManager -> [InternalRule] -> FilePath -> IO () Source #
Start watching a directory, and run the rules on it.
setupRules :: Config -> [InternalRule] -> IO WatchManager Source #
Setup all of the directory watches using the rules