[Haskell-cafe] runST readSTRef type error

2011-05-04 Thread Ken Takusagawa II
I run into the following type error: foo :: ST s (STRef s Int) - Int foo p = (runST (p = readSTRef)) with ghc 6.12.1 st.hs:8:16: Couldn't match expected type `s1' against inferred type `s' `s1' is a rigid type variable bound by the polymorphic type `forall s1. ST s1 a' at

Re: [Haskell-cafe] Crypto-api performance

2011-05-04 Thread Johan Brinch
On Tue, May 3, 2011 at 23:14, Daniel Fischer daniel.is.fisc...@googlemail.com wrote: did you notice that the comment says 128KB strings for ps and lps, but they are in fact 1MB strings: -- 128KB strings ps = B.replicate (2^20) 0 lps = L.replicate (2^20) 0 ? If not, the throughput would

Re: [Haskell-cafe] Crypto-api performance

2011-05-04 Thread Peter Simons
Also, it appears that crypto-api needs vast amounts of memory when compiled with optimization enabled. The latest version 0.6.1 is effectively unbuildable on my EeePC, which has only 1GB RAM. That property is fairly undesirable for a library package. Take care, Peter

Re: [Haskell-cafe] runST readSTRef type error

2011-05-04 Thread Edward Z. Yang
Hello Ken, Strictly speaking, you only need Rank-2 types. This indeed the right way to fix the problem. Cheers, Edward Excerpts from Ken Takusagawa II's message of Wed May 04 02:00:49 -0400 2011: I run into the following type error: foo :: ST s (STRef s Int) - Int foo p = (runST (p =

Re: [Haskell-cafe] runST readSTRef type error

2011-05-04 Thread Maciej Marcin Piechotka
On Wed, 2011-05-04 at 02:00 -0400, Ken Takusagawa II wrote: I run into the following type error: foo :: ST s (STRef s Int) - Int foo p = (runST (p = readSTRef)) with ghc 6.12.1 st.hs:8:16: Couldn't match expected type `s1' against inferred type `s' `s1' is a rigid type

Re: [Haskell-cafe] Please add a method for optimized concat to the Semigroup class

2011-05-04 Thread John Lato
From: Edward Kmett ekm...@gmail.com On Tue, May 3, 2011 at 3:43 PM, Yitzchak Gale g...@sefer.org wrote: I'm sure there are countless other natural examples of semigroups in the wild, and that the typical non-trivial ones will benefit from an optimized sconcat. Sold! (modulo the

Re: [Haskell-cafe] Please add a method for optimized concat to the Semigroup class

2011-05-04 Thread Edward Kmett
On Wed, May 4, 2011 at 7:40 AM, John Lato jwl...@gmail.com wrote: From: Edward Kmett ekm...@gmail.com On Tue, May 3, 2011 at 3:43 PM, Yitzchak Gale g...@sefer.org wrote: I'm sure there are countless other natural examples of semigroups in the wild, and that the typical non-trivial ones

Re: [Haskell-cafe] Fwd: Re: Binary and Serialize classes

2011-05-04 Thread Evan Laforge
On Tue, May 3, 2011 at 7:13 AM, Alberto G. Corona agocor...@gmail.com wrote: E1610With the exception of heavy  serialization usage, for example, in very optimized RPC applications (and even there SOAP shows that this is not ever the case), text serialization is better. The unwritten rules of

[Haskell-cafe] warning - Euler problem spoiler enclosed

