[Haskell-cafe] ANNOUNCE: xmonad 0.3

2007-09-04 Thread Donald Bruce Stewart
The xmonad dev team is pleased to announce the 0.3 release of xmonad. xmonad: a tiling window manager http://xmonad.org About: xmonad is a tiling window manager for X. Windows are arranged automatically to tile the screen without gaps or overlap,

Re: [Haskell-cafe] Hawiki articles

2007-09-03 Thread Donald Bruce Stewart
lemming: On Mon, 3 Sep 2007, Derek Elkins wrote: On Mon, 2007-09-03 at 14:57 +0200, Henning Thielemann wrote: In the current Haskell Wiki (haskell.org/haskellwiki) I found references to articles of the old Hawiki (haskell.org/hawiki), like OnceAndOnlyOnce and SeparationOfConcerns.

Re: [Haskell-cafe] Serial Communications in Haskell

2007-09-03 Thread Donald Bruce Stewart
mmitar: Hi! Of course, I don't know how to call Windows API functions from Haskell, and I have no idea how to hook things to the IO library so that I can use a Handle for a serial port. I'm looking for some advice on how to proceed. You can check how I did this in my Lego Mindstorms

Re: [Haskell-cafe] Norvig's Sudoku Solver in Haskell

2007-08-28 Thread Donald Bruce Stewart
chaddai.fouche: For the translation of the above OCaml code, there is not much to do, in fact it is mostly functional, and so easily translated in Haskell code, note that I add a code to handle input of the form 4.8.5.3..7..2.6.8.4..1...6.3.7.5..2.1.4..,

Re: [Haskell-cafe] How can I pass IOUArrays to FFI functions?

2007-08-21 Thread Donald Bruce Stewart
ryani.spam: Your code is broken in a most evil and insidious way. Interesting. This is for a toy project, so I'm not too worried, but lets say I wanted to do this correctly and I was set on using IOUArray for some reason. (The Haskell wiki claims that StorableArray is

Re: [Haskell-cafe] GHC optimisations

2007-08-21 Thread Donald Bruce Stewart
phil: On Mon, Aug 20, 2007 at 09:57:38PM +0100, Simon Peyton-Jones wrote: GHC does some constant folding, but little by way of strength reduction, or using shifts instead of multiplication. It's pretty easy to add more: it's all done in a single module. Look at primOpRules in the module

Re: [Haskell-cafe] Parsing binary data.

2007-08-21 Thread Donald Bruce Stewart
dot: On Sun, 19 Aug 2007, Peter Cai wrote: My duty is writing a network server which talks to another server through a binary based private protocol. Haskell needs something like Erlang's bit syntax. http://erlang.org/doc/reference_manual/expressions.html#6.16

[Haskell-cafe] #haskell irc channel reaches 400 users

2007-08-20 Thread Donald Bruce Stewart
A small announcement :) 5 1/2 years after its inception, under the guiding hand of Shae Erisson (aka shapr), the #haskell IRC channel[1] on freenode has finally reached 400 users! To chart the growth, we can note that the channel was founded in late 2001, and had slow growth till 2006,

Re: [Haskell-cafe] Explaining monads

2007-08-11 Thread Donald Bruce Stewart
ronguida: Monads are undoubtedly more pervasive, and that could be because there aren't as many arrow and comonad tutorials, atomic ones or otherwise. Moreover, Comonad isn't even in the standard libraries (Hoogle returns no results for it). When I searched for tutorials on monads, I

Re: [Haskell-cafe] Haskell vs GC'd imperative languages, threading, parallelizeability (is that a word? :-D )

2007-08-10 Thread Donald Bruce Stewart
hughperkins: Now, I did have kindof a shootout thread with Don and Sebastien, calculating prime numbers, where Don managed to get to within an order of magnitude of C# performance (I think he got to about 70-80% of C# performance, cool!) - Despite my better judgement, I'll just

Re: [Haskell-cafe] Small question

2007-08-10 Thread Donald Bruce Stewart
hughperkins: You'll find by the way that the imperative GC'd, stack/heap protected languages run *significantly* faster for many (not all I guess?) algorithms and applications. Wow. Big claims. It must be silly hat day on the Haskell lists. We're trying hard to

Re: [Haskell-cafe] Haskell vs GC'd imperative languages, threading, parallelizeability (is that a word? :-D )

2007-08-10 Thread Donald Bruce Stewart
hughperkins: On 8/10/07, Donald Bruce Stewart [EMAIL PROTECTED] wrote: It's using bit arrays. Well I'm a total Haskell newbie, and you're using Haskell to write imperative code, so it's really hard for me to read, but looking at your code, you have

Re: [Haskell-cafe] Slow IO or bad code?

