[Haskell-cafe] Process properties as global values

David Menendez zednenem at psualum.com
Sun Jul 4 15:57:55 EDT 2004


Alastair Reid writes:

> 
> > 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.

To reinforce that point: Command-line arguments and environment
variables are specific to a certain type of platform. There have been
popular consumer operating systems (the "classic" Mac OS, to name one)
that have no analogous features.

Keeping the implementation-specific features locked in the IO monad may
not be the ideal solution, but it's better than having them scattered
throughout the program.
-- 
David Menendez <zednenem at psualum.com> <http://www.eyrie.org/~zednenem/>


More information about the Haskell-Cafe mailing list