[Haskell-cafe] Bit streams

2008-06-18 Thread Andrew Coppin
OK, so today I tried to write my first program using the Binary library. And I've hit a snag: It appears the library will only handle data that is byte-aligned. So if I try to write three Bool values, it uses three bytes, not three bits. Before I sit down and spend 3 months designing my own

Re: [Haskell-cafe] Haskell's type system

2008-06-18 Thread Don Stewart
ronwalf: I'm trying to wrap my head around the theoretical aspects of haskell's type system. Is there a discussion of the topic separate from the language itself? Since I come from a rather logic-y background, I have this (far-fetched) hope that there is a translation from haskell's type

Re: [Haskell-cafe] Lambda and closures in PHP -- could someone please comment?

2008-06-18 Thread Jonathan Cast
On Tue, 2008-06-17 at 18:45 +0200, Karoly Negyesi wrote: Hi, The PHP community is discussing the adding of closures and lambdas to the language, see the proposal at http://wiki.php.net/rfc/closures If someone with knowledge of both languages could take a quick look it would be great. I

[Haskell-cafe] ANN: Mueval 0.3

2008-06-18 Thread Gwern Branwen
Hiya everyone. So I've uploaded Mueval 0.3 (release early, release often) http://hackage.haskell.org/cgi-bin/hackage-scripts/package/mueval-0.3. What's new? Well, I changed the printing output to be cleaner, and I made printing the inferred type optional (through a --print-type flag). In

[Haskell-cafe] blas bindings, why are they so much slower the C?

2008-06-18 Thread Anatoly Yakovenko
here is the C: #include cblas.h #include stdlib.h int main() { int size = 1024; int ii = 0; double* v1 = malloc(sizeof(double) * (size)); double* v2 = malloc(sizeof(double) * (size)); for(ii = 0; ii size*size; ++ii) { double _dd = cblas_ddot(0, v1, size, v2, size); }

Re: [Haskell-cafe] Lambda and closures in PHP -- could someone please comment?

2008-06-18 Thread Karoly Negyesi
(a) I would *never* want to use an implementation of closures like that. (b) Closures as proposed are *far* better than not having closures. Could you elaborate on a) ? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Haskell's type system

2008-06-18 Thread Luke Palmer
On Tue, Jun 17, 2008 at 2:40 PM, Ron Alford [EMAIL PROTECTED] wrote: I'm trying to wrap my head around the theoretical aspects of haskell's type system. Is there a discussion of the topic separate from the language itself? Since I come from a rather logic-y background, I have this

Re: [Haskell-cafe] Lambda and closures in PHP -- could someone please comment?

2008-06-18 Thread Richard A. O'Keefe
I believe C# already has lambdas, and Java is supposed to be getting them. PHP is playing catchup, is all. (Oh, and Eiffel has 'agents', and I think I saw something about C++ Next Degeneration, and ...) Heck, the idea has only been around in computing since the 1950s...

[Haskell-cafe] Something like scan1

2008-06-18 Thread Achim Schneider
Is there a generalisation of scan1, such that eg. foo (+) [0,1] (1,2) = [0,1,1,2,3,5,8,13,...] ? I came up with it while thinking about the equivalence of laziness and strictness resp. pull and push. To be more specific, I was thinking about ArrowLoop and how that beast generalises over

Re: [Haskell-cafe] Lambda and closures in PHP -- could someone please comment?

2008-06-18 Thread Jonathan Cast
On Wed, 2008-06-18 at 06:36 +0200, Karoly Negyesi wrote: (a) I would *never* want to use an implementation of closures like that. (b) Closures as proposed are *far* better than not having closures. Could you elaborate on a) ? I dislike the habit of implicit declaration --- strongly ---

[Haskell-cafe] Re: Compiling large code with old machine

2008-06-18 Thread Dominic Steinitz
Samuel Silva silva.samuel at gmail.com writes: Hello I'm using GHC to compile around 700K of Haskell Code generated by HaXml. How I compile this code. My machine is Windows-XP(512MB RAM, 1.5GHz) running GHC-6.8.2. Samuel, You may not want to take this approach. I'm assuming you are

[Haskell-cafe] Re: Bit Streams

2008-06-18 Thread Dominic Steinitz
OK, so today I tried to write my first program using the Binary library. And I've hit a snag: It appears the library will only handle data that is byte-aligned. So if I try to write three Bool values, it uses three bytes, not three bits. Before I sit down and spend 3 months designing my own

Re: [Haskell-cafe] Lambda and closures in PHP -- could someone please comment?