2007-08-09 Thread Donald Bruce Stewart
j.vimal: Hi I am practicing writing code in haskell, by solving problems at this site. http://spoj.pl. The problem http://spoj.pl/problems/FASHION , is pretty simple. 1. Given two lists A,B , of N numbers, sort them and take sum of products. i.e. Sum ai * bi I wrote a code, but

Re: [Haskell-cafe] where to put handy functions?

2007-08-09 Thread Donald Bruce Stewart
rk: On 8/9/07, Chad Scherrer [EMAIL PROTECTED] wrote: Is there process for submitting functions for consideration for inclusion into future versions of the standard libraries? For example, I'd like to see this in Data.List: I imagine including it in std lib takes a while. Would it be a

Re: [Haskell-cafe] Dynamic thread management?

2007-08-09 Thread Donald Bruce Stewart
hughperkins: Haskell/FP seems to have solved the hardest bit of threading, which is making it obvious which bits of a program are parallelizable, and which are not. Remains to actually parallelize out the programs. Am I being naive or is this trivial? Is there some

Re: [Haskell-cafe] Language support for imperative code. Was: Re: monad subexpressions

2007-08-08 Thread Donald Bruce Stewart
brianh: Hugh Perkins wrote: On 8/8/07, *Brian Hulley* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: In contrast, all the pure functional GUIs that I've seen... In defense of Haskell (wow!), note that imperative languages are not without problems in GUIs. In a multithreaded

[Haskell-cafe] Haskell Weekly News: August 07, 2007

2007-08-07 Thread Donald Bruce Stewart
--- Haskell Weekly News http://sequence.complete.org/hwn/20070807 Issue 64 - August 07, 2007 --- Welcome to issue 64 of HWN, a weekly newsletter

Re: [Haskell-cafe] Sudoku Solver

2007-08-06 Thread Donald Bruce Stewart
j.vimal: On 8/7/07, Hugh Perkins [EMAIL PROTECTED] wrote: Note that the official way to solve sudoku is to use dancing links, but I guess you are creating a naive implementation precisely as a base-line against which to measure other implementations? Well, Dancing Links (DLX) is just a

Re: [Haskell-cafe] Sudoku Solver

2007-08-06 Thread Donald Bruce Stewart
hughperkins: On 8/7/07, Donald Bruce Stewart [EMAIL PROTECTED] wrote: See also, [2]http://haskell.org/haskellwiki/Sudoku -- Don Just out of ... errr curiosity... which of those implementations is the fastest? No idea. You could compile them all

Re: [Haskell-cafe] Haskell FCGI server.

2007-08-04 Thread Donald Bruce Stewart
george.moschovitis: is it possible to create a FCGI server that listens to a specific port using the Haskell FCGI library? The front end web server would then communicate with this back end FCGI server through this port. A small example would be really appreciated.

Re: [Haskell-cafe] When is waitForProcess not necessary?

2007-08-02 Thread Donald Bruce Stewart
bayer: If one is calling runInteractiveCommand for a sure-thing returning a small amount of output (say, ls for a modest directory), is it necessary to call waitForProcess? My waitForProcess calls came under scrutiny when I tried to GHC profile a threaded process, which isn't possible. It

Re: [Haskell-cafe] problem building lambdabot

2007-07-30 Thread Donald Bruce Stewart
mvanier: Thanks, but this doesn't answer the question. I can load up the Control.Arrow module fine in ghci. Is there a problem with the packaging information? It needs the 'arrows' package from hackage, not just Control.Arrow. You'll get by fine by just removing the 'arrows' dependency :

Re: [Haskell-cafe] HDBC Laziness (was Re: HDBC or HSQL)

