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
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
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
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/
(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
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
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
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
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
[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
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
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,
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...
[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
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
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:
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.
Title: ÌøÎèÀ¼¹ºÎïÉ̳Ç
¡¤ËùÓÐÌøÎèÀ¼Ð¡¢ÀÏÓû§¶¼½«Ãâ·Ñ»ñµÃ¼ÛÖµ10ÔªµÄÌøÎèȯ
¡¤¹ºÎォ°´¹ºÎïÿ100ÔªËÍ5ÔªµÄ·½Ê½»ñÔùÌøÎèȯ
¡¤ÌøÎèÀ¼É̳ÇÌرðÔùËÍMP3»ú¡¢ÊÖ»úµÈÌرðÔùÆ·
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
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
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
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
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
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
24 matches
Mail list logo