RE: Bug in IO libraries when sending data through a pipe?

2002-03-20 Thread Simon Marlow
I don't think mmap() provides exactly the right behaviour. It lets you specify that modifications made by the current process aren't committed to the file, but what we want is to snapshot the file so that subsequent modifications by *other* processes aren't seen by the local

Makefile tricks

2002-03-20 Thread S.D.Mechveliani
Dear ghc-5.02.2-i386-unknown-linux, (RedHat-6.1 Linux machine, libc-2.1.2), Can you, please explain the following effect Main.hs: main = putStr hello\n Makefile: - obj: ghc -c -O Main.hs +RTS -M10m -RTS -- Running $ tcsh make

sorry for false alarm

2002-03-20 Thread S.D.Mechveliani
I am sorry. It was a false alarm. I wrote recently about Makefile faults when applying ghc. The is also old ghc on this machine in the system area. I set alias to new ghc (in my user directory), but `make' does not know about alias and applies old ghc, which does not understand some

warning: `RLIM_INFINITY' redefined

2002-03-20 Thread S.D.Mechveliani
Dear ghc-5.02.2-i386-unknown-linux, When compiling with -O, you report sometimes things like In file included from /usr/include/sys/resource.h:25, from /share/nfs/users/internat/mechvel/ghc/5.02.2/inst/lib/ghc-5.02.2/

RE: Makefile tricks

2002-03-20 Thread Simon Marlow
(RedHat-6.1 Linux machine, libc-2.1.2), Can you, please explain the following effect Main.hs: main = putStr hello\n Makefile: - obj: ghc -c -O Main.hs +RTS -M10m -RTS -- Running $ tcsh make obj ghc -c -O

Re: finding ....

2002-03-20 Thread Jon Fairbairn
Could someone post an example of the creation of a temporary file where race conditions are important? /any/ programme that does this on a multi-process system. Between the test for existence and the creation, some other process could have created a file of the same name. Then the create

Re: finding ....

2002-03-20 Thread David Feuer
On Wed, Mar 20, 2002, Jon Fairbairn wrote: Could someone post an example of the creation of a temporary file where race conditions are important? /any/ programme that does this on a multi-process system. Occasionally, the presence or absence of a file (usually empty) of a certain name in

Re: using less stack

2002-03-20 Thread Jon Fairbairn
Thanks for all the advice. In the end, I couldn't make $! work for me (it always seems to be harder than I think it will be to use it, and $! and deepSeq makes my code run slowly). :-( But a continuation passing style foldl worked wonderfully. As Jay Cox pointed out by email, my answer

Re: finding ....

2002-03-20 Thread Jon Fairbairn
On Wed, Mar 20, 2002, Jon Fairbairn wrote: Could someone post an example of the creation of a temporary file where race conditions are important? /any/ programme that does this on a multi-process system. Occasionally, the presence or absence of a file (usually empty) of a certain

Re: Haskell slicing tool?

2002-03-20 Thread Olaf Chitil
[EMAIL PROTECTED] wrote: Are there any tools to perform program slicing on Haskell? I often find myself wanting to find all fromJusts invoked from the current function, or all functions that use a particular member of my monad's ADT. Actually I was hoping for a static tool. I'd be

Re: RE: question about concurrency implementation

2002-03-20 Thread Phil Trinder
Dean, If the costs are the same, does that rely on there being no true concurrency in the current implementations? It depends what you mean by true concurrency: from the point of view of the Haskell programmer, GHC's implementation of concurrency is almost preemptive, because we can

Re: using less stack

2002-03-20 Thread C.Reinke
cpsfold f a [] ú cpsfold f a (x:xs) ÿ x a (\y - cpsfold f y xs) and f takes a continuation, Bob's my uncle, and I have a program that runs quickly in constant space! Good. I'm curious to know from other readers whether continuations like this are the only way of solving it,

Re: using less stack

2002-03-20 Thread Hal Daume III
strict a = seq a False foldl' f a l | strict a = annotation foldl' f a [] = a foldl' f a (x:xs) = foldl' f (f a x) xs Or, perhaps strict a = a `deepSeq` False or strict a = rnf a `seq` False if you prefer the rnf notation instead. depending on what you want...