2008-06-18 Thread Karoly Negyesi
Not to criticize, mind you --- the proposal looks excellent for what it does. But I like what Haskell does worlds better. Obviously you like Haskell better given this mailing list :) I am not here to compare PHP and Haskell, I was just asking advice from people who know closures and lambdas

Re: [Haskell-cafe] Lambda and closures in PHP -- could someone please comment?

2008-06-18 Thread Jules Bean
PR Stanley wrote: With respect, do you not think it'd be wiser for the community [snip] *disgusted* This is exactly the sort of message that haskell-cafe does not normally contain. Let's not start now. This is a civilized mailing list. Either comment on the nice gentlemen's PHP closure

Re: [Haskell-cafe] Haskell's type system

2008-06-18 Thread Edsko de Vries
On Tue, Jun 17, 2008 at 04:40:51PM -0400, Ron Alford wrote: I'm trying to wrap my head around the theoretical aspects of haskell's type system. Is there a discussion of the topic separate from the language itself? Since I come from a rather logic-y background, I have this (far-fetched) hope

Re: [Haskell-cafe] Lambda and closures in PHP -- could someone please comment?

2008-06-18 Thread PR Stanley
With respect, do you not think it'd be wiser for the community [snip] *disgusted* This is exactly the sort of message that haskell-cafe does not normally contain. Let's not start now. This is a civilized mailing list. Either comment on the nice gentlemen's PHP closure proposal from a

[Haskell-cafe] ANNOUNCE: cabal-install 0.5

2008-06-18 Thread Duncan Coutts
cabal-install 0.5 = cabal-install version 0.5 is out: http://haskell.org/cabal/download.html or get it from hackage: http://hackage.haskell.org/cgi-bin/hackage-scripts/package/cabal-install If you are already using a cabal-install pre-release then you can just: $ cabal update $

Re: [Haskell-cafe] Bit streams

2008-06-18 Thread Sebastiaan Visser
On Jun 17, 2008, at 10:05 PM, Andrew Coppin wrote: OK, so today I tried to write my first program using the Binary library. And I've hit a snag: It appears the library will only handle data that is byte-aligned. So if I try to write three Bool values, it uses three bytes, not three bits.

[Haskell-cafe] Problem building GHC 6.8.3

2008-06-18 Thread Daniel Fischer
Sorry, probably stupid questions for knowledgeable folks, but after having built for a couple of hours, make died with if ifBuildable/ifBuildable base; then \ cd base setup/Setup haddock --html-location='../$pkg' \ --hyperlink-source; \ fi Preprocessing library

Re: [Haskell-cafe] Bit streams

2008-06-18 Thread Malcolm Wallace
Andrew Coppin [EMAIL PROTECTED] wrote: It appears the library will only handle data that is byte-aligned. So if I try to write three Bool values, it uses three bytes, not three bits. The original Binary library, circa 1998, was based on bit-streams rather than bytes. You might be able to

Re: [Haskell-cafe] Haskell's type system

2008-06-18 Thread Daniel GorĂ­n
On Jun 17, 2008, at 11:08 PM, Don Stewart wrote: Haskell's type system is based on System F, the polymorphic lambda calculus. By the Curry-Howard isomorphism, this corresponds to second-order logic. just nitpicking a little this should read second-order propositional logic, right?

Re: [Haskell-cafe] Lambda and closures in PHP -- could someone please comment?

2008-06-18 Thread Janis Voigtlaender
PR Stanley wrote: With respect, do you not think it'd be wiser for the community [snip] *disgusted* This is exactly the sort of message that haskell-cafe does not normally contain. Let's not start now. This is a civilized mailing list. Either comment on the nice gentlemen's PHP

Re: [Haskell-cafe] Lambda and closures in PHP -- could someone please comment?

2008-06-18 Thread Alex Sandro Queiroz e Silva
Hallo, Jules Bean wrote: PR Stanley wrote: With respect, do you not think it'd be wiser for the community [snip] *disgusted* This is exactly the sort of message that haskell-cafe does not normally contain. Let's not start now. This is a civilized mailing list. Either comment on the nice

Re: [Haskell-cafe] Bit streams

