[darcs-users] darcs patch: shell_harness script in haskell

Jason Dagit dagit at codersbase.com
Wed Oct 29 17:02:45 UTC 2008

On Wed, Oct 29, 2008 at 7:38 AM, Christian Kellermann
<Christian.Kellermann at nefkom.net> wrote:
> Hi all,
> As I am fully aware of the tremendous efforts already done last
> weekend and the huge pile of patches to review for David, I want
> to put this patch out as a starting point for discussion. The goal
> is to get rid of perl altogether. One ch unk using perl is the
> shell_harness script. This patch is meant to be a future replacement.
> I am grateful for comments as always!

Hey Christian!  I think you're C-Keen right?  I'm lispy.  We had
talked about this a bit already.

I like what you have, but it's currently Posix only.  I'm going to
suggest some things to help get it closer to portable without actually
trying any of it :)  To make it portable, I think we need only get rid
of setEnv.  To do that, we could use


That page also documents runInteractiveCommand which you're using.

It's pretty much just a drop in replacement, except you'll need to
pass in the env variables you set plus the existing env from

Then we can redefine setEnv to something like this:
setEnv (a, b) xs = nubBy (\(x,_) (y, _) -> x == y) ((a,b):xs)

The sneaky thing with nubBy here is that our new definition will
override an existing one and if there is no definition we append ours.
 Then you could build up your env variables you want to add into a
list of tuples and fold setEnv over it.  I think you get the idea.
Basically, you keep appending new env variables to the result of

Then you pass this new env down to runInteractiveProcess and we will
hopefully be portable on win32.


More information about the darcs-users mailing list