2007-07-29 Thread Donald Bruce Stewart
mutjida: Hello, I have heard from a number of people that this behavior is not very newbie-friendly. I can see how that is true. I have an API revision coming anyway, so perhaps this is the time to referse the default laziness of HDBC calls (there would be a '-version of everything

[Haskell-cafe] Videos of Haskell talks

2007-07-28 Thread Donald Bruce Stewart
A new wiki page collecting tutorials and presentations about Haskell, is on the wiki: http://haskell.org/haskellwiki/Video_presentations Highlights include: Transactional Memory for Concurrent Programming Parametric Polymorphism and the Girard-Reynolds Isomorphism Programming in

Re: [Haskell-cafe] advantages of using fix to define rcursive functions

2007-07-26 Thread Donald Bruce Stewart
voigt: Donald Bruce Stewart wrote: harald.rotter: Hi, I read about the usage of fix to define recursive functions. Although I think that I understood how to use fix, I still wonder what the advantages of fix are (as compared to the conventional approach to define recursive functions

Re: [Haskell-cafe] advantages of using fix to define rcursive functions

2007-07-26 Thread Donald Bruce Stewart
harald.rotter: Hi, I read about the usage of fix to define recursive functions. Although I think that I understood how to use fix, I still wonder what the advantages of fix are (as compared to the conventional approach to define recursive functions). Any hints are appreciated.

Re: [Haskell-cafe] Fixity of

2007-07-26 Thread Donald Bruce Stewart
ross: On Fri, Jul 27, 2007 at 12:08:30AM +1000, Donald Bruce Stewart wrote: There's a theory this should work: getContents = lines map read sum print But unfortunately we have: `(=)' [infixl 1] `()' [infixr 1] Meaning we must write: getContents

[Haskell-cafe] Fixity of

2007-07-26 Thread Donald Bruce Stewart
There's a theory this should work: getContents = lines map read sum print But unfortunately we have: `(=)' [infixl 1] `()' [infixr 1] Meaning we must write: getContents = (lines map read sum print) Indeed, all Arrow ops are infixr. Are there any technical/compelling

Re: [Haskell-cafe] UTF-16

2007-07-25 Thread Donald Bruce Stewart
andrewcoppin: I don't know if anybody cares, but... Today a wrote some trivial code to decode (not encode) UTF-16. I believe somebody out there has a UTF-8 decoder, but I needed UTF-16 as it happens. (I didn't bother decoding code points outside the BMP - I'm sure you can figure out

Re: [Haskell-cafe] HDBC or HSQL

2007-07-25 Thread Donald Bruce Stewart
mutjida: Hello, Would you go as far to say that when new programmers ask which database binding to use, we should _recommend_ HDBC then? (As we do gtk2hs, for the gui libraries). At this point in time, my advice to new Haskell programmers would be: first try Takusen, as long as it can

[Haskell-cafe] Haskell Weekly News: July 23, 2007

2007-07-22 Thread Donald Bruce Stewart
--- Haskell Weekly News http://sequence.complete.org/hwn/20070723 Issue 63 - July 23, 2007 --- Welcome to issue 63 of HWN, a weekly newsletter

[Haskell-cafe] More on improving the mailing list

2007-07-17 Thread Donald Bruce Stewart
An interesting study on problem resolution and feedback on some technical mailing lists, How to Help Mailing Lists Help Readers (Results of Recent Data Analysis) http://praxagora.com/andyo/professional/mailing_list_follow_up/ including graphs! :) With conclusions at the end on how

Re: [Haskell-cafe] Getting lambdabot to work with 6.6.1

2007-07-17 Thread Donald Bruce Stewart
syntactically.vincenz: Dear, After a suggestion from quicksilver, I decided to write this message. To get lambdabot working on 6.6.1 you need to: 1) ensure you have the regexp-base, regexp-compat and regexp-posix from hackage installed The .cabal file now enforces this.

Re: [Haskell-cafe] Getting lambdabot to work with 6.6.1

2007-07-17 Thread Donald Bruce Stewart
shachaf: I also commented out arrows as a dependency in the .cabal, I think. Was that not a good idea? it seemed to work. You just won't be able to use arrows transformers and other fun things in @eval. ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] External Sort and unsafeInterleaveIO

2007-07-17 Thread Donald Bruce Stewart
midfield: hi folks -- a haskell newbie here, searching for comments and wisdom on my code. i had a project to try to implement external sort in haskell as a learning exercise. (external sort is sorting a list that is too large to fit in main memory, by sorting in chunks, spooling to

Re: [Haskell-cafe] External Sort and unsafeInterleaveIO

2007-07-17 Thread Donald Bruce Stewart
midfield: hi -- thanks for the useful comments! i will definitely go through them carefully. unfortunately for this code (but fortunately for me) i defend my dissertation on monday so i'm a little distracted right now. i'm more than happy to donate this code or whatever

Re: [Haskell-cafe] Haskell for categorists

2007-07-16 Thread Donald Bruce Stewart
miguelimo38: Just being curious. There are a lot of tutorials ensuring the reader that, although Haskell is based on category theory, you don't have to know CT to use Haskell. So, is there ANY Haskell tutorial for those who do know CT? I don't need it, personally, but still... I'd

Re: [Haskell-cafe] -O2 compile option can give speed increase over -O. Fasta shootout program test runs.

2007-07-16 Thread Donald Bruce Stewart
r.kelsall: I have been playing with the Fasta program in the shootout to see if I can make it umm faster. Starting from dons program on this page and adding some timing calculations as suggested on this wiki page http://shootout.alioth.debian.org/gp4/benchmark.php?test=fastalang=ghcid=2

Re: [Haskell-cafe] Newbie question about tuples

2007-07-15 Thread Donald Bruce Stewart
bf3: Donald: Yeah, there's some known low level issues in the code generator regarding heap and stack checks inside loops, and the use of registers on x86. But note this updated paper, http://www.cse.unsw.edu.au/~chak/papers/CLPKM07.html Add another core to your machine and it is no

Re: Re[4]: [Haskell-cafe] In-place modification

2007-07-15 Thread Donald Bruce Stewart
hughperkins: Sebastian, Why would I write a slow, complicated algorithm in C#? I'm not making these comparisons for some academic paper, I'm trying to get a feel for how the languages run in practice. And really in practice, I'm never going to write a prime algorithm

Re: Re[4]: [Haskell-cafe] In-place modification

2007-07-15 Thread Donald Bruce Stewart
hughperkins: Hey, guys, I just realized this test is not really fair! I've been using the Microsoft .Net compiler ,which is a proprietary closed-source compiler. To be fair to Haskell, we should probably compare it to other open source products, such as g++ and mono? Here

Re: Re[4]: [Haskell-cafe] In-place modification

2007-07-15 Thread Donald Bruce Stewart
hughperkins: On 7/15/07, Donald Bruce Stewart [EMAIL PROTECTED] wrote: [snip] unsafeWrite[snip] [snip]unsafeRead[snip] Hi Donald, the idea is to use this for operational code, so avoiding unsafe operations is preferable ;-) You'll note that the C# version

Re: Re[4]: [Haskell-cafe] In-place modification

2007-07-15 Thread Donald Bruce Stewart
hughperkins: On 7/15/07, Sebastian Sylvan [EMAIL PROTECTED] wrote: I don't see what the point of this is? Why do timings of different algorithms? Of course you could do the same optimization in any language, so why do you think it's relevant to change the

Re: Re[4]: [Haskell-cafe] In-place modification

2007-07-15 Thread Donald Bruce Stewart
hughperkins: Hey, I just realized I can shave off another 30% in C# ;-) So now the timings become: Ok. So do the same thing to the Haskell program. The compilers should produce pretty much identical assembly. {-# OPTIONS -O2 -optc-O -fbang-patterns #-} import Control.Monad.ST

Re: Re[4]: [Haskell-cafe] In-place modification

2007-07-15 Thread Donald Bruce Stewart
dons: hughperkins: Hey, I just realized I can shave off another 30% in C# ;-) So now the timings become: Ok. So do the same thing to the Haskell program. The compilers should produce pretty much identical assembly. Oh, and I forgot you count up by two now. Here's the Haskell

Re: Re[4]: [Haskell-cafe] In-place modification

2007-07-15 Thread Donald Bruce Stewart
dons: dons: hughperkins: Hey, I just realized I can shave off another 30% in C# ;-) So now the timings become: Ok. So do the same thing to the Haskell program. The compilers should produce pretty much identical assembly. Oh, and I forgot you count up by two now.

Re: Re[4]: [Haskell-cafe] In-place modification

2007-07-15 Thread Donald Bruce Stewart
hughperkins: Brandon wrote: Seems to me you get the best picture by picking two algorithms, one which favors C# and one which favors Haskell, and implementing both in both languages. Sounds good to me. What is a good problem that favors Haskell? NO. We just

Re: [Haskell-cafe] Newbie question about tuples

2007-07-15 Thread Donald Bruce Stewart
andrewcoppin: Donald Bruce Stewart wrote: bf3: Maybe this is yet another newbie stupid question, but do you mean that GHC does automatic multi-threading? (Haskell seems very suitable for that) Otherwise adding an extra core does not really help does it? No, though that would be nice

Re: [Haskell-cafe] Maintaining the community

2007-07-15 Thread Donald Bruce Stewart
zednenem: On 7/15/07, Derek Elkins [EMAIL PROTECTED] wrote: There is no version of bytestrings without stream fusion and there never was. Bytestrings have no compiler support, it is just a library. I'm not sure that's correct. Stream fusion is a particular fusion technique that wasn't

Re: [Haskell-cafe] List of authors happy to have work moved totheHaskell wiki

2007-07-14 Thread Donald Bruce Stewart
claus.reinke: (sorry if you already know this, just want to clarify. All AIUI, IANAL, etc) neither am i!-) If you publish something under licence A, you still remain the copyright holder, and can later also publish it under licence B. You can also publish it combined with other material

