Hello Daniel,
Wednesday, December 21, 2005, 6:24:29 PM, you wrote:
DC So I can have an IO bit (e.g. a do-block) that calls functions (which
DC are purely functional code) but I can't have a function that executes
DC any IO.
it's true
DC For example, it is not possible to write a function
Daniel Carrera wrote:
I'm a Haskell newbie and I don't really understand how Haskell deals
with functions that really must have side-effects. Like a rand()
function or getLine().
Those aren't functions.
A function is a single-valued relation, i.e. a (possibly infinite) set
of ordered
Hi all,
I'm a Haskell newbie and I don't really understand how Haskell deals
with functions that really must have side-effects. Like a rand()
function or getLine().
I know this has something to do with monads, but I don't really
understand monads yet. Is there someone who might explain this
On Wed, 21 Dec 2005, Daniel Carrera wrote:
Hi all,
I'm a Haskell newbie and I don't really understand how Haskell deals
with functions that really must have side-effects. Like a rand()
function or getLine().
I know this has something to do with monads, but I don't really
understand
On 21/12/05, Daniel Carrera [EMAIL PROTECTED] wrote:
Hi all,
I'm a Haskell newbie and I don't really understand how Haskell deals
with functions that really must have side-effects. Like a rand()
function or getLine().
I know this has something to do with monads, but I don't really
On 21/12/05, Cale Gibbard [EMAIL PROTECTED] wrote:
On 21/12/05, Daniel Carrera [EMAIL PROTECTED] wrote:
Hi all,
I'm a Haskell newbie and I don't really understand how Haskell deals
with functions that really must have side-effects. Like a rand()
function or getLine().
I know this
Thanks for all the help. I think things are much clearer now. And this bit:
main = do putStrLn Hello, what is your name?
name - getLine
putStrLn (Hello, ++ name ++ !)
Looks quite straight forward.
I just wrote my very first IO program with Haskell:
--//--
main = do
On 21/12/05, Daniel Carrera [EMAIL PROTECTED] wrote:
Thanks for all the help. I think things are much clearer now. And this bit:
main = do putStrLn Hello, what is your name?
name - getLine
putStrLn (Hello, ++ name ++ !)
Looks quite straight forward.
I just wrote my
On Wed, 21 Dec 2005, Daniel Carrera wrote:
Thanks for all the help. I think things are much clearer now. And this bit:
main = do putStrLn Hello, what is your name?
name - getLine
putStrLn (Hello, ++ name ++ !)
Looks quite straight forward.
I just wrote my very
On Wed, Dec 21, 2005 at 11:43:42AM +, Daniel Carrera wrote:
Hi all,
I'm a Haskell newbie and I don't really understand how Haskell deals
with functions that really must have side-effects. Like a rand()
function or getLine().
I know this has something to do with monads, but I don't
Am Mittwoch, 21. Dezember 2005 13:15 schrieb Creighton Hogg:
[...]
Monads, I believe, can be just thought of as containers for state.
I would say that you are talking especially about the I/O monad here. A monad
as such is a rather general concept like a group is in algebra.
The important
Creighton Hogg wrote:
x is a String, getLine has type IO String. That's what I
was getting at in one of my last e-mails.
Hmm... let's see if I understand:
* getLine() has type IO String.
* The - will convert an IO String to a plain String
* So if I do x - getLine() then x has the type
Wolfgang Jeltsch writes:
- Original Message -
Am Mittwoch, 21. Dezember 2005 13:15 schrieb Creighton Hogg:
[...]
Monads, I believe, can be just thought of as containers for state.
I would say that you are talking especially about the I/O monad here. A
monad
as such is a rather
On Wed, 21 Dec 2005, Daniel Carrera wrote:
Creighton Hogg wrote:
x is a String, getLine has type IO String. That's what I
was getting at in one of my last e-mails.
Hmm... let's see if I understand:
* getLine() has type IO String.
* The - will convert an IO String to a plain String
Am Mittwoch, 21. Dezember 2005 16:28 schrieb David Barton:
Wolfgang Jeltsch writes:
- Original Message -
Am Mittwoch, 21. Dezember 2005 13:15 schrieb Creighton Hogg:
[...]
Monads, I believe, can be just thought of as containers for state.
I would say that you are talking
--- Wolfgang Jeltsch [EMAIL PROTECTED] wrote:
I think Phil Wadler said it best when he said that a monad is a
*computation*.
To be honest, I'm still struggling with the monad concept myself. Oh
sure, I can read the definition and it makes sense. But I'm still
missing that aha! moment when
Am Mittwoch, 21. Dezember 2005 19:02 schrieben Sie:
[...]
You (or, rather the processor) don't execute instructions to write Hello
in same way as, say, adding 2 and 2.
Exactly!
Rather, you add writing this string to a to do list and wait for a driver
to respond to an interrupt, pick up the
17 matches
Mail list logo