Re: using less stack

2002-03-20 Thread Amanda Clare
[cpsfold omitted] Actually, and quite apart from it being cumbersome to use, I've got my doubts about whether this cpsfold really does the job (is that just me missing some point?-). It does the job for me! In practical terms I can see it works. I'm not an expert - I may have this all

Re: using less stack

2002-03-20 Thread Olaf Chitil
with the cpsfold I get f x1 a (\y1 - f x2 y1 (\y2 - f x3 y3 (\y3 - f x4 y4 (\y4 - y4) so x1 and a are available immediately for f to use, and f x1 a is the outermost expression so will be evaluated first. Yes, however, if f just calls its continuation without forcing the evaluation of

Re: using less stack

2002-03-20 Thread C.Reinke
Actually, and quite apart from it being cumbersome to use, I've got my doubts about whether this cpsfold really does the job (is that just me missing some point?-). It does the job for me! In practical terms I can see it works. ..[explanation omitted].. I didn't express myself well:

Re: Bug in IO libraries when sending data through a pipe?

2002-03-20 Thread Volker Wysk
On Mit, 2002-03-20 at 07:00, Jens Petersen wrote: Jens Petersen [EMAIL PROTECTED] writes: The problem is that the child process doesn't receive all the data which the parent sends. It's as if hPutStr vonh txt sends the data lazily somehow, and hClose vonh closes the pipe prematurely.

¹âÁÙÌøÎèÀ¼£¬ÓкñÀñÅÉËÍ------ÊýÂëÀñÆ·£¡

2002-03-20 Thread sohufm365sina
Title: ÌøÎèÀ¼¹ºÎïÉÌ³Ç ¡¤ËùÓÐÌøÎèÀ¼Ð¡¢ÀÏÓû§¶¼½«Ãâ·Ñ»ñµÃ¼ÛÖµ10ÔªµÄÌøÎèȯ ¡¤¹ºÎォ°´¹ºÎïÿ100ÔªËÍ5ÔªµÄ·½Ê½»ñÔùÌøÎèȯ ¡¤ÌøÎèÀ¼É̳ÇÌرðÔùËÍMP3»ú¡¢ÊÖ»úµÈÌرðÔùÆ·

Re: Haskell puzzles!

2002-03-20 Thread Zdenek Dvorak
Hello. - All the answers are at the end of this mail. - 1) Are e1 and e2 equal? f (x:xs) y = x g (x:xs)= \y - x e1 = seq (f []) 1 e2 = seq (g []) 1 Should not these be f (x:xs) y = y g (x:xs)= \y - y ? Otherwise, both e1

Re: finding ....

2002-03-20 Thread Lennart Augustsson
I'm not saying that we always need to write perfect code. Sometimes the cost is too high doing it the right way (like adding a new system call). But what I am saying is that you should be aware of these things; all the examples you gave are broken. Sometimes it doesn't matter much, but I'd hate

Re: finding ....

2002-03-20 Thread Mark Carroll
On Wed, 20 Mar 2002, Lennart Augustsson wrote: (snip) examples you gave are broken. Sometimes it doesn't matter much, but I'd hate to see that code like that, e.g., in the control software for an airplane. (Or in the kernel for that matter.) ...or, indeed, in any software that might be

literate haskell

2002-03-20 Thread Jorge Adriano
Why is it necessary to leave a blank line between comments and code? I'm using LaTeX in my lhs files, with the code inside a verbatim environment, and I'd rather start writing my code right after the \begin{verbatim}. I'd also like to know if anyone as changed is xemacs configuration file in

Re: Haskell slicing tool?

2002-03-20 Thread Richard Uhtenwoldt
Olaf Chitil writes: [EMAIL PROTECTED] wrote: Are there any tools to perform program slicing on Haskell? I often find myself wanting to find all fromJusts invoked from the current function, or all functions that use a particular member of my monad's ADT. Actually I was hoping for a

Re: finding ....

2002-03-20 Thread Pixel
D. Tweed [EMAIL PROTECTED] writes: [...] Could someone post an example of the creation of a temporary file where race conditions are important? myscript wants to create a temporary file called /tmp/storedStuff being half-careful, checks file doesn't exist (*) miniscule delay occurs