4 ms·
The only build systems that I'm aware of that are monadic are redo, SCons and Shake-inspired build systems (including Shake itself, Jenga in OCaml, and several
by platz 9y ago
The only build systems that I'm aware of that are monadic are redo, SCons and Shake-inspired build systems (including Shake itself, Jenga in OCaml, and several Haskell alternatives).
One realistic example (from the original Shake paper), is building a .tar file from the list of files contained in a file. Using Shake we can write the Action:
contents <- readFileLines "list.txt"
need contents
cmd "tar -cf" [out] contents
There are at least two aspects I'm aware of that increase the power of Make:
- Using `$(shell cat list.txt)` I can splice the contents of list.txt into the Makefile, reading the contents of list.txt before the dependencies are parsed.
- Using `-include file.d` I can include additional rules that are themselves produced by the build system.
It seems every "applicative" build system contains some mechanism for extending its power. I believe some are strictly less powerful than monadic systems, while others may turn out to be an encoding of monadic rules. However, I think that an explicitly monadic definition provides a clearer foundation.
http://neilmitchell.blogspot.com/2014/07/applicative-vs-monadic-build-systems.html http://neilmitchell.blogspot.com/2014/07/applicative-vs-mona...