2008-06-18 Thread Bulat Ziganshin
Hello Andrew, Wednesday, June 18, 2008, 12:05:31 AM, you wrote: what Binary does, but with single-bit precision? [I presume Binary is http://haskell.org/haskellwiki/Library/AltBinary it's not maintained, so consider it as last hope :) -- Best regards, Bulat

Re: [Haskell-cafe] Re: Compiling large code with old machine

2008-06-18 Thread Bulat Ziganshin
Hello Dominic, Wednesday, June 18, 2008, 11:17:07 AM, you wrote: I'm using GHC to compile around 700K of Haskell Code generated by HaXml. may worth thinking about an alternative to 700k loc. i think he means bytes, not lines :) -- Best regards, Bulat

Re[2]: [Haskell-cafe] Bit streams

2008-06-18 Thread Bulat Ziganshin
Hello Malcolm, Wednesday, June 18, 2008, 4:36:40 PM, you wrote: The original Binary library, circa 1998, was based on bit-streams rather than bytes. You might be able to dig up a copy and bring it back to life. http://citeseer.ist.psu.edu/wallace98bits.html

Re: [Haskell-cafe] Lambda and closures in PHP -- could someone please comment?

2008-06-18 Thread PR Stanley
PR Stanley wrote: With respect, do you not think it'd be wiser for the community [snip] *disgusted* This is exactly the sort of message that haskell-cafe does not normally contain. Let's not start now. This is a civilized mailing list. Either comment on the nice gentlemen's PHP closure

Re: [Haskell-cafe] Lambda and closures in PHP -- could someone please comment?

2008-06-18 Thread Janis Voigtlaender
With respect, I will not engage in further communication on that level. PR Stanley wrote: PR Stanley wrote: With respect, do you not think it'd be wiser for the community [snip] *disgusted* This is exactly the sort of message that haskell-cafe does not normally contain. Let's not start

Re: [Haskell-cafe] Lambda and closures in PHP -- could someone please comment?

2008-06-18 Thread Luke Palmer
On Wed, Jun 18, 2008 at 1:42 PM, PR Stanley [EMAIL PROTECTED] wrote: Now, if you, Jules, Alex or some other wannabe Hitler have a problem with my freedom of expression then your best solution is to saddle up and get the hell out yourselves. This is the wrong place for setting up your tinpot

Re: [Haskell-cafe] Lambda and closures in PHP -- could someone please comment?

2008-06-18 Thread PR Stanley
Now, if you, Jules, Alex or some other wannabe Hitler have a problem with my freedom of expression then your best solution is to saddle up and get the hell out yourselves. This is the wrong place for setting up your tinpot dictatorship, Doctor! Just more evidence...

Re: [Haskell-cafe] Lambda and closures in PHP -- could someone please comment?

2008-06-18 Thread Seth Gordon
PR Stanley wrote: Blimey! Talk about rearranging the deckchairs :-) Today's xkcd seems apropos: http://xkcd.com/438/ It seems to me that if a PHP developer sees the Haskell community as a resource for advice on programming language implementation, we should take this as a compliment to the

Re: [Haskell-cafe] Something like scan1

