Why Shake dependencies are explicitly `needed`? -


i find first example of shake usage demonstrating pattern seems error prone:

    contents <- readfilelines $ out -<.> "txt"     need contents     cmd "tar -cf" [out] contents 

why need need contents when readfilelines reads them , cmd references them? can avoid requiring applicativedo?

i think part of confusion may types/semantics of contents. file out -<.> "txt" contains list of filenames, contents list of filenames. when need contents requiring files created , depended upon, using filenames specify files. when pass contents on cmd passing filenames tar use query files.

so key point readfilelines doesn't read files in question, reads filenames out of file. have use need make sure using files fine, , use files in cmd. way of looking @ 3 lines is:

  1. which files want operate on?
  2. make sure files ready.
  3. use files.

does make sense? there's no relationship applicativedo - it's presence wouldn't @ all.


Comments

Popular posts from this blog

c# - How Configure Devart dotConnect for SQLite Code First? -

java - Copying object fields -

c++ - Clear the memory after returning a vector in a function -