2011-05-04 Thread Barbara Shirtcliff
Hi, In the following solution to problem 24, why is nub ignored? I.e. if you do lexOrder of 0012, you get twice as many permutations as with 012, even though I have used nub. puzzled, Bar -- file Euler.hs module Euler where import Data.List {- problem 24 A permutation is an ordered

Re: [Haskell-cafe] warning - Euler problem spoiler enclosed

2011-05-04 Thread Chris Smith
On Wed, 2011-05-04 at 07:13 -0600, Barbara Shirtcliff wrote: In the following solution to problem 24, why is nub ignored? I.e. if you do lexOrder of 0012, you get twice as many permutations as with 012, even though I have used nub. lexOrder :: [Char] - [[Char]] lexOrder s | length s == 1

Re: [Haskell-cafe] Please add a method for optimized concat to the Semigroup class

2011-05-04 Thread John Lato
On Wed, May 4, 2011 at 1:25 PM, Edward Kmett ekm...@gmail.com wrote: On Wed, May 4, 2011 at 7:40 AM, John Lato jwl...@gmail.com wrote: From: Edward Kmett ekm...@gmail.com On Tue, May 3, 2011 at 3:43 PM, Yitzchak Gale g...@sefer.org wrote: I'm sure there are countless other natural

Re: [Haskell-cafe] warning - Euler problem spoiler enclosed

2011-05-04 Thread Ivan Lazar Miljenovic
On 4 May 2011 13:13, Barbara Shirtcliff ba...@gmx.com wrote: Hi, In the following solution to problem 24, why is nub ignored? I.e. if you do lexOrder of 0012, you get twice as many permutations as with 012, even though I have used nub. [snip] lexOrder :: [Char] - [[Char]] lexOrder s  |

Re: [Haskell-cafe] warning - Euler problem spoiler enclosed

2011-05-04 Thread Barbara Shirtcliff
Ah, thanks! On May 4, 2011, at 7:21 AM, Ivan Lazar Miljenovic wrote: On 4 May 2011 13:13, Barbara Shirtcliff ba...@gmx.com wrote: Hi, In the following solution to problem 24, why is nub ignored? I.e. if you do lexOrder of 0012, you get twice as many permutations as with 012, even though

Re: [Haskell-cafe] warning - Euler problem spoiler enclosed

2011-05-04 Thread Daniel Fischer
On Wednesday 04 May 2011 15:13:07, Barbara Shirtcliff wrote: Hi, In the following solution to problem 24, why is nub ignored? It isn't: *LexOrder lexOrder 00 [0,0] *LexOrder lexOrder 001 [01,10,*** Exception: Prelude.(!!): index too large lexI :: Char - String - Int lexI c s = maybe 1

Re: [Haskell-cafe] warning - Euler problem spoiler enclosed

2011-05-04 Thread Barbara Shirtcliff
On May 4, 2011, at 7:21 AM, Ivan Lazar Miljenovic wrote: On 4 May 2011 13:13, Barbara Shirtcliff ba...@gmx.com wrote: Hi, In the following solution to problem 24, why is nub ignored? I.e. if you do lexOrder of 0012, you get twice as many permutations as with 012, even though I have used

Re: [Haskell-cafe] warning - Euler problem spoiler enclosed

2011-05-04 Thread Artyom Kazak
Barbara Shirtcliff ba...@gmx.com писал(а) в своём письме Wed, 04 May 2011 16:41:07 +0300: Also, note that lexOrder s@[_] = [s] is nicer than lexOrder s | length s == 1 = [s]. I agree that that initial version was a little clumsy, but your suggestion doesn't really seem to work:

Re: [Haskell-cafe] warning - Euler problem spoiler enclosed

2011-05-04 Thread Barbara Shirtcliff
On May 4, 2011, at 9:18 AM, Artyom Kazak wrote: Barbara Shirtcliff ba...@gmx.com писал(а) в своём письме Wed, 04 May 2011 16:41:07 +0300: Also, note that lexOrder s@[_] = [s] is nicer than lexOrder s | length s == 1 = [s]. I agree that that initial version was a little clumsy, but your

[Haskell-cafe] Another good video tutorial on monads

2011-05-04 Thread C K Kashyap
http://vimeo.com/20717301 I really liked how he starts off with the let statement. Regards, Kashyap ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Can't install haskellnet with ghc7

2011-05-04 Thread Charles-Pierre Astolfi
I tried to install haskellnet with mime-mail-0.2.x and an older version of the text library but it still fails with the same error. Btw, what is the best way to uninstall a package that has been installed via cabal? (or to downgrade it, fwiw) -- Cp On Tue, Apr 26, 2011 at 23:31, Vincent

Re: [Haskell-cafe] Advertisement: the Haskell Stack Overflow Q A site

2011-05-04 Thread Andrew Coppin
One of the benefits of a site like SO as a forum is the ability to record and link to prior work, edit for technical errors, and easily search and categorize past answers. It is also less prone to noise, for those suffering from cafe overload. I would also recommend SO. My

[Haskell-cafe] Can't build Gtk2hs on Windows

2011-05-04 Thread Andrew Coppin
Today I tried to install Gtk2hs. Big mistake! Last time I tried it, it was quite easy. Now that it uses Cabal, even on Windows you can compile this stuff from source fairly easily. It's just that you have to fiddle with environment variables to make it find stuff. However... 1. Since the

Re: [Haskell-cafe] Advertisement: the Haskell Stack Overflow Q A site

2011-05-04 Thread James Cook
On May 4, 2011, at 4:50 PM, Andrew Coppin wrote: One of the benefits of a site like SO as a forum is the ability to record and link to prior work, edit for technical errors, and easily search and categorize past answers. It is also less prone to noise, for those suffering from

Re: [Haskell-cafe] Advertisement: the Haskell Stack Overflow Q A site

2011-05-04 Thread Daniel Fischer
On Wednesday 04 May 2011 23:02:35, James Cook wrote: I think Haskell questions on SO tend to the opposite extreme; no matter how poorly thought-out the question, the Haskell community will descend on it like a swarm of helpful piranhas. That's a great picture. I like it. Haskell, where

Re: [Haskell-cafe] Advertisement: the Haskell Stack Overflow Q A site

2011-05-04 Thread Casey McCann
On Wed, May 4, 2011 at 5:02 PM, James Cook mo...@deepbondi.net wrote:  Haskell, on the other hand, has a small enough volume that people can at least skim the ones from the last past day or two in a fairly small amount of time. They can and, in fact, do. Or at least I do, at any rate, even

Re: [Haskell-cafe] Can't build Gtk2hs on Windows

2011-05-04 Thread Ryan Yates
On Wed, May 4, 2011 at 4:58 PM, Andrew Coppin andrewcop...@btinternet.com wrote: 2. http://hackage.haskell.org/trac/gtk2hs/ticket/1203 Another workaround for this is to install global: cabal install cairo --global Ryan ___ Haskell-Cafe mailing

Re: [Haskell-cafe] Can't build Gtk2hs on Windows

2011-05-04 Thread Daniel Fischer
On Wednesday 04 May 2011 22:58:48, Andrew Coppin wrote: Today I tried to install Gtk2hs. Big mistake! Last time I tried it, it was quite easy. Now that it uses Cabal, even on Windows you can compile this stuff from source fairly easily. It's just that you have to fiddle with environment

Re: [Haskell-cafe] Can't install haskellnet with ghc7

2011-05-04 Thread Daniel Fischer
On Wednesday 04 May 2011 21:57:51, Charles-Pierre Astolfi wrote: I tried to install haskellnet with mime-mail-0.2.x and an older version of the text library but it still fails with the same error. I just did $ cabal install --constraint=mime-mail 0.3 HaskellNet and it worked fine

Re: [Haskell-cafe] warning - Euler problem spoiler enclosed

2011-05-04 Thread Tobias Schoofs
The problem is lexOrder s@[_] = s where you just give back what you receive, i.e. [Char]. But you claim to give back [[Char]]. Try [s] on the right-hand side. On 05/04/2011 02:41 PM, Barbara Shirtcliff wrote: On May 4, 2011, at 7:21 AM, Ivan Lazar Miljenovic wrote: On 4 May 2011 13:13,

Re: [Haskell-cafe] Can't install haskellnet with ghc7

2011-05-04 Thread Robert Wills
I just uploaded a new version of haskellnet that compiles with mime-mail-0.3.0. http://hackage.haskell.org/package/HaskellNet Hope that helps -- now for some sleep... http://hackage.haskell.org/package/HaskellNet-Rob On Wed, May 4, 2011 at 11:28 PM, Daniel Fischer

Re: [Haskell-cafe] Crypto-api performance

2011-05-04 Thread Matthew Ryan Maurer
While I haven't investigated myself, from seeing haskell build processes in the past this is almost certainly not crypto-api's fault and is in fact your linker's fault. If you are not using it already, try switching to gold over ld, it may help. --Matthew Maurer On 05/04/2011 04:27 AM, Peter

Re: [Haskell-cafe] Can't build Gtk2hs on Windows

2011-05-04 Thread Albert Y. C. Lai
Just 5 weeks ago, http://thread.gmane.org/gmane.comp.lang.haskell.cafe/86738/focus=87456 Did anyone see it? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Haskell Weekly News - Issue 180

2011-05-04 Thread Daniel Santa Cruz
Welcome to issue 180 of the HWN, a newsletter covering developments in the [1]Haskell community. This release covers the week of April 24 to 30, 2011. Announcements Eric Kow suggested (http://goo.gl/bc4JM) the creation of a Haskell User Group starter kit. If you have ideas in