2008-06-18 Thread Henning Thielemann
On Wed, 18 Jun 2008, Achim Schneider wrote: Is there a generalisation of scan1, such that eg. foo (+) [0,1] (1,2) = [0,1,1,2,3,5,8,13,...] ? What is the (1,2) for? I could think of foo f = List.unfoldr (\ xt@(x:xs) - Just (x, xs ++ [f xt])) foo sum [0,1] = [0,1,1,2,3,5,8,13,21,34,...

Re: [Haskell-cafe] Haskell data types and Storable class

2008-06-18 Thread Henning Thielemann
On Wed, 18 Jun 2008, Galchin, Vasili wrote: Hello, I am reading the FFI spec. Something is unclear to me. Let's assume we have data A = {b:B, ...} and data B ={ .} both of which belong to class Storable. In the A instance of Storable I want to do a

Re: [Haskell-cafe] Lambda and closures in PHP -- could someone please comment?

2008-06-18 Thread PR Stanley
It seems to me that if a PHP developer sees the Haskell community as a resource for advice on programming language implementation, we should take this as a compliment to the Haskell community. Repaying that compliment with your language sucks rocks strikes me as unwise. I'm familiar

Re: [Haskell-cafe] Lambda and closures in PHP -- could someone please comment?

2008-06-18 Thread Luke Palmer
On Tue, Jun 17, 2008 at 4:45 PM, Karoly Negyesi [EMAIL PROTECTED] wrote: Hi, The PHP community is discussing the adding of closures and lambdas to the language, see the proposal at http://wiki.php.net/rfc/closures If someone with knowledge of both languages could take a quick look it would

[Haskell-cafe] Re: Something like scan1

2008-06-18 Thread Achim Schneider
Henning Thielemann [EMAIL PROTECTED] wrote: On Wed, 18 Jun 2008, Achim Schneider wrote: Is there a generalisation of scan1, such that eg. foo (+) [0,1] (1,2) = [0,1,1,2,3,5,8,13,...] ? What is the (1,2) for? Specifying the relative indexes an element depends on. Ideally, it

Re: [Haskell-cafe] Lambda and closures in PHP -- could someone please comment?

2008-06-18 Thread Miguel Mitrofanov
On 18 Jun 2008, at 18:19, Seth Gordon wrote: It seems to me that if a PHP developer sees the Haskell community as a resource for advice on programming language implementation, we should take this as a compliment to the Haskell community. Repaying that compliment with your language sucks

Re: [Haskell-cafe] Lambda and closures in PHP -- could someone please comment?

2008-06-18 Thread PR Stanley
It seems to me that if a PHP developer sees the Haskell community as a resource for advice on programming language implementation, we should take this as a compliment to the Haskell community. Repaying that compliment with your language sucks rocks strikes me as unwise. Not necessarily. It

Re: [Haskell-cafe] Re: Something like scan1

2008-06-18 Thread Henning Thielemann
On Wed, 18 Jun 2008, Achim Schneider wrote: Henning Thielemann [EMAIL PROTECTED] wrote: On Wed, 18 Jun 2008, Achim Schneider wrote: Is there a generalisation of scan1, such that eg. foo (+) [0,1] (1,2) = [0,1,1,2,3,5,8,13,...] ? What is the (1,2) for? Specifying the relative indexes

Re: [Haskell-cafe] Lambda and closures in PHP -- could someone please comment?

2008-06-18 Thread Jonathan Cast
On Wed, 2008-06-18 at 16:00 +0100, PR Stanley wrote: It seems to me that if a PHP developer sees the Haskell community as a resource for advice on programming language implementation, we should take this as a compliment to the Haskell community. Repaying that compliment with your language

Re: [Haskell-cafe] blas bindings, why are they so much slower the C?

2008-06-18 Thread Bryan O'Sullivan
On Tue, Jun 17, 2008 at 9:00 PM, Anatoly Yakovenko [EMAIL PROTECTED] wrote: here is the C: #include cblas.h #include stdlib.h int main() { int size = 1024; int ii = 0; double* v1 = malloc(sizeof(double) * (size)); double* v2 = malloc(sizeof(double) * (size)); for(ii = 0; ii

Re: [Haskell-cafe] Bit streams

2008-06-18 Thread Bryan O'Sullivan
On Tue, Jun 17, 2008 at 1:05 PM, Andrew Coppin [EMAIL PROTECTED] wrote: Before I sit down and spend 3 months designing my own library from scratch, does anybody know of an existing library that allows you to do what Binary does, but with single-bit precision? The binary-strict library

Re: [Haskell-cafe] Problem building GHC 6.8.3

2008-06-18 Thread Bryan O'Sullivan
On Wed, Jun 18, 2008 at 5:28 AM, Daniel Fischer [EMAIL PROTECTED] wrote: Sorry, probably stupid questions for knowledgeable folks Not stupid at all, but possibly the wrong mailing list. glasgow-haskell-users would usually be a better place to ask. Setup: Haddock's internal GHC version must

Re: [Haskell-cafe] Lambda and closures in PHP -- could someone please comment?

2008-06-18 Thread PR Stanley
It seems to me that if a PHP developer sees the Haskell community as a resource for advice on programming language implementation, we should take this as a compliment to the Haskell community. Repaying that compliment with your language sucks rocks strikes me as unwise. Not necessarily.

Re: [Haskell-cafe] Lambda and closures in PHP -- could someone please comment?

2008-06-18 Thread Iain Barnett
On 18 Jun 2008, at 9:46 am, Jules Bean wrote: This is exactly the sort of message that haskell-cafe does not normally contain. Let's not start now. Reactions/arguments like the ones on this thread are perfect for Haskell - recursive and exponential. :) Could we have closure too? :-)

Re: [Haskell-cafe] Re: Bit Streams

2008-06-18 Thread Don Stewart
dominic.steinitz: OK, so today I tried to write my first program using the Binary library. And I've hit a snag: It appears the library will only handle data that is byte-aligned. So if I try to write three Bool values, it uses three bytes, not three bits. Before I sit down and spend 3

Re: [Haskell-cafe] blas bindings, why are they so much slower the C?

2008-06-18 Thread Anatoly Yakovenko
#include cblas.h #include stdlib.h int main() { int size = 1024; int ii = 0; double* v1 = malloc(sizeof(double) * (size)); double* v2 = malloc(sizeof(double) * (size)); for(ii = 0; ii size*size; ++ii) { double _dd = cblas_ddot(0, v1, size, v2, size); } free(v1);

Re: [Haskell-cafe] Lambda and closures in PHP -- could someone please comment?

2008-06-18 Thread Evan Laforge
* A closure must only keep alive the varables it references, not the whole pad on which they are allocated (Python messed up here) Getting off subject, but I didn't know this about python. I'm not saying you're incorrect, but my experimentation shows: % cat t.py class A(object): def

Re: [Haskell-cafe] Lambda and closures in PHP -- could someone please comment?

2008-06-18 Thread Jim Burton
PR Stanley wrote: [...] Paul: I rest my case! :-) you cowardly hypocrit! Please take your own advice now, and rest your case. Like it or not (I think most people do like it), haskell-cafe has norms of behaviour that make it different to many pl mailing lists. Your sarky comments would