Re: Re[4]: [Haskell-cafe] In-place modification

2007-07-14 Thread Donald Bruce Stewart
derek.a.elkins: On Sun, 2007-07-15 at 00:53 +0200, Hugh Perkins wrote: There's really a tendency in this newsgroup to point people to huge documents, when a small copy and paste would make the answer so much more accessible ;-) Anyway... so reading through the paper, it looks like its

Re: [Haskell-cafe] Ray tracer

2007-07-14 Thread Donald Bruce Stewart
andrewcoppin: The Haskell ray tracer seems to be a pretty standard and widely-used example program. But has anybody ever seriously tried to make a production-grade implementation? (I.e., one that is user-friendly, efficient, and with lots of functionallity.) All the ones I know of are

Re: Re[4]: [Haskell-cafe] Newbie question about tuples

2007-07-14 Thread Donald Bruce Stewart
bf3: Thanks Bulat, but now you scattered my hopes that GHC would magically do all these optimizations for me ;-) I must say that although the performance of Haskell is not really a concern to me, I was a bit disappointed that even with all the tricks of the state monad, unboxing, and

Re: [Haskell-cafe] [weird stuff] The Dodgy Diagonal

2007-07-14 Thread Donald Bruce Stewart
ctm: Hi Stefan Thanks for a very enlightening reply. In GHC 6.7.20070712 and Yhc, this is perfectly safe. In GRIN based systems like Jhc, this is *not* safe, since after evaluation comparisons are done using the full tag. It's now occurred to me that at a cost of some noise, I

