[Haskell-cafe] About print and side-effects

2005-12-18 Thread Daniel Carrera
Hi all, The recent responses to my first question (thanks guys!) included the following bit: main = print (fact 42) Now, print is a side-effect. Shouldn't it involve a do-block or a nomad or one of those scary things you hear about when learning about side effects in functional programs?

Re: [Haskell-cafe] About print and side-effects

2005-12-18 Thread Anders Höckersten
sön 2005-12-18 klockan 20:22 + skrev Daniel Carrera: Hi all, The recent responses to my first question (thanks guys!) included the following bit: main = print (fact 42) Now, print is a side-effect. Shouldn't it involve a do-block or a nomad or one of those scary things you hear

Re: [Haskell-cafe] About print and side-effects

2005-12-18 Thread Chris Kuklewicz
Daniel Carrera wrote: Hi all, The recent responses to my first question (thanks guys!) included the following bit: main = print (fact 42) You can use a do block: main = do print (fact 42) which also works. But for a single thing of type (IO _) the do is optional. Now,

Re: [Haskell-cafe] About print and side-effects

2005-12-18 Thread Daniel Carrera
Chris Kuklewicz wrote: By nomad you seemed to either be ridiculing or misspelling monad. Misspelling. It's a new word for me. I'm not really sure what it means. I expect it'll take me a while to figure it out. Thank you for the help. Best, Daniel. -- /\/`) http://oooauthors.org

Re: [Haskell-cafe] About print and side-effects

2005-12-18 Thread Sebastian Sylvan
On 12/18/05, Daniel Carrera [EMAIL PROTECTED] wrote: Chris Kuklewicz wrote: By nomad you seemed to either be ridiculing or misspelling monad. Misspelling. It's a new word for me. I'm not really sure what it means. I expect it'll take me a while to figure it out. It sounds scary, I know! For