arguments to the main function throught runhugs

Sigbjorn Finne sof@galois.com
Wed, 19 Feb 2003 17:40:57 -0800


Hi there,

have a look at the getArgs IO action from the standard System
module (http://haskell.org/onlinereport/system.html):

foo$ cat runner.hs
module Main where
import System
main = do
  ls <- getArgs
  print ls
foo$ runhugs runner.hs test
["test"]
foo$

hth
--sigbjorn

----- Original Message -----
From: "thiagohb" <thiagohb@iceb.ufop.br>
To: <hugs-bugs@haskell.org>
Sent: Wednesday, February 19, 2003 11:03
Subject: arguments to the main function throught runhugs


> Hello,
> I'm a student in Ouro Preto's University (Brazil) and I have a problem:
> How can I pass arguments to the main function throught runhugs?
> I'll need to use a string in the main function. How can I catch the string
> from command line?
>
> For example:
> runhugs main.hsx test
>
> Thank you.
> Thiago Braga.