Chris Eidhof wrote:
On 26 nov 2007, at 19:48, Henning Thielemann wrote:
I wonder whether it is a typical mistake of beginners
to write 'return' within a do-block (that is, not at the end)
and if it is possible to avoid this mistake by clever typing.
In a proper monad 'return' can be fused
On 27 nov 2007, at 10:14, Reinier Lamers wrote:
Chris Eidhof wrote:
On 26 nov 2007, at 19:48, Henning Thielemann wrote:
I wonder whether it is a typical mistake of beginners
to write 'return' within a do-block (that is, not at the end)
and if it is possible to avoid this mistake by clever
Thomas Schilling [EMAIL PROTECTED] writes:
Haskell is a general-purpose, pure functional programming languages
that puts many interesting results from research into a practical
programming language. It's features include:
* Static typing with type inference: enables writing robust and fast
On Nov 27, 2007, at 0:54 , bbrown wrote:
I am trying to use the HTTP library 3001 for ghc 6.8 and cant
figure out how
to use a proxy to do a GET request as I am behind a proxy server.
My thinking
is that I could use the setProxy method it looks like it returns a
BrowserAction? What do I
i've written small program which demonstrates how map/reduce may be
implemented in Haskell. it counts amount of words in file, splitting
it into 64kb blocks processed by two threads. their results are
combined by another two threads. how it may be made better?
Hello, I do not know anything
i have seen the documents in
http://www.haskell.org/haskellwiki/Generalised_algebraic_datatype
but i can not run the following code on ghci
ex:
data Term x where
K :: Term (a - b - a)
S :: Term ((a - b - c) - (a - b) - a - c)
Const :: a - Term a
(:@) :: Term (a - b) - (Term a) -
On Nov 27, 2007 12:57 PM, Yu-Teh Shen [EMAIL PROTECTED] wrote:
i have seen the documents in
http://www.haskell.org/haskellwiki/Generalised_algebraic_datatype
but i can not run the following code on ghci
ex:
data Term x where
K :: Term (a - b - a)
S :: Term ((a - b - c) - (a - b)
[EMAIL PROTECTED] writes:
increment b = b + 1
This is also called 'succ' (for successor).
main = dolet b = 0
let c = randomRIO (1,2)
until (c == 1) increment b
return b
ERROR StPetersburg.hs:8 - Type error in application
*** Expression
* [EMAIL PROTECTED] wrote:
I'm trying to program an implementation of the St. Petersburg game in
Haskell. There is a coin toss implied, and the random-number generation is
driving me quite mad. So far, I've tried this:
import Random
import System.Random -- time goes on, interfaces change
On Mon, 2007-11-26 at 20:31 -0800, David Fox wrote:
On Nov 26, 2007 11:38 AM, Thomas Schilling [EMAIL PROTECTED]
wrote:
Haskell is a general-purpose, pure functional programming
languages
that puts many interesting results from research into a
main = do let b = 0
let c = randomRIO (1,2)
until (c == 1) increment b
return b
This is intended to print the number of consecutive heads (i.e., 2)
before
the first tail, but I get the following error:
ERROR StPetersburg.hs:8 - Type
On Nov 27, 2007 1:27 PM, [EMAIL PROTECTED] wrote:
Hello,
I'm trying to program an implementation of the St. Petersburg game in
Haskell. There is a coin toss implied, and the random-number generation is
driving me quite mad. So far, I've tried this:
Yeah, random number generation is one of
Thanks.
So GADT provide us to generic type to include all types, is it right?
ex:
data Parser tok a where
Zero :: Parser tok ()
One :: Parser tok ()
Check :: (tok - Bool) - Parser tok tok
Satisfy :: ([tok] - Bool) - Parser tok [tok]
Push :: tok - Parser tok a - Parser tok a
Sterling Clover wrote:
...
Finally, there's fasta.
http://shootout.alioth.debian.org/gp4/benchmark.php?test=fastalang=ghcid=2
This one really depresses me. It outperforms the previous version by
roughly 20% on my machine (PPC) but underperforms by roughly the same
amount on the shootout
On Nov 26, 2007 1:44 PM, Thomas Davie [EMAIL PROTECTED] wrote:
But the point is that this section of the site is the bit that's meant
to be an advertisement -- we're trying to encourage people to read
more,
Are we? I thought Haskell.org was intended to describe what Haskell *is*.
There are
On Nov 27, 2007 4:45 AM, Chris Eidhof [EMAIL PROTECTED] wrote:
First, some people want to use return just as an imperative programmer
would use it: to exit from a function. So the programmer doesn't
expect the commands after that return are executed.
This is more a problem with the name. I
On 27 Nov 2007, at 14:44, David Menendez wrote:
On Nov 26, 2007 1:44 PM, Thomas Davie [EMAIL PROTECTED] wrote:
But the point is that this section of the site is the bit that's meant
to be an advertisement -- we're trying to encourage people to read
more,
Are we? I thought Haskell.org was
On Tue, 2007-11-27 at 09:44 -0500, David Menendez wrote:
On Nov 26, 2007 1:44 PM, Thomas Davie [EMAIL PROTECTED] wrote:
But the point is that this section of the site is the bit
that's meant
to be an advertisement -- we're trying to
| Something I found with Dons version on my machine was that if I removed
| all the exclamation marks and the -fbang-patterns bit at the top it went
| about 20% faster as well as being much cleaner code, but with my very
| rudimentary understanding of Haskell I wasn't entirely sure it would
|
Hola Manolo,
What you are trying to do is very easy in Haskell, but you'd better
change the approach.
In short, you are trying to use b as if it was a mutable variable,
which it is not!
One could rewrite your program using mutable variables, as below:
import Data.IORef
import Random
Hi,
If available memory is low, is the
garbage collector going to eliminate
data that is still referenced, but
it knows it can be recalculated when
needed?
Thanks,
Maurício
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
On Mon, 26 Nov 2007, Jason Dusek wrote:
Among numeric types, it seems that only integer types are Bounded.
Maybe because IEEE format supports Infinity?
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
On Nov 27, 2007 10:43 AM, Maurício [EMAIL PROTECTED] wrote:
Hi,
If available memory is low, is the
garbage collector going to eliminate
data that is still referenced, but
it knows it can be recalculated when
needed?
If I understand it correctly, when a thunk is evaluated, it is actually
Simon Peyton-Jones wrote:
| Something I found with Dons version on my machine was that if I removed
| all the exclamation marks and the -fbang-patterns bit at the top it went
| about 20% faster as well as being much cleaner code, but with my very
| rudimentary understanding of Haskell I wasn't
On Tue, 27 Nov 2007, Thomas Davie wrote:
On 27 Nov 2007, at 14:44, David Menendez wrote:
On Nov 26, 2007 1:44 PM, Thomas Davie [EMAIL PROTECTED] wrote:
But the point is that this section of the site is the bit that's meant
to be an advertisement -- we're trying to encourage people to
On Tue, 27 Nov 2007 [EMAIL PROTECTED] wrote:
Hello,
I'm trying to program an implementation of the St. Petersburg game in
Haskell. There is a coin toss implied, and the random-number generation is
driving me quite mad. So far, I've tried this:
import Random
increment :: Int - Int
briqueabraque:
Hi,
After I have spawned a thread with
'forkIO', how can I check if that
thread work has finished already?
Or wait for it?
The usual trick I use is to have an MVar that child thread can set when
done, causing the main thread to wait:
main = do
done - newEmptyMVar
On Nov 27, 2007 8:14 AM, Henning Thielemann [EMAIL PROTECTED]
wrote:
On Tue, 27 Nov 2007, Thomas Davie wrote:
On 27 Nov 2007, at 14:44, David Menendez wrote:
On Nov 26, 2007 1:44 PM, Thomas Davie [EMAIL PROTECTED] wrote:
But the point is that this section of the site is the bit
On Tue, 2007-11-27 at 08:34 -0800, David Fox wrote:
On Nov 27, 2007 8:14 AM, Henning Thielemann
[EMAIL PROTECTED] wrote:
On Tue, 27 Nov 2007, Thomas Davie wrote:
On 27 Nov 2007, at 14:44, David Menendez wrote:
On Nov 26, 2007 1:44 PM,
On Nov 27, 2007 11:14 AM, Henning Thielemann
[EMAIL PROTECTED] wrote:
I think this is true, but for me it means, that we do not need another
advertisement at Haskell.org, but facts. I also expect that people
visiting the site already know about static typing and have categorized
themselves
Maurício wrote:
Hi,
After I have spawned a thread with
'forkIO', how can I check if that
thread work has finished already?
Or wait for it?
Thanks,
Maurício
The best way to do this is using Control.Exception.finally:
myFork :: IO () - IO (ThreadId,MVar ())
myFork todo =
m -
Hello,
I saw somewhere that in one of the Haskell libraries there is support
to open, read, write, ioctl, etc. to POSIX drivers, but I don't see in the
Haskell Report. ??
Kind regards, Vasili
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
vigalchin:
Hello,
I saw somewhere that in one of the Haskell libraries there is support
to open, read, write, ioctl, etc. to POSIX drivers, but I don't see in the
Haskell Report. ??
Have a look in the 'unix' library. The Haskell report defines the
language, not the
Brandon S. Allbery KF8NH wrote:
However, the IO system truncates [characters] to 8 bits. I
Should this be considered a bug? I presume that its because stdio.h
was defined in the days of ASCII-only strings, and the functions in
System.IO are defined in terms of stdio.h. But does this need to
Simon Peyton-Jones wrote:
| Something I found with Dons version on my machine was that if I removed
| all the exclamation marks and the -fbang-patterns bit at the top it went
| about 20% faster as well as being much cleaner code, but with my very
| rudimentary understanding of Haskell I wasn't
r.kelsall:
Simon Peyton-Jones wrote:
| Something I found with Dons version on my machine was that if I removed
| all the exclamation marks and the -fbang-patterns bit at the top it went
| about 20% faster as well as being much cleaner code, but with my very
| rudimentary understanding of
Oops forgot to hit reply-to-all.. resending..
N-body is looking good. I am running and amd64 3000+ on ghc 6.8.1. The
debian shootout is showing a huge gap between ghc 6.6 and g++ but I am not
seeing that gap. One concern though is that the code doesn't look very
haskellish. So much pointer
Never mind. I screwed up the timings.
The new haskell timings are still a huge improvement but they are:
-0.169075164
-0.169031665
real0m27.196s
user0m19.688s
sys 0m0.163s
On Nov 27, 2007 11:25 AM, Ryan Dickie [EMAIL PROTECTED] wrote:
Oops forgot to hit reply-to-all.. resending..
apfelmus wrote:
Benedikt Huber wrote:
type Upd a = a - a
data Ref cx t
= Ref { select :: cx - t , update :: Upd t - Upd cx }
Functional references are also called lens, I'm going to use that term
from now on.
As a minor note, I somehow prefer a single primitive
data Lens s a =
Don Stewart wrote:
...
There may well have been changes to the strictness analyser that make
some of the bangs (or most) unnecessary now. Also, its very likely
I didn't check all combinations of strict and lazy arguments for the
optimal evaluation strategy :)
I suspect the optimum details
Henning Thielemann wrote:
On Mon, 26 Nov 2007, Jason Dusek wrote:
Among numeric types, it seems that only integer types are Bounded.
Maybe because IEEE format supports Infinity?
therefore, maxBound is Infinity and minBound negative infinity?
Isaac
Luke Palmer wrote:
You can also put the line
{-# OPTIONS_GHC -fglasgow-exts #-}
At the top, to turn on glasgow extensions whenever GHC compiles this file.
I was under the impression that it's better to use the LANGUAGE pragma
rather than the catch-all Glasgow-exts option. However, I
Hi,
After I have spawned a thread with 'forkIO',
how can I check if that thread work has
finished already? Or wait for it?
The best way to do this is using
Control.Exception.finally: (...)
These techniques are needed because forkIO is a
very lightweight threading mechanism. Adding
On Tue, Nov 27, 2007 at 07:11:27PM +, Andrew Coppin wrote:
I was under the impression that it's better to use the LANGUAGE pragma
rather than the catch-all Glasgow-exts option. However, I can't actually
find a language option for GADTs... somebody care to clarify?
In GHC 6.8.1 it's
briqueabraque:
Hi,
After I have spawned a thread with 'forkIO',
how can I check if that thread work has
finished already? Or wait for it?
The best way to do this is using
Control.Exception.finally: (...)
These techniques are needed because forkIO is a
very lightweight
On Tue, 2007-11-27 at 19:11 +, Andrew Coppin wrote:
Luke Palmer wrote:
You can also put the line
{-# OPTIONS_GHC -fglasgow-exts #-}
At the top, to turn on glasgow extensions whenever GHC compiles this file.
I was under the impression that it's better to use the LANGUAGE
On Tue, 27 Nov 2007 14:41:59 -0500
Isaac Dupree [EMAIL PROTECTED] wrote:
Henning Thielemann wrote:
On Mon, 26 Nov 2007, Jason Dusek wrote:
Among numeric types, it seems that only integer types are Bounded.
Maybe because IEEE format supports Infinity?
therefore, maxBound is
On Tue, 27 Nov 2007, Josh Lee wrote:
On Tue, 27 Nov 2007 14:41:59 -0500
Isaac Dupree [EMAIL PROTECTED] wrote:
Henning Thielemann wrote:
On Mon, 26 Nov 2007, Jason Dusek wrote:
Among numeric types, it seems that only integer types are Bounded.
Maybe because IEEE format
Hi guys.
Somebody just introduced me to a thing called Project Euler. I gather
it's well known around here...
Anyway, I was a little bit concerned about problem #7. The problem is
basically figure out what the 10,001st prime number is. Consider the
following two programs for solving this:
On Nov 27, 2007 2:34 PM, Andrew Coppin [EMAIL PROTECTED] wrote:
Hi guys.
Somebody just introduced me to a thing called Project Euler. I gather
it's well known around here...
Anyway, I was a little bit concerned about problem #7. The problem is
basically figure out what the 10,001st prime
Actually, IEEE numbers are designed in such a way, that if you interpret
their bits as integer number, then 'succ' leads you to the next larger
representable number. Thus you only have to cast from Float or Double to
Int32 or Int64 respectively, call enumFromTo, then cast back to Float or
andrewcoppin:
Hi guys.
Somebody just introduced me to a thing called Project Euler. I gather
it's well known around here...
Anyway, I was a little bit concerned about problem #7. The problem is
basically figure out what the 10,001st prime number is. Consider the
following two programs
On Tue, 27 Nov 2007, Andrew Coppin wrote:
So, now I have a Haskell version that's only several hundred times
slower. Neither program is especially optimised, yet the C version is
drastically faster. This makes me sad. :-(
I think the C version is so much faster because it does not need
Josh Lee wrote:
On Tue, 27 Nov 2007 14:41:59 -0500
Isaac Dupree [EMAIL PROTECTED] wrote:
Henning Thielemann wrote:
On Mon, 26 Nov 2007, Jason Dusek wrote:
Among numeric types, it seems that only integer types are Bounded.
Maybe because IEEE format supports Infinity?
Isaac Dupree wrote:
apfelmus wrote:
dup :: Lens a (a,a)
dup = id id
Which component of the pair should
put dup :: a - (a,a) - (a,a)
change? The first, the second, or even both?
[...]
put :: Lens s a - a - s - s
put x = flip $ snd . focus x
wouldn't
put dup :: (a,a) - a - a
On 11/27/07, Andrew Coppin [EMAIL PROTECTED] wrote:
Hi guys.
Somebody just introduced me to a thing called Project Euler. I gather
it's well known around here...
Anyway, I was a little bit concerned about problem #7. The problem is
basically figure out what the 10,001st prime number is.
On Tue, 27 Nov 2007, Bit Connor wrote:
Actually, IEEE numbers are designed in such a way, that if you interpret
their bits as integer number, then 'succ' leads you to the next larger
representable number. Thus you only have to cast from Float or Double to
Int32 or Int64 respectively,
Andrew Coppin wrote:
Also, I'm stuck with problem #10. (Find the sum of all primes less
than 1 million.) I've let the program run for well over 15 minutes,
and still no answer is forthcomming. It's implemented using the same
primes function as above, with a simple filter and sum. (The type has
Bit Connor wrote:
Also, a related question: How do you convert from Float - Double, and
the reverse? Only thing I could find is (fromRational . toRational)
which I also imagine to be slow, and I also wonder about accuracy.
realToFrac
-Yitz
___
On Nov 27, 2007 8:54 PM, Olivier Boudry [EMAIL PROTECTED] wrote:
Hi Andrew,
I don't remember who I stole this prime computation from, but it is very
fast (10001's prime in 0.06 sec with Int and 0.2 with Integer on my machine)
and not overly complex:
primes :: [Integer]
primes = 2 :
On Nov 27, 2007 8:44 PM, Andrew Coppin [EMAIL PROTECTED] wrote:
Andrew Coppin wrote:
Also, I'm stuck with problem #10. (Find the sum of all primes less
than 1 million.) I've let the program run for well over 15 minutes,
and still no answer is forthcomming. It's implemented using the same
On the other hand, I must relay to you how much fun I had with certain
other problems.
For example, problem #12. I started with this:
triangles = scanl1 (+) [1..]
divisors n = length $ filter (\x - n `mod` x == 0) [1..n]
answer = head $ dropWhile (\n - divisors n 500) triangles
Sadly,
Andrew Coppin wrote:
On the other hand, I must relay to you how much fun I had with certain
other problems.
You may want to look at:
http://haskell.org/haskellwiki/Euler_problems
and make some contributions. But be very careful
what you peek at, so don't spoil your own fun.
Regards,
Yitz
On Tue, 27 Nov 2007, Yitzchak Gale wrote:
Bit Connor wrote:
Also, a related question: How do you convert from Float - Double, and
the reverse? Only thing I could find is (fromRational . toRational)
which I also imagine to be slow, and I also wonder about accuracy.
realToFrac
added to
On 11/27/07, Sebastian Sylvan [EMAIL PROTECTED] wrote:
That is indeed a nice and clear version that's pretty fast. It's
basically the same as the C version except backwards (i.e. examine a
number and work backwards through its divisors, rather than filling in
a map of all multiples of a known
Brent Yorgey wrote:
The algorithm you use to compute primes is actually quite inefficient,
and in particular, it is NOT the same algorithm that the C program is
using, despite first appearances! The call to 'filter' in the sieve
function works by checking *every* number for divisibility by p,
David Menendez wrote:
Thomas Davie wrote:
But the point is that this section of the site is the bit that's meant
to be an advertisement -- we're trying to encourage people to read
more,
Are we? I thought Haskell.org was intended to describe what Haskell *is*.
There are plenty of articles
On Tue, 27 Nov 2007, apfelmus wrote:
More specifically, fact means something that you can easily check
yourself. Robust/maintainable/testable code are things you _can't_
easily check yourself without already learning the language.
+1
But shorter code is a fact you can easily check, for
Hello,
What is involved in building a package on cygwin?
Kind regards, Vasya
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Henning Thielemann wrote:
apfelmus wrote:
Back then, I was given the task to calculate some sequence
of numbers which I did in one page of C code. So far so good, but when I
asked the task assigner about his solution, he responded: Ah, this
problem, that's 1 line in Haskell. Well, 2 lines if
Don Stewart wrote:
This is an FAQ.
Unless you use the same algorithm and data types in benchmarks, you're
not really benchmarking anything. And expecting one of the worst
possible algorithms to be good is hoping for a little too much :)
Well, if I was comparing my Haskell against some
I thought it would be a nice exercise (and a good learning experience) to
try and solve the nbody problem from the debian language shootout.
Unfortunately, my code sucks. There is a massive space leak and performance
is even worse. On the bright side, my implementation is purely functional.
My
On Nov 27, 2007 1:33 PM, apfelmus [EMAIL PROTECTED] wrote:
David Menendez wrote:
Thomas Davie wrote:
But the point is that this section of the site is the bit that's meant
to be an advertisement -- we're trying to encourage people to read
more,
Are we? I thought Haskell.org was
Ok, it looked good, but then I had to install first the hslogger. Here I
found the same problem, but I had now the scheme, so I began to change.
This it worked fine for configure, but when I try to build, I get:
[6 of 6] Compiling System.Log.Logger ( src/System/Log/Logger.hs,
Just thought I install the latest version (0.4.0) from hackage and test it.
Build and install went fine, but then it gets strange:
[EMAIL PROTECTED]: .../haskell/cabal-install-0.4.0 sudo runhaskell Setup.lhs
install
Installing: /usr/local/bin
[EMAIL PROTECTED]: .../haskell/cabal-install-0.4.0
If you would like to wait on multiple threads, you can use STM like so:
import Control.Concurrent
import Control.Concurrent.STM
import Control.Exception
main = do
tc - atomically $ newTVar 2
run tc (print (last [1..1]))
run tc (print (last [1..11000]))
print Waiting
This is an idea that has been kicking around for a long time. But no
Haskell implementation that I know of implements it.
On Nov 27, 2007 3:43 PM, Maurício [EMAIL PROTECTED] wrote:
Hi,
If available memory is low, is the
garbage collector going to eliminate
data that is still referenced,
I was just watching top while executing this and noticed that it
really only used one core (I am using GHC 6.8.1 on a MacBook). Does
anyone know why?
On Nov 28, 2007 10:34 AM, Brad Clow [EMAIL PROTECTED] wrote:
If you would like to wait on multiple threads, you can use STM like so:
import
On Tuesday 27 November 2007 18:46:00 Brad Clow wrote:
I was just watching top while executing this and noticed that it
really only used one core (I am using GHC 6.8.1 on a MacBook). Does
anyone know why?
Did you compile with -threaded, and run with +RTS -N2?
Cheers,
Spencer Janssen
Silly mistake. I had compiled with -threaded, but forgot the +RTS -N2.
However, I have a more complex app, where I haven't forgotton to use
the right flags :-) and the utilisation of cores is very poor. I am
thinking it is due to laziness. I am currently wondering how GHC
handles the case where
Don Stewart wrote:
Beautiful code can be very efficient.
Indeed, as I recently the opportunity to demonstrate to my co-workers by
re-implementing a script written in Perl that turned out to be just a bit
too slow to be useful in practice. My version was not only one tenth the
code size and about
But IEEE can be run with projective infinity in which case there is only one
of them.
On Nov 27, 2007 7:41 PM, Isaac Dupree [EMAIL PROTECTED] wrote:
Henning Thielemann wrote:
On Mon, 26 Nov 2007, Jason Dusek wrote:
Among numeric types, it seems that only integer types are Bounded.
Silly or not, if I compile with -threaded, I always link in the
one-liner C file:
char *ghc_rts_opts = -N2;
so I don't have to remember at runtime whether it should run with 2
cores or not. This just changes the default to 2 cores, so I am still
free to run on only one core with the
Brad Clow:
However, I have a more complex app, where I haven't forgotton to use
the right flags :-) and the utilisation of cores is very poor. I am
thinking it is due to laziness. I am currently wondering how GHC
handles the case where the function that is being forked uses lazy
arguments?
Among numeric types, it seems that only integer types are Bounded.
Maybe because IEEE format supports Infinity?
therefore, maxBound is Infinity and minBound negative infinity?
But IEEE can be run with projective infinity in which case there is only one
of them.
Well, if Double becomes a
On Nov 28, 2007 11:30 AM, Matthew Brecknell [EMAIL PROTECTED] wrote:
Even with threads, results are evaluated only when they are needed (or
when forced by a strictness annotation). So the thread that needs a
result (or forces it) first will be the one to evaluate it.
So does GHC implement some
ben.franksen:
Just thought I install the latest version (0.4.0) from hackage and test it.
Build and install went fine, but then it gets strange:
[EMAIL PROTECTED]: .../haskell/cabal-install-0.4.0 sudo runhaskell Setup.lhs
install
Installing: /usr/local/bin
[EMAIL PROTECTED]:
Brad Clow:
If you would like to wait on multiple threads, you can use STM like so:
import Control.Concurrent
import Control.Concurrent.STM
import Control.Exception
main = do
tc - atomically $ newTVar 2
run tc (print (last [1..1]))
run tc (print (last [1..11000]))
I tried the same thing on my box, and indeed the version that isn't
strict in the rand function outperforms the original by a fair
margin, and seems to do slightly better than my own as well. Killing
the bangs in the unroll function also seems to help (especially that
in (s!, Just r')).
On Nov 27, 2007, at 11:34 AM, David Fox wrote:
In that case we need to identify all the groups that the front page
is serving and create separate areas for each, all above the fold
as it were:
1. A sales pitch for new users. I see how much this disturbs
some people, but maybe it is
Brad Clow:
So does GHC implement some sychronisation given that a mutation is
occuring under the covers, ie. the thunk is being replaced by the
result?
I believe so, but I have no idea of the details.
I am using a TVar to build results of forked functions in. I had
a quick go at changing to
On Nov 28, 2007 2:39 PM, Matthew Brecknell [EMAIL PROTECTED] wrote:
Brad Clow:
Don's library is fairly simple. It adds a strictness annotation to force
each value you write to a MVar or Chan, so for example,
(Control.Concurrent.MVar.Strict.putMVar v x) is basically equivalent to
I sat down tonight and did tons of good learning (which was my goal). Yes,
the variable names in the unrolling is a little ugly but it helps to read
the C++ version for context. There are two for loops (advN is each inner one
unrolled). the other function names match the C++ version. It was my
93 matches
Mail list logo