Command Line Arguments

Paulo J. Matos pocm at soton.ac.uk
Thu Oct 18 13:37:08 EDT 2007


On 18/10/2007, Neil Mitchell <ndmitchell at gmail.com> wrote:
> Hi
>
> > As an Haskell beginner, and considering this may be compiler
> > dependent, I shall ask it on this list.
>
> It's standard across all implementations.
>

So that's part of the Haskell98 standard?
Nice! So, is it usual for compilers to implement extensions to the
standard? If yes, where can I find the documentation for GHC
extensions?

> > How can I access command line arguments from my wmain function in my Main module?
>
> import System.Environment
>
> main = do
>     args <- getArgs
>     print args
>

Thank you!

> You can also do in GHCi and Hugs:
>
> :main test arguments
>
> To test your code with argument values.
>
> Thanks
>
> Neil
>
>
>


-- 
Paulo Jorge Matos - pocm at soton.ac.uk
http://www.personal.soton.ac.uk/pocm
PhD Student @ ECS
University of Southampton, UK


More information about the Glasgow-haskell-users mailing list