Re: [Haskell-cafe] Re: Bit Streams

2008-06-18 Thread Adam Langley
On Wed, Jun 18, 2008 at 12:46 AM, Dominic Steinitz [EMAIL PROTECTED] wrote: OK, so today I tried to write my first program using the Binary library. And I've hit a snag: It appears the library will only handle data that is byte-aligned. So if I try to write three Bool values, it uses three

Re: [Haskell-cafe] Lambda and closures in PHP -- could someone please comment?

2008-06-18 Thread Hans van Thiel
On Wed, 2008-06-18 at 09:46 +0100, Jules Bean wrote: PR Stanley wrote: With respect, do you not think it'd be wiser for the community [snip] *disgusted* This is exactly the sort of message that haskell-cafe does not normally contain. Let's not start now. This is a civilized

Re: [Haskell-cafe] blas bindings, why are they so much slower the C?

2008-06-18 Thread Adam Langley
On Wed, Jun 18, 2008 at 9:16 AM, Anatoly Yakovenko [EMAIL PROTECTED] wrote: C doesn't work like that :) Yes it can. You would have to check the disassembly to be sure, but C compilers can, and do, perform dead code elimination. AGL -- Adam Langley [EMAIL PROTECTED]

Re: [Haskell-cafe] Lambda and closures in PHP -- could someone please comment?

2008-06-18 Thread PR Stanley
PR Stanley wrote: [...] Paul: I rest my case! :-) you cowardly hypocrit! Paul: Why did you remove Jonathan Cast's message? Afraid somebody might understand why I responded the way I did? Please take your own advice now, and rest your case. Like it or not (I think most people do like

Re: [Haskell-cafe] Lambda and closures in PHP -- could someone please comment?

2008-06-18 Thread PR Stanley
PR Stanley wrote: With respect, do you not think it'd be wiser for the community [snip] *disgusted* This is exactly the sort of message that haskell-cafe does not normally contain. Let's not start now. This is a civilized mailing list. Either comment on the nice gentlemen's PHP

Re: [Haskell-cafe] blas bindings, why are they so much slower the C?

2008-06-18 Thread Jules Bean
Anatoly Yakovenko wrote: #include cblas.h #include stdlib.h int main() { int size = 1024; int ii = 0; double* v1 = malloc(sizeof(double) * (size)); double* v2 = malloc(sizeof(double) * (size)); for(ii = 0; ii size*size; ++ii) { double _dd = cblas_ddot(0, v1, size, v2, size); }

Re: [Haskell-cafe] blas bindings, why are they so much slower the C?

2008-06-18 Thread David Roundy
On Wed, Jun 18, 2008 at 09:16:24AM -0700, Anatoly Yakovenko wrote: #include cblas.h #include stdlib.h int main() { int size = 1024; int ii = 0; double* v1 = malloc(sizeof(double) * (size)); double* v2 = malloc(sizeof(double) * (size)); for(ii = 0; ii size*size; ++ii) {

Re: [Haskell-cafe] blas bindings, why are they so much slower the C?

2008-06-18 Thread David Roundy
On Wed, Jun 18, 2008 at 06:03:42PM +0100, Jules Bean wrote: Anatoly Yakovenko wrote: #include cblas.h #include stdlib.h int main() { int size = 1024; int ii = 0; double* v1 = malloc(sizeof(double) * (size)); double* v2 = malloc(sizeof(double) * (size)); for(ii = 0; ii

Re: [Haskell-cafe] Lambda and closures in PHP -- could someone please comment?

