[Haskell-cafe] Re: EDSL for Makefile
steffen
steffen.siering at googlemail.com
Mon Oct 4 06:06:12 EDT 2010
Telling from the video and the slide, Neil's make system is actually
really cool. Indeed something I would really enjoy to use. It support
dynamic and static dependency tracking (more or less) out of the box
(by storing dependencies in a database file).
So you use "want" and "need" to tell the system about the static and
dynamic dependencies.
The "want" at the beginning just tells which targets to start.
Since you may want to choose your task via command line, you actually
would want to do something like:
main = do
wantDefault "file1" =<< getArgs
"file1" *> ...
wantDefault default [] = want [default]
wantDefault _ args = want args
Since using String everywhere for dependencies can lead to errors, it
is always a good idea to replace the strings by constants you can
reuse.
Shake is more kind of a library. If you want a more make-like System
you can even write a preprocessor (like the haskell sinatra clone
"bird"), which even looks for your target symbols and then generates a
haskell file with target symbols replaced by Strings.
I hope the space leaks will be fixed in the future, so one can even
write long running processes which automatically detect changes and
rerun without user interaction and much more.
I actually wonder about the semantic differences between want and
need. Is need used to tell about dynamic dependencies and want for
static dependencies?
On 4 Okt., 05:41, C K Kashyap <ckkash... at gmail.com> wrote:
> > mention_only_once file action = do
> > want [file]
> > file *> action
>
> > main = mention_only_once "file1" $ \x -> do need ["file2"]
> > putStrLn "Hello"
> > putStrLn "World"
>
> Thanks Bulat ....
> I guess even this should work -
>
> main = do
> let file1="file1"
> want [file1]
> file1 *> \x -> do
> need ["file2"]
> putStrLn "Hello"
> putStrLn "World"
>
> --
> Regards,
> Kashyap
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-C... at haskell.orghttp://www.haskell.org/mailman/listinfo/haskell-cafe
More information about the Haskell-Cafe
mailing list