Hi,
The very idea of 'pure functional programming'
is that it is 'declarative'
(i.e. works with constants (nothing ever changes)).
As a consequence, given a function 'f' and an input 'x',
evaluating the expression 'f x' should always behave in the same way.
Input/Output is an example of a programming aspect that is not pure in the sense above.
The idea of I/O is (for example) to change information on your file system.
So, a function that appends the string "Foo" to a file 'Foo' and then shows the contents of 'Foo',
will NOT always behave in the same way. If the contents of the file was originally "someString",
then, the first time the function is invoked, it will show "someStringFoo", and
the second time the function is invoked, it will show "someStringFooFoo".
One of the goals of monads is to encapsulate non-pure aspects (side effects)
behind a convenient interface.
Luc
-----Original Message-----
From: hugs-users-bounces@haskell.org on behalf of aldirithms@gmx.net
Sent: Sat 8/5/2006 3:11 PM
To: Hugs-Users@haskell.org
Subject: [Hugs-users] Excerpt from "Yet another Haskell Tutorial"
Hello, (and sorry for the preceding accidental empty message),
I'd like to ask a question concerning a following passage in
"Yet another Haskell Tutorial" that ushers in the topic of monads:
<