Re: [Haskell-cafe] [EMAIL PROTECTED]: darcs patch: fix typo in docs.]

2007-10-12 Thread Isaac Dupree
David Roundy wrote: It seems a little unfriendly to reject contributions from anyone who isn't subscribed to the libraries mailing list... Quite so. `darcs send` should send to an e-mail address where darcs patch:es will be accepted (read at least, or responded to, or applied, as the case

Re: [Haskell-cafe] WinAmp plugin?

2007-10-12 Thread Conal Elliott
sounds like great fun to me. i'll contribute some functional graphics expertise. dons others have learned how to get good performance out of elegant code. does anyone have WinAmp plugin know-how? - Conal On 10/12/07, Andrew Coppin [EMAIL PROTECTED] wrote: Does anybody here know WinAmp? [I

Re: [Haskell-cafe] Filesystem questions

2007-10-12 Thread Brandon S. Allbery KF8NH
All these questions are actually Windows-centric; the answers are different on Unix. On Oct 12, 2007, at 13:21 , Andrew Coppin wrote: I notice that getDirectoryContents appears to return its results in alphabetical order. Is this behaviour actually guaranteed? There is no guarantee,

Re: [Haskell-cafe] WinAmp plugin?

2007-10-12 Thread Andrew Coppin
pierre wrote: Wouldn't it be better to write not just a visualization plugin, but a whole player from scratсh? :-) ...this idea also occurred to me. ;-) Why, do *you* know how to decode MP3 data? ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] Re: Type-level arithmetic

2007-10-12 Thread Steve Schafer
On Fri, 12 Oct 2007 18:24:38 +0100, you wrote: I was actually thinking more along the lines of a programming language where you can just write head :: (n 1) = List n x - x tail :: List n x - List (n-1) x (++) :: List n x - List m x - List (n+m) x and so forth. How, then, is that any

Re: [Haskell-cafe] Re: Type-level arithmetic

2007-10-12 Thread Tim Chevalier
On 10/12/07, Andrew Coppin [EMAIL PROTECTED] wrote: I was actually thinking more along the lines of a programming language where you can just write head :: (n 1) = List n x - x tail :: List n x - List (n-1) x (++) :: List n x - List m x - List (n+m) x and so forth. You know,

Re: [Haskell-cafe] Filesystem questions

2007-10-12 Thread Steve Schafer
On Fri, 12 Oct 2007 18:21:07 +0100, you wrote: I notice that getDirectoryContents appears to return its results in alphabetical order. Is this behaviour actually guaranteed? This is a Windows thing. All of the NT-based operating systems list files in alphabetical order by default. You see the

[Haskell-cafe] WinAmp plugin?

2007-10-12 Thread Andrew Coppin
Does anybody here know WinAmp? [I feel sure the answer must be yes!] How hard would it be to write a visualisation plugin in Haskell? I think this would be a neat way of demonstrating that Haskell isn't slow. Also, WinAmp plugins (and, actually, WinAmp) are notoriously buggy and unstable.

[Haskell-cafe] Filesystem questions

2007-10-12 Thread Andrew Coppin
I notice that getDirectoryContents appears to return its results in alphabetical order. Is this behaviour actually guaranteed? Related: Is there a way to get rid of . and .. in the results? (Obviously this causes directory recusion to malfunction.) I can of course manually filter them out,

[Haskell-cafe] more functions to evaluate

2007-10-12 Thread PR Stanley
Hi folks Any comments and/or criticisms no matter how trivial on the following please: wordSize :: [Int] - Int wordSize xs = head (dropWhile ((length xs)) $ iterate (*2) 8) intToBinWord :: Int - [Int] intToBinWord n = reverse (take elements (xs ++ repeat 0))

Re: [Haskell-cafe] WinAmp plugin?

2007-10-12 Thread Brandon S. Allbery KF8NH
On Oct 12, 2007, at 14:26 , Andrew Coppin wrote: pierre wrote: Wouldn't it be better to write not just a visualization plugin, but a whole player from scratсh? :-) ...this idea also occurred to me. ;-) Why, do *you* know how to decode MP3 data? Don't Do That. Use someone else's