2008-06-18 Thread Jim Burton
PR Stanley wrote: PR Stanley wrote: [...] Paul: I rest my case! :-) you cowardly hypocrit! Paul: Why did you remove Jonathan Cast's message? Afraid somebody might understand why I responded the way I did? Please take your own advice now, and rest your case. Like it or not

Re: [Haskell-cafe] Lambda and closures in PHP -- could someone please comment?

2008-06-18 Thread PR Stanley
At 18:17 18/06/2008, you wrote: PR Stanley wrote: PR Stanley wrote: [...] Paul: I rest my case! :-) you cowardly hypocrit! Paul: Why did you remove Jonathan Cast's message? Afraid somebody might understand why I responded the way I did? Please take your own advice

Re: [Haskell-cafe] Re: Bit Streams

2008-06-18 Thread Andrew Coppin
Dominic Steinitz wrote: http://hackage.haskell.org/cgi-bin/hackage-scripts/package/binary-strict Ooo... looks interesting. Pity I can't look at any documentation for it. (Is that *really* Haddoc failing with a parse error on a pragma? Surely not...) I'll take a look at this. Thanks.

Re: [Haskell-cafe] Re: Bit Streams

2008-06-18 Thread Don Stewart
agl: On Wed, Jun 18, 2008 at 12:46 AM, Dominic Steinitz [EMAIL PROTECTED] wrote: OK, so today I tried to write my first program using the Binary library. And I've hit a snag: It appears the library will only handle data that is byte-aligned. So if I try to write three Bool values, it uses

Re: [Haskell-cafe] Lambda and closures in PHP -- could someone please comment?

2008-06-18 Thread Alex Sandro Queiroz e Silva
Hallo, PR Stanley wrote: Now, if you, Jules, Alex or some other wannabe Hitler have a problem with my freedom of expression then your best solution is to saddle up and get the hell out yourselves. This is the wrong place for setting up your tinpot dictatorship, Doctor! I am grateful for the

Re: [Haskell-cafe] Re: Bit Streams

2008-06-18 Thread Adam Langley
On Wed, Jun 18, 2008 at 10:52 AM, Don Stewart [EMAIL PROTECTED] wrote: Would you recommend binary-strict over bitsyntax now? Or are none yet entirely satisfactory Probably, yes. Bitsyntax was, after all, the first Haskell code I ever wrote :) It works, but I think the monad style of

Re: [Haskell-cafe] Re: Bit Streams

2008-06-18 Thread Evan Laforge
On Wed, Jun 18, 2008 at 10:43 AM, Andrew Coppin [EMAIL PROTECTED] wrote: Dominic Steinitz wrote: http://hackage.haskell.org/cgi-bin/hackage-scripts/package/binary-strict Ooo... looks interesting. Pity I can't look at any documentation for it. (Is that *really* Haddoc failing with a parse

Re: [Haskell-cafe] Re: Bit Streams

2008-06-18 Thread Bryan O'Sullivan
On Wed, Jun 18, 2008 at 11:00 AM, Adam Langley [EMAIL PROTECTED] wrote: On Wed, Jun 18, 2008 at 10:52 AM, Don Stewart [EMAIL PROTECTED] wrote: Would you recommend binary-strict over bitsyntax now? Or are none yet entirely satisfactory Probably, yes. Bitsyntax was, after all, the first Haskell

[Haskell-cafe] Fast sorting with Bytestring