Re: [Haskell-cafe] Frag

2007-07-14 Thread Donald Bruce Stewart
jon: I just stumbled upon this fast action 3D shooter written entirely in Haskell: http://haskell.org/haskellwiki/Frag After 15 minutes trying to build it I find that it segfaults. Can anyone else get this to work? Likely depends on your OpenGL version, and possibly even graphics

Re: [Haskell-cafe] Frag

2007-07-14 Thread Donald Bruce Stewart
mwassell: Donald Bruce Stewart wrote: jon: I just stumbled upon this fast action 3D shooter written entirely in Haskell: http://haskell.org/haskellwiki/Frag After 15 minutes trying to build it I find that it segfaults. Can anyone else get this to work? Likely depends

Re: [Haskell-cafe] Maintaining the community

2007-07-13 Thread Donald Bruce Stewart
claus.reinke: personally, i tend to be more willing to answer questions on the list than to fiddle with wiki markup and conventions, but there is no reason why people who are happier with wiki editing cannot extract content from list answers to the wiki,

Re: [Haskell-cafe] Functional dependencies *not* part of the next Haskell standard?

2007-07-13 Thread Donald Bruce Stewart
bulat.ziganshin: Hello Simon, Friday, July 13, 2007, 11:37:59 AM, you wrote: | I think the implementation is some 90% complete though, in GHC head. | Certainly you can write many associated types programs already -- the | missing part is finishing off associated type synonyms, iirc.

Re: [Haskell-cafe] Looking for final year project - using Haskell, or another functional language

2007-07-13 Thread Donald Bruce Stewart
bf3: Yes, for a newbie like me it was actually the reason to abandon Haskell initially; none of the examples at http://www.haskell.org/HOpenGL compiled! Another very cool albeit difficult project would be automatic retargeting of Haskell code to the graphics processor unit (GPU), or IBM

[Haskell-cafe] List of authors happy to have work moved to the Haskell wiki

2007-07-13 Thread Donald Bruce Stewart
ctm: On 13 Jul 2007, at 14:47, Donald Bruce Stewart wrote: I tried an experiment this week of just taking someone's post (Conor's idiom brackets), and putting directly on the wiki first, then letting the author know that's happened. Seemed entirely reasonable to me. If I have a spare

Re: [Haskell-cafe] Re: Type system madness

2007-07-13 Thread Donald Bruce Stewart
wnoise: On 2007-07-13, Stefan O'Rear [EMAIL PROTECTED] wrote: He's not trying to report a bug; he's just complaining about base's long-known lack of support for non-latin1 encodings. (IIUC) Which is a bug. Base needs to support (in an /obvious/ way) (1) direct I/O of octets (bytes), with

Re: [Haskell-cafe] Newbie question about tuples

2007-07-13 Thread Donald Bruce Stewart
bulat.ziganshin: Hello peterv, Friday, July 13, 2007, 5:03:00 PM, you wrote: think the latest compilers are much better). Now when implementing something like this in Haskell, I would guess that its laziness would allow to interleave many of the math operations, reordering them to be

Re: [Haskell-cafe] List of authors happy to have work moved to the Haskell wiki

2007-07-13 Thread Donald Bruce Stewart
dons: ctm: On 13 Jul 2007, at 14:47, Donald Bruce Stewart wrote: I tried an experiment this week of just taking someone's post (Conor's idiom brackets), and putting directly on the wiki first, then letting the author know that's happened. Seemed entirely reasonable to me. If I

Re: [Haskell-cafe] Re: money type ?

