Integrating Haskell Shake build system with Twitch for file watching

I’m moving from tup to Haskell Shake as my build system but I’m stuck on one thing. How do I make Shake automatically rebuild files when they change?

I know I could use inotify directly or wrap it with tools like filewatcher or watchman. But since I’m already using Shake, I want to try integrating it with the Twitch library.

The problem is that Twitch has very little documentation. I can see it uses the same do syntax as Shake but I can’t figure out how to connect them properly.

My end goal is to use pandoc to generate documents in multiple formats. I switched away from tup because it lacks proper target support, but now I need this file watching functionality to work smoothly.

Has anyone successfully combined Shake and Twitch for automatic rebuilds? Any code examples or guidance would be really helpful.

yo, have u tried shakeOptions{shakeVerbosity=Normal}? it does automagic file watching now. tho i moved off twitch, shake handles it natively. super handy for pandoc stuff too!

I tried the Twitch integration route last year and ditched it after running into the same documentation problems. What worked for me was using shakeOptions{shakeCommandOptions=[EchoStdout False]} with the --live flag when running shake. You get continuous rebuilds without external libraries. For pandoc workflows, Shake’s dependency tracking already handles multiple format outputs well enough. Going native also means fewer dependencies to manage and debug. If you really want to use Twitch, wrap your shake action with withManagerConf from the filesystem watcher - but honestly, the maintenance overhead isn’t worth it.

Shake has built-in file watching that’s way easier than dealing with Twitch integration. I hit the same problems migrating from Make to Shake for docs. Use shakeArgsWith with shakeOptions and set shakeRebuild properly. For continuous builds, wrap your main Shake action in a loop using the Development.Shake.Forward module. This worked great for my pandoc setup where I needed multiple output formats from markdown. The native Shake approach was way more reliable than trying to coordinate two different libraries - Shake already tracks file dependencies anyway.