[Haskell-cafe] Re: Type-level arithmetic

2007-10-12 Thread Andrew Coppin
I was actually thinking more along the lines of a programming language where you can just write head :: (n 1) = List n x - x tail :: List n x - List (n-1) x (++) :: List n x - List m x - List (n+m) x and so forth. You know, instead of the elaborate simulations crafted out of systems

Re: [Haskell-cafe] Re: Type-level arithmetic

2007-10-12 Thread Tim Chevalier
On 10/12/07, Steve Schafer [EMAIL PROTECTED] wrote: On Fri, 12 Oct 2007 18:24:38 +0100, you wrote: I was actually thinking more along the lines of a programming language where you can just write head :: (n 1) = List n x - x tail :: List n x - List (n-1) x (++) :: List n x -

Re: [Haskell-cafe] WinAmp plugin?

2007-10-12 Thread Felipe Almeida Lessa
On 10/12/07, Brandon S. Allbery KF8NH [EMAIL PROTECTED] wrote: Don't Do That. Use someone else's plugin-based library if you can help it. Do you really want to write your own Haskell implementations of mp3, aac, aac+, etc.? Something based on GStreamer should be somewhat easier to get done

Re: [Haskell-cafe] Re: Type-level arithmetic

2007-10-12 Thread Tim Chevalier
On 10/12/07, Steve Schafer [EMAIL PROTECTED] wrote: On Fri, 12 Oct 2007 13:03:16 -0700, you wrote: It's different because the property that (for example) head requires a nonempty list is checked at compile time instead of run time. No, I understand that. Andrew was talking about using type

Re: [Haskell-cafe] Re: Type-level arithmetic

2007-10-12 Thread Steve Schafer
On Fri, 12 Oct 2007 13:03:16 -0700, you wrote: It's different because the property that (for example) head requires a nonempty list is checked at compile time instead of run time. No, I understand that. Andrew was talking about using type programming to do the things that a sane person would use

Re: [Haskell-cafe] Re: Type-level arithmetic

2007-10-12 Thread Steve Schafer
On Fri, 12 Oct 2007 13:25:28 -0700, you wrote: I'm not sure what sanity has to do with it. Presumably we all agree that it's a good idea for the compiler to know, at compile-time, that head is only applied to lists. Why not also have the compiler check that head is only applied to non-empty

Re: [Haskell-cafe] more functions to evaluate

2007-10-12 Thread Thomas Hartman
how about this, for wordSize? I used quickcheck to verify that my wordSize2 is the same as yours. Actually, it's not! if you allow negative integers in the list, it's not at any rate. (falsifiable after 50 tries) I haven't thought through what this means... if your function isn't quite right,

Re: [Haskell-cafe] Re: Type-level arithmetic

2007-10-12 Thread Philippa Cowderoy
On Fri, 12 Oct 2007, Steve Schafer wrote: On Fri, 12 Oct 2007 13:25:28 -0700, you wrote: I'm not sure what sanity has to do with it. Presumably we all agree that it's a good idea for the compiler to know, at compile-time, that head is only applied to lists. Why not also have the compiler

Re: [Haskell-cafe] Re: Type-level arithmetic

2007-10-12 Thread Dan Piponi
Steve said: How, then, is that any different from a general-purpose programming language? You're just drawing the line in the sand in a different place. In a way it is like drawing a line in sand. But that's a useful thing to do for a bunch of reasons. (1) When developing code, you'd like to

Re: [Haskell-cafe] Re: Type-level arithmetic

2007-10-12 Thread Steve Schafer
On Fri, 12 Oct 2007 21:51:46 +0100 (GMT Daylight Time), you wrote: Which is nevertheless the kind of power you need in order to also be able to prove precise properties. We're not talking about POWER, we're talking about SYNTAX. That the Instant Insanity problem _was_ solved using Haskell's

Re: [Haskell-cafe] Fusing foldr's

2007-10-12 Thread Dan Weston
Always check optimizations to make sure they are not pessimizations! Actually, traversing the list twice is very cheap compared to space leakage, and accumulating pairs requires tuple boxing and unboxing which I don't know how to get GHC not to do. Your avg3 (along with several attempts of