2007-07-12 Thread Donald Bruce Stewart
simon: Great - indeed, sum [1.85, 5.95, -7.80] 8.881784197001252e-16 sum [1.85::Money, 5.95, -7.80] 0.00 I'm not yet sure these will do the best thing in all arithmetic, but it seems to be the right thing for now. Yes, I will need to read these also. Perhaps first reading the

Re: [Haskell-cafe] Type system madness

2007-07-12 Thread Donald Bruce Stewart
andrewcoppin: Ketil Malde wrote: On Wed, 2007-07-11 at 20:10 +0100, Andrew Coppin wrote: When I tell the editor to save UTF-8, it inserts some weird BOM character at the start of the file - and thus, any attempt at programatically processing that file instantly fails. :-(

Re: [Haskell-cafe] Functional dependencies *not* part of the next Haskell standard?

2007-07-12 Thread Donald Bruce Stewart
jules: peterv wrote: instance Vector Vector2 where dot (V2 x1 y1) (V2 x2 y2) = x1 * x2 + y1 * y2 Amazing, so simple it is, Yoda would say ;) I did not realize one could perform partial application on types when declaring instances (I mean not specifying the type of Vector2 in instance

[Haskell-cafe] Maintaining the community

2007-07-12 Thread Donald Bruce Stewart
As we sit here riding the Haskell wave: http://www.cse.unsw.edu.au/~dons/tmp/cafe.png with nearly 2000 (!) people reading haskell-cafe@, perhaps its time to think some more about how to build and maintain this lovely Haskell community we have. Just yesterday I received an email: I

[Haskell-cafe] increase in spam on the wiki

2007-07-11 Thread Donald Bruce Stewart
Looks like the spam protection measures are breaking down a bit. There's been 4 spam incidents (at least) on the wiki in the past day. Ashley et al, is there any easy fix? -- Don ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Data.ByteString.dropWhile

2007-07-10 Thread Donald Bruce Stewart
drtomc: So the following isn't as clever as the line-noise Don posted, but should be in the ball-park. Low level loops are irksome, but guaranteed to be quick :P dropFromEnds p = dropWhile p . dropWhileEnd p dropWhileEnd p bs = take (findFromEndUntil (not p) bs) bs takeWhileEnd p bs =

Re: [Haskell-cafe] Haskell and GnuPG?

2007-07-10 Thread Donald Bruce Stewart
magnus: Continuing my life up-side-down? I'm looking for a Haskell wrapper around GPGME. Is there such a beast? Don't think there's such a binding yet. Would make a good contribution though! -- Don ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] xkcd #287 NP-Complete

2007-07-10 Thread Donald Bruce Stewart
lemming: On Tue, 10 Jul 2007, Donald Bruce Stewart wrote: These smaller NP problems really love the list monad. here's roconnor's solution from #haskell: import Control.Monad menu = [(Mixed Fruit,215),(French Fries,275) ,(Side Salad,335),(Hot Wings,355

Re: [Haskell-cafe] CPS versus Pattern Matching performance

2007-07-10 Thread Donald Bruce Stewart
tmorris: When you you use maybe :: b - (a - b) - Maybe a - b instead of pattern matching a returned Maybe value? Is there something a bit more concrete on this issue? You mean, versus using 'case' or sugar for case? It'll just inline to the same code. For example: maybe 10 (\n - n + 1)

Re: [Haskell-cafe] CPS versus Pattern Matching performance

2007-07-10 Thread Donald Bruce Stewart
tmorris: Thanks Don, Is your explanation specific to maybe? Or does that apply to all functions? Suppose the following function for lists: f :: [a] - b - (a - [a] - b) - b ...instead of pattern matching [] and (x:xs) It really depends on the body of 'f'. If they're simple wrappers over

Re: [Haskell-cafe] CPS versus Pattern Matching performance

2007-07-10 Thread Donald Bruce Stewart
lemming: On Tue, 10 Jul 2007, Tony Morris wrote: Is your explanation specific to maybe? Or does that apply to all functions? Suppose the following function for lists: f :: [a] - b - (a - [a] - b) - b ...instead of pattern matching [] and (x:xs) A foldr without recursion. I

Re: [Haskell-cafe] Sequence Classes

2007-07-10 Thread Donald Bruce Stewart
jcast: I was just meditating on array fusion using streams, and list fusion using streams, and it struck me: the definition of the list functions over arrays is the same as that of the list functions over lists. From the ByteString paper, we get: Yes indeed, hence Data.Stream provides the

Re: [Haskell-cafe] In-place modification

2007-07-10 Thread Donald Bruce Stewart
allbery: On Jul 10, 2007, at 16:07 , Alex Queiroz wrote: As I replied to Hugh, the Universe of computers is not restricted to PCs. We, embedded developers, will be using C for a lot of time still. Doesn't nhc98 target embedded devices? It's been used on embedded arm devices the

Re: [Haskell-cafe] Looking for final year project - using Haskell, or another functional language

2007-07-10 Thread Donald Bruce Stewart
walter1003: Hi all, I will soon be doing my last year in computer science. One part of our last year encompasses quite a big project which will go over 3 terms and will account for 3 modules (45 credits). I was thinking in doing something using functional languages

Re: [Haskell-cafe] Allocating enormous amounts of memory and wondering why

2007-07-10 Thread Donald Bruce Stewart
jeff: I switched to Data.Binary, which dropped me from 2.6GB to 1.5GB, and then I switched this afternoon to unboxed arrays from lists of floats, and that dropped me again from 1.5GB to 475MB. I think, all told, that I'm in an acceptable range now, and thank you for pointing out the library

Re: [Haskell-cafe] Allocating enormous amounts of memory and wondering why

2007-07-10 Thread Donald Bruce Stewart
jeff: I switched to Data.Binary, which dropped me from 2.6GB to 1.5GB, and then I switched this afternoon to unboxed arrays from lists of floats, and that dropped me again from 1.5GB to 475MB. I think, all told, that I'm in an acceptable range now, and thank you for pointing out the library

Re: [Haskell-cafe] Re: Too many packages on hackage? :-)