2008-06-18 Thread Georg Sauthoff
Hi, I played a bit around with the nice bytestring package. At some point I implemented a simple sorting program, because I needed line-sorting a file with a custom line-compare function. I was a bit surprised, that the resulting code is very fast. A lot of faster than sorting via GNU sort (with

Re: [Haskell-cafe] Fast sorting with Bytestring

2008-06-18 Thread Stefan O'Rear
On Wed, Jun 18, 2008 at 08:19:10PM +0200, Georg Sauthoff wrote: Hi, I played a bit around with the nice bytestring package. At some point I implemented a simple sorting program, because I needed line-sorting a file with a custom line-compare function. I was a bit surprised, that the

Re: [Haskell-cafe] Fast sorting with Bytestring

2008-06-18 Thread Georg Sauthoff
On Wed, Jun 18, 2008 at 11:23:00AM -0700, Stefan O'Rear wrote: GNU 'sort' uses an external sort algorithm. You can, with 200M of memory, give it a 50G input file, and it will work. This might explain the difference.. But the input files are both 10 mb ... If I create a 'big_bible' file

Re: [Haskell-cafe] Fast sorting with Bytestring

2008-06-18 Thread Ketil Malde
Stefan O'Rear [EMAIL PROTECTED] writes: Ok, strane ... Well, let's test with some 'normal' text: time ./sort bible /dev/null # ~ 0.4 s time sort bible /dev/null # ~ 0.56 s Ok, not that different. But with Haskell you often expect to get very slow code compared to an

[Haskell-cafe] type constructor confusion

2008-06-18 Thread Stephen Howard
hello list, loading the code below into ghci gives me this error: HttpMessage.hs:36:20: Not in scope: type constructor or class `HttpRequest' The troublesome line is the definition of the cookie function at the end of the code. I've made HttpRequest and HttpResponse constructors of

Re: [Haskell-cafe] type constructor confusion

2008-06-18 Thread Brandon S. Allbery KF8NH
On Jun 18, 2008, at 15:31 , Stephen Howard wrote: HttpMessage.hs:36:20: Not in scope: type constructor or class `HttpRequest' The troublesome line is the definition of the cookie function at the end of the code. I've made Right. HttpRequest is a data constructor associated with the

Re: [Haskell-cafe] Re: working with Random.randoms

2008-06-18 Thread Stephen Howard
Thanks for the replies. This was my solution: module RandomTest ( random_test ) where import Random random_test :: Int - IO String random_test n = do g - newStdGen return $ take n (randomRs printable_ascii g) where printable_ascii = ('!','~') The struggling with the type system was

Re: [Haskell-cafe] Fast sorting with Bytestring

2008-06-18 Thread Georg Sauthoff
On Wed, Jun 18, 2008 at 08:56:43PM +0200, Ketil Malde wrote: Stefan O'Rear [EMAIL PROTECTED] writes: GNU 'sort' uses an external sort algorithm. You can, with 200M of memory, give it a 50G input file, and it will work. This might explain the difference.. GNU sort also handles

[Haskell-cafe] Meaning of ribbonsPerLine at Text.PrettyPrint.HughesPJ ?

2008-06-18 Thread Alfonso Acosta
Hi, Can anyone give a good explanation of what ribbonsPerLine means? Maybe it would be better to simply ask for the meaning of ribbon in this context. The documentation is totally meaningless to me: reibbonsPerLine: Ratio of ribbon length to line length. I asked at #haskell and frankly, I was

[Haskell-cafe] Haskell Weekly News: Issue 73 - June 18, 2008

2008-06-18 Thread Brent Yorgey
--- Haskell Weekly News http://sequence.complete.org/hwn/20080618 Issue 73 - June 18, 2008 --- Welcome to issue 73 of HWN, a newsletter covering

[Haskell-cafe] Using cabal-install

2008-06-18 Thread Daniel Fischer
Is there a tutorial/user's guide for cabal-install somewhere? My limited google skills haven't found one and I really need it, because there MUST be a better way to get a package and its dependencies built and the haddock documentation generated, installed and hyperlinked than manually

Re: [Haskell-cafe] Meaning of ribbonsPerLine at Text.PrettyPrint.HughesPJ ?

2008-06-18 Thread Evan Laforge
byorgey: fons: I can't explain it, all I know is that you must set it to 1 or else it does bizarre things fons: hahah, ok fons: byorgey: that's funny considering its default value is 1.5 byorgey: if you set it to 1 then lineLength means what you think it should byorgey: fons: EXACTLY

Re: [Haskell-cafe] Using cabal-install

2008-06-18 Thread Don Stewart
http://blog.well-typed.com/2008/06/new-cabal-and-cabal-install-releases/ Basically, build and install cabal-install, then let have it. daniel.is.fischer: Is there a tutorial/user's guide for cabal-install somewhere? My limited google skills haven't found one and I really need it, because

Re: [Haskell-cafe] Problem building GHC 6.8.3

2008-06-18 Thread David Waern
2008/6/18 Bryan O'Sullivan [EMAIL PROTECTED]: On Wed, Jun 18, 2008 at 5:28 AM, Daniel Fischer [EMAIL PROTECTED] wrote: Sorry, probably stupid questions for knowledgeable folks Not stupid at all, but possibly the wrong mailing list. glasgow-haskell-users would usually be a better place to

Re: [Haskell-cafe] Using cabal-install

2008-06-18 Thread Daniel Fischer
Am Mittwoch, 18. Juni 2008 22:57 schrieb Don Stewart: http://blog.well-typed.com/2008/06/new-cabal-and-cabal-install-releases/ Basically, build and install cabal-install, then let have it. I have cabal-install installed, and I'm thankful for it. My problem is, when I do cabal install foo it

Re: [Haskell-cafe] Bit streams

2008-06-18 Thread Jeremy Shaw
Malcolm Wallace wrote: The original Binary library, circa 1998, was based on bit-streams rather than bytes. You might be able to dig up a copy and bring it back to life. This derivative (by Hal Daume III) works with GHC 6.8.2 (I haven't tried 6.8.3):

Re: [Haskell-cafe] Using cabal-install

2008-06-18 Thread Duncan Coutts
On Wed, 2008-06-18 at 22:44 +0200, Daniel Fischer wrote: Is there a tutorial/user's guide for cabal-install somewhere? My limited google skills haven't found one and I really need it, because there MUST be a better way to get a package and its dependencies built and the haddock

Re: [Haskell-cafe] Meaning of ribbonsPerLine at Text.PrettyPrint.HughesPJ ?

2008-06-18 Thread Duncan Coutts
On Wed, 2008-06-18 at 13:55 -0700, Evan Laforge wrote: byorgey: fons: I can't explain it, all I know is that you must set it to 1 or else it does bizarre things fons: hahah, ok fons: byorgey: that's funny considering its default value is 1.5 byorgey: if you set it to 1 then lineLength

[Haskell-cafe] First Call for Papers: DSL WC

2008-06-18 Thread Emir Pasalic
IFIP Working Conference on Domain Specific Languages (DSL WC) July 15-17, 2009, Oxford CALL FOR PAPERS Domain-specific languages are emerging as a fundamental component of software engineering practice. DSLs are often introduced when new domains such as web-scripting or markup come into

Re: [Haskell-cafe] Re: Bit Streams

2008-06-18 Thread Dominic Steinitz
Don Stewart wrote: dominic.steinitz: OK, so today I tried to write my first program using the Binary library. And I've hit a snag: It appears the library will only handle data that is byte-aligned. So if I try to write three Bool values, it uses three bytes, not three bits. Before I sit

Re: [Haskell-cafe] Lambda and closures in PHP -- could someone please comment?

2008-06-18 Thread Richard A. O'Keefe
On 18 Jun 2008, at 4:36 pm, Karoly Negyesi wrote: (a) I would *never* want to use an implementation of closures like that. Could you elaborate on a) ? It wasn't me who wrote it, but consider - non-local variables are *not* captured unless you explicitly hoist them into the lambda

Re: [Haskell-cafe] blas bindings, why are they so much slower the C?

2008-06-18 Thread Richard A. O'Keefe
On 19 Jun 2008, at 4:16 am, Anatoly Yakovenko wrote: C doesn't work like that :). functions always get called. Not true. A C compiler must produce the same *effect* as if the function had been called, but if by some means the compiler knows that the function has no effect, it is entitled to

Re: [Haskell-cafe] type constructor confusion

2008-06-18 Thread Stephen Howard
Thanks Brandon, forgot to send my reply to the list: Ok, so I am confusing things. Good to know. So my question is how do I fulfill this scenario? - I have an action that might return either an HttpResponse or an HttpRequest, depending on if the IO in the action determined more work

Re: [Haskell-cafe] Haskell's type system

2008-06-18 Thread Ryan Ingram
On 6/18/08, Edsko de Vries [EMAIL PROTECTED] wrote: Regarding type classes, I'm not 100% what the logical equivalent is, although one can regard a type such as forall a. Eq a = a - a as requiring a proof (evidence) that equality on a is decidable. Where this sits formally as a logic I'm

Re: [Haskell-cafe] type constructor confusion

2008-06-18 Thread Ryan Ingram
It sounds like you need to split up your types a bit more. data HttpRequest = HttpRequest ... data HttpResponse = HttpResponse ... data HttpMessage = MsgRequest HttpRequest | MsgResponse HttpResponse -- alternatively -- type HttpMessage = Either HttpRequest HttpResponse Now you can have

[Haskell-cafe] Gtk2Hs and GCs

2008-06-18 Thread Tim Newsham
I don't see a way to fetch an existing standard GC from a widget. In other Gtk bindings I usually do this by fetching the widget's style and then grabbing one of the gc's (such as fg_gc[STATE_NORMAL]). In Gtk2Hs docs:

[Haskell-cafe] message passing style like in Haskell?

2008-06-18 Thread jinjing
Hi guys, This is my second attempt to learn Haskell :) Any way here's the code: module Dot where import Prelude hiding ( (.) ) (.) :: a - (a - b) - b a . f = f a infixl 9 . So for example, 99 questions: Problem 10 (*) Run-length encoding of a list. comparing: encode xs = map (\x -