[Haskell-cafe] Referential Transparency and Monads

2009-04-09 Thread Mark Spezzano
Hi, How exactly do monads “solve” the problem of referential transparency? I understand RT to be such that a function can be replaced with a actual value. Since a monad could potentially encapsulate any other value—say, data read from a keyboard—doesn’t that violate the assumption of RT

Re: [Haskell-cafe] Referential Transparency and Monads

2009-04-09 Thread Brandon S. Allbery KF8NH
On 2009 Apr 9, at 22:30, Jonathan Cast wrote: On Thu, 2009-04-09 at 21:57 -0400, Brandon S. Allbery KF8NH wrote: On 2009 Apr 9, at 16:09, Luke Palmer wrote: On Thu, Apr 9, 2009 at 1:33 PM, Miguel Mitrofanov miguelim...@yandex.ru wrote: I'm not sure what you mean by that, but

Re: [Haskell-cafe] Referential Transparency and Monads

2009-04-09 Thread Miguel Mitrofanov
On 10 Apr 2009, at 06:30, Jonathan Cast wrote: do s - readFile /my_file writeFile /my_file Hello, world!\n threadDelay 1 -- If you don't like threadDelay, just substitute forcing -- an expensive thunk here writeFile /my_file s As a function from