Re: [Haskell-cafe] WinAmp plugin?

2007-10-12 Thread Andrew Coppin
Brandon S. Allbery KF8NH wrote: On Oct 12, 2007, at 14:26 , Andrew Coppin wrote: Why, do *you* know how to decode MP3 data? Don't Do That. Use someone else's plugin-based library if you can help it. Do you really want to write your own Haskell implementations of mp3, aac, aac+, etc.?

[Haskell-cafe] Dual Parser Failure???

2007-10-12 Thread PR Stanley
Hi failure :: (Parser a) failure = \inp - [] The code might contain some syntax errors and I'd be grateful for any corrections. What is a dual parser failure? Thanks, Paul ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

[Haskell-cafe] Re: latest hdbc-odbc

2007-10-12 Thread John Goerzen
On 2007-10-11, jeff p [EMAIL PROTECTED] wrote: Hello, When building the latest hdbc-odbc (1.1.2.0) on a linux box with ghc6.6.1, I get the following warnings: [7 of 7] Compiling Database.HDBC.ODBC ( Database/HDBC/ODBC.hs, dist/build/Database/HDBC/ODBC.o ) hdbc-odbc-helper.c: In

[Haskell-cafe] How to thoroughly clean up Haskell stuff on linux

2007-10-12 Thread Lihn, Steve
Hi, I have been hacking the Haskell installation a few days on Redhat Linux. GHC 6.6 - 6.6.1 - Lambdabot does not work. Downgrade to GHC 6.4 - Still not working, tried cabal-install to simplify my life, but no luck. Then install Cabal, Haddock - Haddock cannot install bc Lambdabot is not

RE: [Haskell-cafe] How to thoroughly clean up Haskell stuff on linux

2007-10-12 Thread Lihn, Steve
are you certain haddock depends on lambdabot? that seems very strange to me. Thomas, I also thought haddock should be an easy build, but it just won't do it. /home2/user/garden/haddock-0.8 runhaskell ./Setup.lhs install Installing: --prefix=~/cabal/lib/haddock-0.8/ghc-6.4

Re: [Haskell-cafe] Defining Tree

2007-10-12 Thread Dan Weston
There are many tree types. Take a look at: http://www.haskell.org/ghc/docs/6.4.1/html/libraries/base/Data-Tree.html PR Stanley wrote: Hi I'm reading the chapter on parsers in the Hutton book. The text refers to the data type tree which doesn't seem to be in prelude. So, I was wondering, what

Re: [Haskell-cafe] more functions to evaluate

2007-10-12 Thread Dan Weston
Here is my suggestion: separation of concerns. Your functions are doing multiple things at once (and there are inefficiencies in your code that are not easy to see because it does do several things at once). You want the smallest word that an int will fit in. Sounds like you'll need a

Re: [Haskell-cafe] Dual Parser Failure???

2007-10-12 Thread Albert Y. C. Lai
PR Stanley wrote: failure :: (Parser a) failure = \inp - [] The code might contain some syntax errors and I'd be grateful for any corrections. It looks right conceptually. Depending on the definition of Parser, you may need failure = P (\inp - []) or whatever constructor name instead of

Re: [Haskell-cafe] How to thoroughly clean up Haskell stuff on linux

2007-10-12 Thread Thomas Hartman
not trying to start a flame war here, but I had pretty good success with apt-get and ubuntu. however, I admit I never really got lambdabot to work. if you install from source you can have 6.6, 6.6.1 and 6.4 all installed at the same time. you just need to create simlinks for the old versions.

[Haskell-cafe] Defining Tree

2007-10-12 Thread PR Stanley
Hi I'm reading the chapter on parsers in the Hutton book. The text refers to the data type tree which doesn't seem to be in prelude. So, I was wondering, what would be asuitable tree for a parser? A binary tree perhaps? Are there different types of tree for different parsers? Thanks, Paul

Re: [Haskell-cafe] question about throwDyn

