[Haskell-cafe] Using tiny (atomic) mutables between multiple threads

2009-09-13 Thread Belka
Hello, Haskell Cafe! I used an MVar to signalize to many threads, when it's time to finish their business (I called it a LoopBreaker). Recently I realized, that it might be too expensive (to use MVar) for cases when threads are many and all of them read my LoopBreaker intensively. This

Re: [Haskell-cafe] Using tiny (atomic) mutables between multiple threads

2009-09-13 Thread Bulat Ziganshin
Hello Belka, Sunday, September 13, 2009, 10:45:35 AM, you wrote: i suggest you to use IORef Bool instead - as it was said once by SimonM, it's safe to use in m/t environment, of course without all fancy features of MVar locking if you need to be as fast as possible, IOUArray (1,1) may be used -

Re: [Haskell-cafe] Using tiny (atomic) mutables between multiple threads

2009-09-13 Thread Bulat Ziganshin
Hello Belka, Sunday, September 13, 2009, 10:45:35 AM, you wrote: I used an MVar to signalize to many threads, when it's time to finish their business (I called it a LoopBreaker). btw, may be you can change the architecture? in particular, where these threads getting their jobs? if they read

Re: HECC License (was: [Haskell-cafe] Haskell Weekly News: Issue 130 - September 12, 2009)

2009-09-13 Thread Marcel Fourné
Thomas DuBuisson wrote:   hecc-0.1. Marcel Fourné [5]announced the first release of hecc, the Elliptic Curve Cryptography Library for Haskell. Implemented are   affine, projective, jacobian and modified jacobian point formats with the basic operations. Included as an Example is a basic ECDH

Re: [Haskell-cafe] why these two are not equivalent?

2009-09-13 Thread Max Rabkin
On Sat, Sep 12, 2009 at 9:52 PM, Diego Souza dso...@bitforest.org wrote: I assumed Data.Map was a tree internally and keep elements ordered, so the following would sort the input and print duplicates in O(n log n), as the C++ version does: sbank :: [B.ByteString] - [(B.ByteString,Int)] sbank

[Haskell-cafe] ANNOUNCE: arbtt-0.1

2009-09-13 Thread Joachim Breitner
Hi, I just uploaded the Automatic Rule-Based Time Tracking tool on hackage. It is written in Haskell (duh :-)) and might be interesting for some of you to either use or hack on (or both). I have put an introduction on

Re: [Haskell-cafe] Re: Darcs and NFS Resolution

2009-09-13 Thread Duncan Coutts
On Sat, 2009-09-12 at 23:24 +0100, Ganesh Sittampalam wrote: Darcs already has a WIN32-specific workaround for renaming going wrong when the new file exists, and my initial guess was that was what was going wrong here. BTW, this is not necessary afaik. Rename over an existing file works

[Haskell-cafe] Community.haskell.org is down

2009-09-13 Thread Neil Mitchell
Hi, http://community.haskell.org/ seems to be down for me. In general, who should this be reported to? Thanks Neil ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] why these two are not equivalent?

2009-09-13 Thread Diego Souza
On Sun, Sep 13, 2009 at 11:34:16AM +0200, Max Rabkin wrote: That is part of the contract of toAscList (the Asc stands for ascending order), but because of the way Map is implemented, the result of toList is also sorted. Cool. It is good to know that toAscList and toList would produce the same

Re: [Haskell-cafe] Community.haskell.org is down

2009-09-13 Thread Joe Fredette
Confirmed for me, I actually have no idea who owns C.H.O, but a WHOIS gives the Yale University Comp. Sci. Dept. Haskell Group as the registrant, maybe someone over there needs to take a look? /Joe On Sep 13, 2009, at 1:17 PM, Neil Mitchell wrote: Hi, http://community.haskell.org/ seems

[Haskell-cafe] trouble compiling Crypto-4.2.0 / trouble with cabal

2009-09-13 Thread mf-hcafe-15c311f0c
Hi, Cabal is still fighting me all the time. Its latest move is to be oblivious of some of the installed packages: $ cabal unpack crypto Unpacking Crypto-4.2.0... $ cd Crypto-4.2.0/ $ runghc ./Setup.hs configure --prefix=/tmp2/ Configuring Crypto-4.2.0... Setup.hs: At least the following

Re: [Haskell-cafe] trouble compiling Crypto-4.2.0 / trouble with cabal

2009-09-13 Thread Thomas DuBuisson
Cabal, the library you are using when manuallying running Setup.hs, assumes you are doing a global installation and will ignore locally installed libraries (iirc). If you do 'cabal install crypto', cabal-install defaults to user installs and will use the user libraries. Thomas On Sun, Sep 13,

[Haskell-cafe] [Solved] Re: trouble compiling Crypto-4.2.0 / trouble with cabal

