Re: [Haskell-cafe] one-way monads

2008-05-21 Thread Dan Weston
Dan Doel wrote: On Tuesday 20 May 2008, [EMAIL PROTECTED] wrote: Actually, it's true less than 50% of the time. In particular, it's not true of any monad transformer. Sure it is. Any particular transformer t typically comes with some particular way of writing a function of type t m a - m a

Re: [Haskell-cafe] one-way monads

2008-05-21 Thread Lennart Augustsson
I certainly don't use 50% IO monads. I regard any use of the IO monad except at the top level as a failure. :) On Wed, May 21, 2008 at 7:14 PM, Dan Weston [EMAIL PROTECTED] wrote: Dan Doel wrote: On Tuesday 20 May 2008, [EMAIL PROTECTED] wrote: Actually, it's true less than 50% of the time.

Re: [Haskell-cafe] one-way monads

2008-05-21 Thread Don Stewart
lennart: I certainly don't use 50% IO monads. I regard any use of the IO monad except at the top level as a failure. :) IO fail -- Don Background: http://failblog.org/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] one-way monads

2008-05-21 Thread Dan Piponi
On Wed, May 21, 2008 at 4:08 PM, Lennart Augustsson [EMAIL PROTECTED] wrote: I certainly don't use 50% IO monads. I regard any use of the IO monad except at the top level as a failure. :) Real Haskell Programmers Only Use Top Level IO! (But then again, real programmers wouldn't use Haskell:

Re: [Haskell-cafe] one-way monads

2008-05-21 Thread Neil Mitchell
Hi Real Haskell Programmers Only Use Top Level IO! (But then again, real programmers wouldn't use Haskell: http://www.pbm.com/~lindahl/real.programmers.html) It's amazing how many phone interviews I've done where the HR person at the other end tries to tick the knows Pascal box, despite me

Re: [Haskell-cafe] one-way monads

2008-05-21 Thread Creighton Hogg
On Wed, May 21, 2008 at 6:37 PM, Neil Mitchell [EMAIL PROTECTED] wrote: Hi Real Haskell Programmers Only Use Top Level IO! (But then again, real programmers wouldn't use Haskell: http://www.pbm.com/~lindahl/real.programmers.htmlhttp://www.pbm.com/%7Elindahl/real.programmers.html )

Re: [Haskell-cafe] one-way monads

2008-05-20 Thread Ben Lippmeier
On 20/05/2008, at 3:54 PM, Zsolt SZALAI wrote: Here comes IO and one-way monads, where the internal state can not be extacted, and seems, that the internal data is global to the program. Hows that could be? Is it just because main::IO() or because the implementation of IO uses external C

Re: [Haskell-cafe] one-way monads

2008-05-20 Thread Jeremy Shaw
Hello, You *can* get things out of the IO monad with: System.IO.Unsafe.unsafePerformIO :: IO a - a but, in almost all cases you shouldn't. The name 'unsafe' is there for a reason :) The IO monad does not explicitly contain any state -- it's entire purpose is to ensure that operations which can

Re: [Haskell-cafe] one-way monads

2008-05-20 Thread Lauri Alanko
On Tue, May 20, 2008 at 07:54:33AM +0200, Zsolt SZALAI wrote: Here comes IO and one-way monads, where the internal state can not be extacted, and seems, that the internal data is global to the program. Hows that could be? Is it just because main::IO() or because the implementation of IO uses

Re: [Haskell-cafe] one-way monads

2008-05-20 Thread Janis Voigtlaender
Lauri Alanko wrote: On Tue, May 20, 2008 at 07:54:33AM +0200, Zsolt SZALAI wrote: Here comes IO and one-way monads, where the internal state can not be extacted, and seems, that the internal data is global to the program. Hows that could be? Is it just because main::IO() or because the

Re: [Haskell-cafe] one-way monads

2008-05-20 Thread Dan Piponi
On Mon, May 19, 2008 at 10:54 PM, Zsolt SZALAI [EMAIL PROTECTED] wrote: Now, i'm getting familiar with monads, but there is a little discredit about one-way monads. If someone claims that monads are one-way they are probably referring to the fact that it is impossible (without cheating!) to

Re: [Haskell-cafe] one-way monads

2008-05-20 Thread ajb
G'day all. Quoting Dan Piponi [EMAIL PROTECTED]: For any specific monad, m, it's usually possible to write a function m a - a. Actually, it's true less than 50% of the time. In particular, it's not true of any monad transformer. Cheers, Andrew Bromage

Re: [Haskell-cafe] one-way monads

2008-05-20 Thread Dan Doel
On Tuesday 20 May 2008, [EMAIL PROTECTED] wrote: Actually, it's true less than 50% of the time. In particular, it's not true of any monad transformer. Sure it is. Any particular transformer t typically comes with some particular way of writing a function of type t m a - m a (you may have to

[Haskell-cafe] one-way monads

2008-05-19 Thread Zsolt SZALAI
Hi! Now, i'm getting familiar with monads, but there is a little discredit about one-way monads. For example, in monads presented in Monads for Functional Programming by Philip Wadler, they are all two-way monads, internal data can be extracted from the monad, and these data, call them state,