2007-10-12 Thread Ryan Ingram
throwDyn e = throw (DynException (toDyn e)) You're wrapping the exception in a DynException wrapper, which shows up as (unknown). -- ryan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Re: Type-level arithmetic

2007-10-12 Thread Philippa Cowderoy
On Fri, 12 Oct 2007, Steve Schafer wrote: On Fri, 12 Oct 2007 21:51:46 +0100 (GMT Daylight Time), you wrote: Which is nevertheless the kind of power you need in order to also be able to prove precise properties. We're not talking about POWER, we're talking about SYNTAX. Which has no

[Haskell-cafe] Performance problem with random numbers

2007-10-12 Thread ntupel
Dear all, I have implemented a small module to generate random items with a given probability distribution using the alias approach [1] and unfortunately compared to similar implementations in C++ or Java it is about 10 times slower. I have to confess that I am still in the early stages of

Re: [Haskell-cafe] more functions to evaluate

2007-10-12 Thread Isaac Dupree
Dan Weston wrote: applyNtimes :: (a - a) - Int - a - a This sounds like it should be in the library somewhere agree, I've used it a few times (mostly for testing things) - modulo argument order and Int vs. Integer vs. (Num a = a) Isaac ___

RE: [Haskell-cafe] How to thoroughly clean up Haskell stuff on linux

2007-10-12 Thread Thomas Hartman
wayll... it (haddock at least) really is easy on deb/ubu with apt. I've found a lot of stuff is harder to install on Suse back when I was using that, and I think Suse/Redhat suffer from the same problems. not that the packager should matter, since it seems you're installing from source... are

Re: [Haskell-cafe] New slogan for haskell.org

2007-10-12 Thread Albert Y. C. Lai
Tim Newsham wrote: You are not expected to understand this. http://swtch.com/unix/ Hehehe! Elite system programmers understand it. If it is rephrased in terms of continuations, elite lambda calculus programmers will also understand it. You are not expected to be convinced this, but it

Re: [Haskell-cafe] more functions to evaluate

2007-10-12 Thread Maxime Henrion
Isaac Dupree wrote: Dan Weston wrote: applyNtimes :: (a - a) - Int - a - a This sounds like it should be in the library somewhere agree, I've used it a few times (mostly for testing things) - modulo argument order and Int vs. Integer vs. (Num a = a) What do you think about calling it

Re: [Haskell-cafe] more functions to evaluate

2007-10-12 Thread Dan Weston
I like that name, and will henceforth use it myself until someone sees fit to add it to the Prelude! Maxime Henrion wrote: Isaac Dupree wrote: Dan Weston wrote: applyNtimes :: (a - a) - Int - a - a This sounds like it should be in the library somewhere agree, I've used it a few times

Re: [Haskell-cafe] Re: Type-level arithmetic

2007-10-12 Thread Brandon S. Allbery KF8NH
On Oct 12, 2007, at 16:25 , Tim Chevalier wrote: On 10/12/07, Steve Schafer [EMAIL PROTECTED] wrote: On Fri, 12 Oct 2007 13:03:16 -0700, you wrote: It's different because the property that (for example) head requires a nonempty list is checked at compile time instead of run time. No, I

Re: [Haskell-cafe] Re: Type-level arithmetic

2007-10-12 Thread Tim Chevalier
On 10/12/07, Brandon S. Allbery KF8NH [EMAIL PROTECTED] wrote: You two are talking past each other. You're talking about dependent typing, etc. Steve's complaint is not about dependent typing; he's saying Andrew is looking for something different from that, namely the type system being a

Re: [Haskell-cafe] New slogan for haskell.org

2007-10-12 Thread Brandon S. Allbery KF8NH
On Oct 12, 2007, at 18:35 , Albert Y. C. Lai wrote: You are not expected to be convinced this, but it seems continuations completely characterize system programming. :) Didn't someone already prove all monads can be implemented in terms of Cont? (here you see why schemers are so wedded

Re: [Haskell-cafe] Re: Type-level arithmetic