2007-07-09 Thread Donald Bruce Stewart
ketil: On Mon, 2007-07-09 at 10:30 +1000, Donald Bruce Stewart wrote: Another idea I've been pondering is allowing people to add links to documentation for libraries My main worry about Hackage is that it is often hard to tell the current status of packages - it could easily develop

Re: [Haskell-cafe] Lambdabot web interface

2007-07-09 Thread Donald Bruce Stewart
voigt: Hi, I can't get http://lambdabot.codersbase.com/ to work for me. Whatever input = No lambdabot process Is that a known issue, not the right URL, ...? Thanks, Janis. Right URL, but Jason's not running lambdabot at the moment. You can access our bot via IRC though.

Re: [Haskell-cafe] no-coding functional data structures via lazyness

2007-07-09 Thread Donald Bruce Stewart
bayer: Learning Haskell, the Prelude.ShowS type stood out as odd, exploiting the implementation of lazy evaluation to avoid explicitly writing an efficient concatenable list data structure. This felt like cheating, or at least like using a screwdriver as a crowbar, to be less

Re: [Haskell-cafe] Re: Too many packages on hackage? :-)

2007-07-09 Thread Donald Bruce Stewart
sascha.boehme: Hello, Who's our SoC hackage guy? To do list right here! The HackageDB project is for now concentrating on another subject. I see the necessity of adding search features and additionally tags, but in the moment I work on automatic generation of Haddock documentation.

Re: [Haskell-cafe] Data.ByteString.dropWhile

2007-07-09 Thread Donald Bruce Stewart
drtomc: Hi All, I notice that Data.ByteString has span and spanEnd. Is there a known and break/breakEnd. particular reason why dropWhile and takeWhile don't have corresponding *End functions? If not, what is the protocol for adding them? There's no reason -- we couldn't decide on whether

Re: [Haskell-cafe] Data.ByteString.dropWhile

2007-07-09 Thread Donald Bruce Stewart
drtomc: Well, maybe I shoud be asking a higher level question then. I have a function tidy = reverse . dropWhile punk . reverse . dropWhile punk where punk = isPunctuation . chr . fromIntegral which is leading to a significant amount of allocation, and you can see why. The way

Re: [Haskell-cafe] A very edgy language (was: A very nontrivial parser)

2007-07-08 Thread Donald Bruce Stewart
bulat.ziganshin: Hello Thomas, Sunday, July 8, 2007, 2:36:43 AM, you wrote: This is certainly true. I've coded up in less than six months, something that uses better algorithms and finer grained concurrency than the software I used to work on, and the latter represented 5 or more

Re: [Haskell-cafe] A very edgy language

2007-07-08 Thread Donald Bruce Stewart
andrewcoppin: Does anybody have any clue why ByteStrings are actually faster? (And why this information isn't easily findable anywhere - must shorly be a VFAQ.) It's well documented in the API documentation for bytestrings. Start here:

Re: [Haskell-cafe] Toy compression algorithms [was: A very edgy language]

2007-07-08 Thread Donald Bruce Stewart
andrewcoppin: Andrew Coppin wrote: Dave Bayer wrote: I was beginning to accept that I might die before clearing my pipeline of research projects I want to code up. Haskell has given me new hope. Indeed. ;-) Today I hve implemented encoders and decoders for RLE, MTF, Fibonacci codes,

