[Haskell] main::[String]->IO() ?

Hal Daume III hdaume at ISI.EDU
Mon Mar 22 13:21:15 EST 2004

I typically do:

main = getArgs >>= go
go [whatever] = ...

On Mon, 22 Mar 2004, Steffen Mazanek wrote:

> Hello everybody,
> each time I write an application that makes use of command line arguments
> I have to copy&paste the code for dealing with these args to my program 
> from a reference implementation, because it is so hard to remember.
> What do you think about changing the default type of main or providing
> an alternative, e.g., main_args, just like in C or Java?
> I think this would simplify everyday-programming a lot. Or are there
> any severe theoretical (semantical) problems (main is running in the IO 
> monad either way)? 
> Ciao,
> Steffen
> _______________________________________________
> Haskell mailing list
> Haskell at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell

 Hal Daume III                                   | hdaume at isi.edu
 "Arrest this man, he talks in maths."           | www.isi.edu/~hdaume

More information about the Haskell mailing list