Re: [Haskell] line-based interactive program

2005-07-08 Thread Colin Runciman
Christian Maeder wrote: >Could you also insert a prompt that is shown before the lines are read? >(The first prompt seems to be tricky assuming line buffering ) > > If line-buffering is assumed or imposed, of course it prevents the programming of interactive applications where the units of input

[Haskell] ST Monad and all that

2005-07-08 Thread Srinivas Nedunuri
Hello, in trying to understand how to use the ST Monad I've come across references to a bewildering variety of related types such as STRefs, STArrays, MutVar, ArrayRef, IORef, IOArray, ArrRef, etc. the list goes on. Is there a place where I can get a comprehensive explanation of what's what?

Re: [Haskell] ST Monad and all that

2005-07-08 Thread Wolfgang Jeltsch
Am Freitag, 8. Juli 2005 12:48 schrieb Srinivas Nedunuri: > Hello, in trying to understand how to use the ST Monad I've come across > references to a bewildering variety of related types such as STRefs, > STArrays, MutVar, ArrayRef, IORef, IOArray, ArrRef, etc. the list goes on. > Is there a place

Re: [Haskell] line-based interactive program

2005-07-08 Thread Christian Maeder
Colin Runciman wrote: > output are less than a line! However, there is no need to build > line-buffering into the system, because it is easily defined in Haskell: > > buffer xs = foldl const xs xs I don't find it this easy nor a good programming practise. My interaction depends on the (subtle o

[Haskell] FACS'05: Deadline Extended 29 July

2005-07-08 Thread Luis Barbosa
[apologies for cross-posting] FACS'05 II International Workshop on Formal Aspects of Component Software Maca

Re: [Haskell] line-based interactive program

2005-07-08 Thread Colin Runciman
Christian, >>buffer xs = foldl const xs xs >>I don't find it this easy nor a good programming practise. >> >> I don't see why you should think it hard to define a function like 'buffer'. The whole purpose of foldl is to encapsulate accumulation. It demands the full spine of its list argument

Re: [Haskell] line-based interactive program

2005-07-08 Thread Olaf Chitil
Christian Maeder wrote: Colin Runciman wrote: buffer xs = foldl const xs xs I don't find it this easy nor a good programming practise. My interaction depends on the (subtle order of) evaluation of a pure and total function? I would not think so much about the operational evaluation ord

[Haskell] Importance of precise lazy-evaluation semantics (was: line-based interactive program)

2005-07-08 Thread Jean-Philippe Bernardy
> >>My interaction depends on the (subtle order of) evaluation of a pure and > >>total function? > >> > Pure, yes; total, no. > > Many important things depend on order of evaluation in lazy programs: > for example, whether they compute a well-defined value at all! The > interleaving of demand in

Re: [Haskell] Importance of precise lazy-evaluation semantics (was: line-based interactive program)

2005-07-08 Thread Thomas Davie
It seems to me that this sort of thing is why haskell is difficult to compile to efficient code. I have the impression that relaxed semantics wouldn't hurt 99% of programs while make the compiler-writer job easier. The only disadvantage is that tricks like the above one wouldn't work any more. An

Re: [Haskell] Importance of precise lazy-evaluation semantics (was: line-based interactive program)

2005-07-08 Thread Jan-Willem Maessen
On Jul 8, 2005, at 10:20 AM, Jean-Philippe Bernardy wrote (in an exchange with Colin Runciman): My interaction depends on the (subtle order of) evaluation of a pure and total function? Pure, yes; total, no. Many important things depend on order of evaluation in lazy programs: for example,

Re: [Haskell] line-based interactive program

2005-07-08 Thread Andrew Pimlott
On Fri, Jul 08, 2005 at 02:51:11PM +0100, Colin Runciman wrote: > >>My interaction depends on the (subtle order of) evaluation of a pure and > >>total function? > >> > Pure, yes; total, no. > > Many important things depend on order of evaluation in lazy programs: > for example, whether they comput

[Haskell] Re: ST Monad and all that

2005-07-08 Thread Peter Eriksen
"Srinivas Nedunuri" <[EMAIL PROTECTED]> writes: > Hello, in trying to understand how to use the ST Monad I've come across > references to a bewildering variety of related types such as STRefs, > STArrays, MutVar, ArrayRef, IORef, IOArray, ArrRef, etc. the list goes on. Is > there a place where

Re: [Haskell] line-based interactive program

2005-07-08 Thread Olaf Chitil
Andrew Pimlott wrote: It is one thing to embrace lazy evaluation order, and another to embrace lazy IO (implemented using unsafeInterleaveIO). As a relative newcomer to Haskell, I got the impression that the "interact" style was always a hack, discarded for good reason in favor of the IO monad.

[Haskell] Using hs-plugins

2005-07-08 Thread Thomas Davie
I've been trying to get hs-plugins working on a box, to use the Eval module, but the register script seems not to register the eval package, or the printf module, which judging by the readme: --- And to unregister (maybe as root). Note that the unistall order matters: $ ghc-pkg -r pr

Re: [Haskell] line-based interactive program

2005-07-08 Thread Wolfgang Jeltsch
Am Freitag, 8. Juli 2005 18:43 schrieb Andrew Pimlott: > [...] > It is one thing to embrace lazy evaluation order, and another to embrace > lazy IO (implemented using unsafeInterleaveIO). As a relative newcomer > to Haskell, I got the impression that the "interact" style was always a > hack, disc

Re: [Haskell] Re: ST Monad and all that

2005-07-08 Thread Wolfgang Jeltsch
Am Freitag, 8. Juli 2005 18:50 schrieb Peter Eriksen: > "Srinivas Nedunuri" <[EMAIL PROTECTED]> writes: > > Hello, in trying to understand how to use the ST Monad I've come across > > references to a bewildering variety of related types such as STRefs, > > STArrays, MutVar, ArrayRef, IORef, IOArray

Re: [Haskell] line-based interactive program

2005-07-08 Thread Wolfgang Jeltsch
Am Freitag, 8. Juli 2005 19:21 schrieb Olaf Chitil: > [...] > In fact, unsafeInterleaveIO shows up limitations of the IO monad. > Without this strange primitive (what is actually unsafe about it?) unsafeInterleaveIO doesn't break referential transparency, right? I suppose, it is unsafe in the s