2007-10-12 Thread Brandon S. Allbery KF8NH
On Oct 12, 2007, at 19:26 , Tim Chevalier wrote: On 10/12/07, Brandon S. Allbery KF8NH [EMAIL PROTECTED] wrote: You two are talking past each other. You're talking about dependent typing, etc. Steve's complaint is not about dependent typing; he's saying Andrew is looking for something

Re: [Haskell-cafe] Re: Type-level arithmetic

2007-10-12 Thread Dan Piponi
On 10/12/07, Brandon S. Allbery KF8NH [EMAIL PROTECTED] wrote: He wants to write entire programs in the type system, something like the crazies who write programs in C++ templates such that template expansion does all the work at compile time Crazies? :-)

Re: [Haskell-cafe] How to thoroughly clean up Haskell stuff on linux

2007-10-12 Thread Brandon S. Allbery KF8NH
On Oct 12, 2007, at 17:38 , Lihn, Steve wrote: Installing: --prefix=~/cabal/lib/haddock-0.8/ghc-6.4 This looks suspicious to me: the ~ metacharacter is only understood by shells, and only in certain circumstances (i.e. only at the beginning of a word, not after a =), and by the time

Re: [Haskell-cafe] Re: Type-level arithmetic

2007-10-12 Thread Brandon S. Allbery KF8NH
On Oct 12, 2007, at 19:42 , Dan Piponi wrote: On 10/12/07, Brandon S. Allbery KF8NH [EMAIL PROTECTED] wrote: He wants to write entire programs in the type system, something like the crazies who write programs in C++ templates such that template expansion does all the work at compile time

Re: [Haskell-cafe] New slogan for haskell.org

2007-10-12 Thread Don Stewart
allbery: On Oct 12, 2007, at 18:35 , Albert Y. C. Lai wrote: You are not expected to be convinced this, but it seems continuations completely characterize system programming. :) Didn't someone already prove all monads can be implemented in terms of Cont? Cont and StateT, wasn't

Re: [Haskell-cafe] more functions to evaluate

2007-10-12 Thread Maxime Henrion
Dan Weston wrote: I like that name, and will henceforth use it myself until someone sees fit to add it to the Prelude! Oh, and I guess we'd also need: genericIterateN :: (a - a) - Integer - a - a Which also got me thinking, wouldn't it make more sense to have the count as the first

Re: [Haskell-cafe] more functions to evaluate

2007-10-12 Thread Maxime Henrion
Maxime Henrion wrote: Dan Weston wrote: I like that name, and will henceforth use it myself until someone sees fit to add it to the Prelude! Oh, and I guess we'd also need: genericIterateN :: (a - a) - Integer - a - a Which also got me thinking, wouldn't it make more sense to have

Re: [Haskell-cafe] How to thoroughly clean up Haskell stuff on linux

2007-10-12 Thread Stefan O'Rear
On Fri, Oct 12, 2007 at 07:31:45PM -0400, Brandon S. Allbery KF8NH wrote: I don't think haddock has to depend on lamdbabot. But I saw Skipping HaddockHoogle during the build. Isn't the Hoogle thing related to Lambdabot? Or they are unrelated. Only insofar has Lambdabot has an interface to

Re: [Haskell-cafe] Performance problem with random numbers

2007-10-12 Thread Stefan O'Rear
On Sat, Oct 13, 2007 at 12:09:57AM +0200, ntupel wrote: Dear all, I have implemented a small module to generate random items with a given probability distribution using the alias approach [1] and unfortunately compared to similar implementations in C++ or Java it is about 10 times slower. I

Re: [Haskell-cafe] Performance problem with random numbers

2007-10-12 Thread Don Stewart
stefanor: On Sat, Oct 13, 2007 at 12:09:57AM +0200, ntupel wrote: Dear all, I have implemented a small module to generate random items with a given probability distribution using the alias approach [1] and unfortunately compared to similar implementations in C++ or Java it is about 10

Re: [Haskell-cafe] Performance problem with random numbers

2007-10-12 Thread Don Stewart
dons: stefanor: On Sat, Oct 13, 2007 at 12:09:57AM +0200, ntupel wrote: Dear all, I have implemented a small module to generate random items with a given probability distribution using the alias approach [1] and unfortunately compared to similar implementations in C++ or Java it