Re: [Haskell-cafe] In-place modification

2007-07-08 Thread Donald Bruce Stewart
andrewcoppin: I was wittering on about stream fusion and how great it is, and I got a message from Mr C++. (Mr C++ develops commercial games, and is obsessed with performance. For him, the only way to achieve the best performance is to have total control over every minute detail of the

Re: [Haskell-cafe] Re: Too many packages on hackage? :-)

2007-07-08 Thread Donald Bruce Stewart
bulat.ziganshin: Hello apfelmus, Sunday, July 8, 2007, 5:20:18 PM, you wrote: Looks like there's too many packages on hackage.haskell.org now for a it's the nicest problem i can imagine :) For browsing libraries, I like the wiki pages much more than hackage. Can't those two be

[Haskell-cafe] Compress and serialise data with lazy bytestrings, zlib and Data.Binary (was: Allocating enormous amounts of memory)

2007-07-08 Thread Donald Bruce Stewart
Jefferson Heard write: I'm using the Data.AltBinary package to read in a list of 4.8 million floats and 1.6 million ints. Doing so caused the memory footprint to blow up to more than 2gb, which on my laptop simply causes the program to crash. I can do it on my workstation, but I'd really

Re: [Haskell-cafe] Compress and serialise data with lazy bytestrings, zlib and Data.Binary (was: Allocating enormous amounts of memory)

2007-07-08 Thread Donald Bruce Stewart
dons: Jefferson Heard write: I'm using the Data.AltBinary package to read in a list of 4.8 million floats and 1.6 million ints. Doing so caused the memory footprint to blow up to more than 2gb, which on my laptop simply causes the program to crash. I can do it on my workstation, but

[Haskell-cafe] More binary IO, compression, bytestrings and FFI fun

2007-07-08 Thread Donald Bruce Stewart
Processing larger amounts of data, compression, serialisation and calling C. An elaboration of the previous example: * Build a largish structure in Haskell * Compress it in memory * Serialise it to disk * Deserialise it * Decompress * Pass it to C * Display the result

Re: [Haskell-cafe] Clearly, Haskell is ill-founded

2007-07-08 Thread Donald Bruce Stewart
drtomc: I don't know if you saw the following linked off /. http://www.itwire.com.au/content/view/13339/53/ An amazon link for the book is here: http://www.amazon.com/Computer-Science-Reconsidered-Invocation-Expression/dp/0471798142 The basic claim appears to be that discrete

Re: [Haskell-cafe] A very edgy language

2007-07-07 Thread Donald Bruce Stewart
andrewcoppin: Donald Bruce Stewart wrote: Give #haskell is a far larger community than: #lisp #erlang #scheme #ocaml As well as #java #javascript #ruby #lua #d #perl6 Maybe we need to reconsider where the (FP) mainstream is now

Re: [Haskell-cafe] Re: GHC threads and SMP

2007-07-07 Thread Donald Bruce Stewart
ninegua: replying to my own message... the behavior is only when -O is used during compilation, otherwise they both run on 2 cores but at a much lower (1/100) speed. Hmm, any change with -O2? Is the optimiser changing the code such that the scheduler doesn't get to switch threads as often? If

[Haskell-cafe] Too many packages on hackage? :-)

2007-07-07 Thread Donald Bruce Stewart
Hackage hackers, Looks like there's too many packages on hackage.haskell.org now for a single page listing: http://hackage.haskell.org/packages/archive/pkg-list.html Perhaps we can have a page with just the categories, with subpages hanging off? -- Don

Re: [Haskell-cafe] RE: Modern Haskell books (was Re: A very nontrivial parser)

2007-07-06 Thread Donald Bruce Stewart
bf3: but afair you don't yet have too much experience even with H98 language? from my POV, H98 as is useful for learning, but not for real apps. there is wide common subset of GHC and Hugs language extensions and this set (with exception for FD) will probably become new Haskell'

Re: [Haskell-cafe] RE: Modern Haskell books (was Re: A very nontrivial parser)

2007-07-06 Thread Donald Bruce Stewart
dons: bf3: but afair you don't yet have too much experience even with H98 language? from my POV, H98 as is useful for learning, but not for real apps. there is wide common subset of GHC and Hugs language extensions and this set (with exception for FD) will probably become new

Re: [Haskell-cafe] Haddock doesn't work -- with Haddock

2007-07-06 Thread Donald Bruce Stewart
ttmrichter: I've been wrestling the last few days with putting Haddock documentation into my code. After a dead-simple library failed to generate anything meaningful, I gave up, turfed my copy of Haddock and downloaded the latest from the web site. (Haddock 0.8, it seems.)

  1   2   3   4   5   6   >