Hi Ian,
Thanks for sharing your experiences. Having the code no shorter in
Shake does seem like a theme - it ends up being maintainable and
clear, rather than concise. I guess that isn't a problem provided the
code is still seen as an improvement. Some comments going through the
details:
* No need to put alwaysRerun on a phony, they are alwaysRerun as
standard, e.g. line 24.
* In Haskell, adding return () as anything other than the last
statement of a do block is unecessary, e.g. line 25.
* I'd personally use more restricted functions where possible - for
example map instead of fmap on line 44, mapM instead of traverse on
line 39, ++ instead of <> on line 56.
* For getPages, you reverse it. My best understanding is this means
you'll end up with pages in reverse sorted lexical order, while pages
have ids. Wouldn't it be better to sort the Pids after they are [Int],
so you can put them in a guaranteed order based on their Int value?
* You action on line 52 seems to always call clean, which seems a bit
weird. Or do you not care about persistence and minimal rebuilding at
all?
Overall, it looks simple, clear and well structured - a really nice
example of a moderate size Shake file.
Thanks, Neil