[Haskell-cafe] Process properties as global values

Alastair Reid alastair at reid-consulting-uk.ltd.uk
Sun Jul 4 14:17:53 EDT 2004

> I'm just wondering, why haven't process properties (such as the command
> line arguments, or the parent process id), which are inherently global,
> been made global values in the Haskell standard? You could avoid
> needlessly carrying around these values, you wouldn't need to lift some
> functions into the IO monad...

This is true and you don't break purity and common programming tasks become a 
bit easier because you need less plumbing.  One argument against doing so is 
that it will make data dependencies less obvious.

At the moment, if you want to know where your data goes, you can usually 
follow a path from where it is read from a file (or whatever) through to 
where it is passed to a function which uses it.   I've found this very useful 
in the past and wish it applied to my current project (a joint project with a 
very good C programmer and written in C).

I don't know if this is a conclusive argument but it's certainly true that 
making process properties global would make it harder to find what code 
depends on the command line, environment, etc. and understanding a program 
_might_ become harder.

Alastair Reid

More information about the Haskell-Cafe mailing list