Re: [Haskell-cafe] Language support for imperative code. Was: Re: monad subexpressions

2007-08-09 Thread Jules Bean
Brian Hulley wrote: Haskell is designed so that any attempt at abstracting mutable local state will infect the entire program (modulo use of a highly dangerous function whose semantics is entirely unclear, depending on the vagaries of evaluation strategy of the particular compiler) (Your

[Haskell-cafe] Language support for imperative code. Was: Re: monad subexpressions

2007-08-08 Thread Brian Hulley
apfelmus wrote: However, most genuinely imperative things are often just a building block for a higher level functional model. The ByteString library is a good example: the interface is purely functional, the internals are explicit memory control. It's a bad idea to let the internal memory

Re: [Haskell-cafe] Language support for imperative code. Was: Re: monad subexpressions

2007-08-08 Thread Martin Percossi
Brian Hulley wrote: hidden away in the definition of their API function to create a label, is a call to (ref 0) ;-) The equivalent implementation in Haskell would completely destroy all hope of using this in a pure context and force all use of the API into the IO monad. Really? I would

Re: [Haskell-cafe] Language support for imperative code. Was: Re: monad subexpressions

2007-08-08 Thread Hugh Perkins
On 8/8/07, Brian Hulley [EMAIL PROTECTED] wrote: In contrast, all the pure functional GUIs that I've seen are just wrappers around someone else's imperative code, and moreover, they exchange the simplicity of the object oriented imperative API for a veritable mindstorm of unbelievably heavy,

Re: [Haskell-cafe] Language support for imperative code. Was: Re: monad subexpressions

2007-08-08 Thread Corey O'Connor
On 8/8/07, Brian Hulley [EMAIL PROTECTED] wrote: Regarding the quote above, if the API must hide explicit memory control from the user the only way I can see of doing this would be to use (unsafePerformIO), which really is unsafe since Haskell relies on the fact that mutable operations can't

Re: [Haskell-cafe] Language support for imperative code. Was: Re: monad subexpressions

2007-08-08 Thread Brian Hulley
Martin Percossi wrote: Brian Hulley wrote: hidden away in the definition of their API function to create a label, is a call to (ref 0) ;-) The equivalent implementation in Haskell would completely destroy all hope of using this in a pure context and force all use of the API into the IO

Re: [Haskell-cafe] Language support for imperative code. Was: Re: monad subexpressions

2007-08-08 Thread Brian Hulley
Hugh Perkins wrote: On 8/8/07, *Brian Hulley* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: In contrast, all the pure functional GUIs that I've seen... In defense of Haskell (wow!), note that imperative languages are not without problems in GUIs. In a multithreaded environment, If

Re: [Haskell-cafe] Language support for imperative code. Was: Re: monad subexpressions

2007-08-08 Thread Donald Bruce Stewart
brianh: Hugh Perkins wrote: On 8/8/07, *Brian Hulley* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: In contrast, all the pure functional GUIs that I've seen... In defense of Haskell (wow!), note that imperative languages are not without problems in GUIs. In a multithreaded