Hi Alex,
The function 'cmd' is highly overloaded, since it takes a variable
number of arguments, and has multiple return types. As such, unlike
most other functions in Haskell, it's type isn't very meaningful.
Tracking it down going via CmdArguments is unlikely to help. The docs
say:
* String arguments are treated as whitespace separated arguments.
* [String] arguments are treated as literal arguments.
So:
"--main=" mainModule
Is treated as two separated arguments. To get it treated as one, you
can join the strings first:
cmd "psc --output" out ("--main=" ++ mainModule) pursFiles
However, even though they are a string, if mainModule has any spaces
in it (which I suspect is unlikely), it would still get separated. You
can fix that by doing:
cmd "psc --output" out ["--main=" ++ mainModule] pursFiles
Generally, if it's not direct string literals, I put the arguments in
[square brackets] to ensure that they don't accidentally get split.
There is also a function 'command' which is the simpler version, which
doesn't have crazy type magic. With that, it should be possible to
figure it out from the types. there it directly takes a list of
strings.
Thanks, Neil