To think "properly" in haskell when you need side effects you should look at monads
and how they are used in I/O.

I'm no expert but most applications i've seen start like this


main = do x <-getArgs
               mapM_ somefunction(x)


do is a construct that lets you have a bunch of IO statements in succession which in turn
starts to look like imperative programming. So this is how you can access the rest of the world
from Haskell.

(someone please correct me if i'm wrong)

-Dan


On 12/9/06, Waldemar Biernacki <wb@sao.pl > wrote:
Hello to everyone!

Two days ago I have found Haskell in Internet. It sounds very nice.
I have read some articles, few examples, ... yes it sounds nice.

Now my problem is connected with the "non-update" object feature.
I can't write "variable" instead object because - from the meaning of the word
( variable ) - it has the possibility to CHANGE its value.
Yes that my problem :-(

Let's assume that I've got to write the application that
should works as follows:

1. At the beginning the user should write her/his name (for instance as the
application parameter).
2. Let's assume that the application has many various functions defined
inside, and - after printing each of the outputs - the name has to be
printout.

How should I think "properly" in Haskell to get described action?

cheers
Waldemar
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe