twitch

A high level file watcher DSL

https://github.com/jfischoff/twitch

Latest on Hackage:0.1.7.2

This package is not currently in any snapshots. If you're interested in using it, we recommend adding it to Stackage Nightly. Doing so will make builds more reliable, and allow stackage.org to host generated Haddocks.

MIT licensed by Jonathan Fischoff, Andreas Schacker
Maintained by [email protected]

Twitch is a monadic DSL and library for file watching. It conveniently utilizes do notation in the style of Shake and clay to expose the functionality of the fsnotify cross-platform file system watcher.

Here is an example that converts Markdown files to HTML and reloads Safari whenever the input files change.

import Twitch
import System.Process ( system )

main = defaultMain $ do
"*.md"   |> \filePath -> system $ "pandoc -t html " ++ filePath
"*.html" |> \_ -> system $ "osascript refreshSafari.AppleScript"