Re: unsafeInterleaveIO ordering

2003-08-31 Thread Robert Ennals
ve computation attempts to call unsafePerformIO or evaluate the IO from an unsafeInterleaveIO then the speculation is immediately aborted. IO is never speculated. Anyone wanting to find out more about optimistic evaluation is encouraged to download the paper from here: http://www.c

Subject: Re: unsafeInterleaveIO ordering

2003-08-30 Thread Robert Ennals
ually speculative/optimistic evaluation should be fine. Optimistic Evaluation refuses to speculate IO for exactly this reason. If a speculative computation attempts to call unsafePerformIO or evaluate the IO from an unsafeInterleaveIO then the speculation is immediately aborted. IO is never speculated.

RE: unsafeInterleaveIO ordering

2003-08-29 Thread Hal Daume
> In your example it's more or less guaranteed that putting "b" > and "c" will > never happen, because the result of the combinated IO action > isn't demanded. well yes, it was a bad example. i got another answer basically saying that threading could screw it up (i'm not using thread) as could,

Re: unsafeInterleaveIO ordering

2003-08-29 Thread David Sabel
Hi, > if i say: > > foo = do > putStrLn "a" > unsafeInterleaveIO (putStrLn "b" >> putStrLn "c") > putStrLn "d" > > is it guarenteed that nothing will happen between putting "b" and "c"? > that is, whil

Re: unsafeInterleaveIO ordering

2003-08-29 Thread Alastair Reid
On Friday 29 August 2003 7:23 pm, Hal Daume wrote: > if i say: > > foo = do > putStrLn "a" > unsafeInterleaveIO (putStrLn "b" >> putStrLn "c") > putStrLn "d" > > is it guarenteed that nothing will happen between putting

unsafeInterleaveIO ordering

2003-08-29 Thread Hal Daume
if i say: foo = do putStrLn "a" unsafeInterleaveIO (putStrLn "b" >> putStrLn "c") putStrLn "d" is it guarenteed that nothing will happen between putting "b" and "c"? that is, while the place/time at which the (putStrLn

Re: unsafeinterleaveIO

2000-06-01 Thread Fergus Henderson
On 01-Jun-2000, Antti-Juhani Kaijanaho <[EMAIL PROTECTED]> wrote: > > Like there is no way in Haskell 98 to access OS services beyond a certain > subset, there is no way in C90 or C99 to access OS services beyond a > certain subset. Haskell's subset is actually larger than C's. > > Like Haskell

Re: unsafeinterleaveIO

2000-06-01 Thread Antti-Juhani Kaijanaho
On Thu, Jun 01, 2000 at 03:34:10PM +1000, Manuel M. T. Chakravarty wrote: > Antti-Juhani Kaijanaho <[EMAIL PROTECTED]> wrote, > > > On Wed, May 31, 2000 at 12:06:00PM +1000, Manuel M. T. Chakravarty wrote: > > > The one hole I am most concerned about is > > > access to standard OS services and co

Re: unsafeinterleaveIO

2000-05-31 Thread Manuel M. T. Chakravarty
Antti-Juhani Kaijanaho <[EMAIL PROTECTED]> wrote, > On Wed, May 31, 2000 at 12:06:00PM +1000, Manuel M. T. Chakravarty wrote: > > The one hole I am most concerned about is > > access to standard OS services and code written in other > > languages > > FWIW, C has the same problem, and yet n+1 pro

Re: unsafeinterleaveIO

2000-05-31 Thread Antti-Juhani Kaijanaho
On Wed, May 31, 2000 at 12:06:00PM +1000, Manuel M. T. Chakravarty wrote: > The one hole I am most concerned about is > access to standard OS services and code written in other > languages FWIW, C has the same problem, and yet n+1 programmers are happy with C (and its descendants). -- %%% Antti

Re: unsafeinterleaveIO

2000-05-30 Thread Manuel M. T. Chakravarty
Lennart Augustsson <[EMAIL PROTECTED]> wrote, > "Ronald J. Legere" wrote: > > > Thanks that explaination was very very helpfull! (Also Martins comments). > > One thing that I would like to understand is why so many of these > > nonstandard extensions get used all the time. It is very hard to >

Re: unsafeinterleaveIO

2000-05-30 Thread Fergus Henderson
On 30-May-2000, George Russell <[EMAIL PROTECTED]> wrote: > Fergus Henderson wrote: > > (If nothing at all can be guaranteed, then no-one should be using those > > features, and they should be removed from the Hugs/ghc extension libraries. > > But it should be possible to make some guarantees.) >

Re: unsafeinterleaveIO

2000-05-30 Thread Marcin 'Qrczak' Kowalczyk
Tue, 30 May 2000 18:52:53 +0200, Lennart Augustsson <[EMAIL PROTECTED]> pisze: > I feel quite strongly about this, and when I write Haskell programs > I try to avoid non-standard features as much as I can. Very often > you can; it might be a little inconvenient, but I think it's worth > the pric

Re: unsafeinterleaveIO

2000-05-30 Thread George Russell
Fergus Henderson wrote: > (If nothing at all can be guaranteed, then no-one should be using those > features, and they should be removed from the Hugs/ghc extension libraries. > But it should be possible to make some guarantees.) What on earth is a guarantee? GHC is a research project. I don't e

Re: unsafeinterleaveIO

2000-05-30 Thread Fergus Henderson
On 30-May-2000, George Russell <[EMAIL PROTECTED]> wrote: > "Ronald J. Legere" wrote: > > > > SUMMARY: How about a supplement to the standard that contains the > > 'standard' extensions that everyone uses. > One problem I have with this is that "unsafe" operations, being unsafe, > are difficult

Re: unsafeinterleaveIO

2000-05-30 Thread George Russell
"Ronald J. Legere" wrote: > > SUMMARY: How about a supplement to the standard that contains the > 'standard' extensions that everyone uses. One problem I have with this is that "unsafe" operations, being unsafe, are difficult to fit in with the rest of the language. For example a common use of

Re: unsafeinterleaveIO

2000-05-30 Thread Lennart Augustsson
"Ronald J. Legere" wrote: > Thanks that explaination was very very helpfull! (Also Martins comments). > One thing that I would like to understand is why so many of these > nonstandard extensions get used all the time. It is very hard to > find any application package that doesnt use some nonstan

Re: unsafeinterleaveIO

2000-05-30 Thread Ronald J. Legere
r IO function to put more values into that same list (stream)? So I started poking around in the library files and thats how I got around to asking the question about unsafeinterleaveIO. Ok so what is my point? Perhaps some of these 'extensions' are so damn useful and so commonly used they sh

Re: unsafeinterleaveIO

2000-05-30 Thread Marcin 'Qrczak' Kowalczyk
ot; effect, and the value obtained is immutable as every value should, and the thing is so useful, that we live with that little impurity. > unsafeInterleaveIO. WHAT the heck is that thing? When applied to an IO action, it immediately produces a magic value, which, when later evaluated, will execu

Re: unsafeinterleaveIO

2000-05-30 Thread Koen Claessen
, you can use the function "unsafeInterleaveIO", provided by many Haskell compilers (at least Hugs, GHC and HBC), but *not* part of the Haskell standard. This is because it is an *unsafe* function, a function that might give strange results, a functione which is not semantically well-d

unsafeinterleaveIO

2000-05-30 Thread Ronald J. Legere
How can I make it do it lazily? I hunted around in the Hugs libraries (but this is not a Hugs question!!! ) and found that in the Channel library there is a function just like this for channels, and somehow to make it work it uses unsafeInterleaveIO. WHAT the heck is that thing? I looked at it and