2009-09-13 Thread mf-hcafe-15c311f0c
works, thanks! (: actually, what i did in the end is this (installing everything for my user locally): runghc ./Setup.hs configure --user --prefix=/tmp2/ runghc ./Setup.hs build ... (I first did the 'cabal install crypto', but for ghc-6.10.4 that didn't work. will start debugging now.)

[Haskell-cafe] Re: Using tiny (atomic) mutables between multiple threads

2009-09-13 Thread Felix Martini
Bulat Ziganshin wrote: i suggest you to use IORef Bool instead - as it was said once by SimonM, it's safe to use in m/t environment, of course without all fancy features of MVar locking Is it also safe for other types such as Int? And is this documented somewhere? If not it would be helpful to

Re: [Haskell-cafe] Community.haskell.org is down

2009-09-13 Thread David Fox
I assume this is the same as code.haskell.org, which is also down? On Sun, Sep 13, 2009 at 10:31 AM, Joe Fredette jfred...@gmail.com wrote: Confirmed for me, I actually have no idea who owns C.H.O, but a WHOIS gives the Yale University Comp. Sci. Dept. Haskell Group as the registrant, maybe

[Haskell-cafe] Do I have this right? Remembering Memoization!

2009-09-13 Thread Casey Hawthorne
Do I have this right? Remembering Memoization! For some applications, a lot of state does not to be saved, since initialization functions can be called early, and these functions will remember - (memoize) their results when called again, because of lazy evaluation? -- Regards, Casey

[Haskell-cafe] Haskell#? F#?

2009-09-13 Thread Casey Hawthorne
The other morning, someone was telling me they had converted most of their VB financial/stock market code to F#. Whereas VB only used one core, the F# code used all four cores. In one software developers meeting, someone was saying that since database work is mostly all state, he didn't see the

[Haskell-cafe] Haskell#? F#?

2009-09-13 Thread Casey Hawthorne
The other morning, someone was telling me they had converted most of their VB financial/stock market code to F#. Whereas VB only used one core, the F# code used all four cores. In one software developers meeting, someone was saying that since database work is mostly all state, he didn't see the

Re: [Haskell-cafe] Do I have this right? Remembering Memoization!

2009-09-13 Thread Mark Wotton
On 14/09/2009, at 9:28 AM, Casey Hawthorne wrote: Do I have this right? Remembering Memoization! For some applications, a lot of state does not to be saved, since initialization functions can be called early, and these functions will remember - (memoize) their results when called again,

RE: [Haskell-cafe] Haskell#? F#?

2009-09-13 Thread Michael Giagnocavo
In one software developers meeting, someone was saying that since database work is mostly all state, he didn't see the advantage of a functional programming language. Sigh. I'm still waiting for someone to point out how exactly functional languages do a lesser job here. If this was in relation

Re: HECC License (was: [Haskell-cafe] Haskell Weekly News: Issue 130 - September 12, 2009)

2009-09-13 Thread Thomas DuBuisson
- I hope it finds its way into the crypto library. Will have to look up their API and brush my code up a bit. Fair enough, but the Crypto library is past due for a major overhaul. I just stirred a pot about networking and still need to get around to seriously addressing that so I won't be

[Haskell-cafe] Plotting parametric functions in Haskell

2009-09-13 Thread Rafael Cunha de Almeida
Hello, I think it would be interesting to plot and visualize parametric (and other kind of functions) using the haskell language to define them [functions]. Does anyone know about some software or API that does just that? I started writing a plotter to do that using hopengl. But my computer

Re: [Haskell-cafe] Using tiny (atomic) mutables between multiple threads

2009-09-13 Thread Belka
Thank you, Bulat, for both your suggestions! 1. Since Haskell uses 1 byte for Bool (I confidently guess) and it's safe, it would also be safe to use IORef Word8. Moreover, I found http://hackage.haskell.org/packages/archive/ArrayRef/0.1.3.1/doc/html/Data-Ref-Unboxed.html#v%3AmodifyIOURef your

Re: [Haskell-cafe] why these two are not equivalent?

2009-09-13 Thread Iavor Diatchki
Hi, It seems that the problem is the site is using GHC 6.6.1, and something was broken at the time (I have not looked into what that is). Here are the outputs that I get for the little example on the site that you posted: GHC 6.10.3 and C++: On Sun, Sep 13, 2009 at 10:15 AM, Diego Souza

Re: [Haskell-cafe] why these two are not equivalent?

2009-09-13 Thread Iavor Diatchki
(argh, sorry about that, I pressed something and gmail sent my unfinished email!) On Sun, Sep 13, 2009 at 9:54 PM, Iavor Diatchki iavor.diatc...@gmail.com wrote: Hi, It seems that the problem is the site is using GHC 6.6.1, and something was broken at the time (I have not looked into what that

Re: [Haskell-cafe] Re: Using tiny (atomic) mutables between multiple threads

2009-09-13 Thread Bulat Ziganshin
Hello Felix, Monday, September 14, 2009, 2:39:17 AM, you wrote: i suggest you to use IORef Bool instead - as it was said once by SimonM, it's safe to use in m/t environment, of course without all fancy features of MVar locking Is it also safe for other types such as Int? And is this

[Haskell-cafe] ANNOUNCE: LambdaINet-0.1.0, Graphical Interaction Net Evaluator for Optimal Evaluation

2009-09-13 Thread Paul L
It's available on Hackage DB at http://hackage.haskell.org/package/LambdaINet Thanks to Kim-Ee Yeoh for pushing me into releasing this piece of code I wrote two years ago. I'll just quote the README from the source tarball below. LambdaINet == LambdaINet implements an interaction net

Re[2]: [Haskell-cafe] Using tiny (atomic) mutables between multiple threads

2009-09-13 Thread Bulat Ziganshin
Hello Belka, Monday, September 14, 2009, 8:05:26 AM, you wrote: http://www.haskell.org/haskellwiki/Library/ArrayRef the corresponding article in HaskellWiki , so I plan to use IOURef Word8. I if it's compatible with your ghc version :D i don't support this library but other people may keep it