Re: [Haskell-cafe] Re: Why can't Haskell be faster?

2007-11-02 Thread Don Stewart
igouy2: > > --- Sebastian Sylvan <[EMAIL PROTECTED]> wrote: > -snip- > > It still tells you how much content you can see on a given amount of > > vertical space. > > And why would we care about that? :-) > > > > I think the point, however, is that while LOC is not perfect, gzip is > > worse.

Re: [Haskell-cafe] Layout to non-layout code

2007-11-02 Thread Don Stewart
briqueabraque: > Hi, > > I understand that many people like using > layout in their code, and 99% of all > Haskell examples use some kind of layout > rule. However, sometimes, I would like > not to use layout, so I can find errors > easier (and maybe convert it to layout for > presentation after a

[Haskell-cafe] Announce: xmonad 0.4.1

2007-11-02 Thread Don Stewart
: Spencer Janssen Don Stewart Jason Creighton Andrea Rossato David Roundy ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Is there a module for multivariate linear regression?

2007-11-05 Thread Don Stewart
horng_twu_lihn: >I am looking for a Haskell module that will do multivariate linear >regression. Does someone know which module will do it? That is, the >equivalent of Perl's Statistics::Regression.pm. > > > [1]http://search.cpan.org/~itub/PerlMol-0.35_00.ppm/lib/Statistics/Regress

Re: [Haskell-cafe] Monte Carlo Pi calculation (newbie learnings)

2007-11-05 Thread Don Stewart
alex: > Hi all, > > import Random > import System.Environment > import List > import Monad > > randMax = 32767 > unitRadius = randMax * randMax > > rand :: IO Int > rand = getStdRandom (randomR (0, randMax)) > > randListTail accum 0 = accum > randListTail accum n = randListTail (rand : accum) (

Re: [Haskell-cafe] Go parallel

2007-11-05 Thread Don Stewart
timd: > Is it possible to use the forkIO primitive to cause pure computations > to be evaluated in parallel threads? > > It seems to me that laziness would always prevent any evaluation until > the result was used in a consuming thread (and hence would occur > serially, in that thread). Try `par`

Re: [Haskell-cafe] Re: speeding up fibonacci with memoizing

2007-11-05 Thread Don Stewart
If people write any new variants, please add them to: http://haskell.org/haskellwiki/The_Fibonacci_sequence :) westondan: > Throwing in a trace statement in fibaux tells me that fibaux i a b c is > not being memoized. If I do map fib [7..9], fibaux counts down to 0 > afresh for each of 7,

Re: [Haskell-cafe] Go parallel

2007-11-06 Thread Don Stewart
andrewcoppin: > Tim Docker wrote: > >Is it possible to use the forkIO primitive to cause pure computations > >to be evaluated in parallel threads? > > > > Somebody correct me here - I was under the impression that you only ever > need forkIO if you're doing something strange with FFI, and usual

Re: [Haskell-cafe] Monte Carlo Pi calculation (newbie learnings)

2007-11-06 Thread Don Stewart
lrpalmer: > On Nov 5, 2007 8:11 PM, Alex Young <[EMAIL PROTECTED]> wrote: > > {--} > > module Main where > > > > import Random > > import System.Environment > > import List > > import Monad > > > > randMax = 32767 > > unitRadius = randMax * randMax >

Re: [Haskell-cafe] Memory-mapped arrays?

2007-11-07 Thread Don Stewart
joelr1: > Is there such a thing as memory-mapped arrays in GHC? > > I'm looking for something that would let me memory-map a file of > floats and access it as an array. > There's a commented out mmapFile for ByteString in Data.ByteString's source. Use that, and then extract the ForeignPtr from

Re: [Haskell-cafe] ByteString search code available in easy-to-digest form

2007-11-07 Thread Don Stewart
bos: > I've packaged up the fast Boyer-Moore and Knuth-Morris-Pratt code that > Chris Kuklewicz posted a few months ago: > > http://article.gmane.org/gmane.comp.lang.haskell.libraries/7363 > > The consensus at the time was that the code was not ready for rolling > into the bytestring package,

Re: [Haskell-cafe] XMonad architecture paper?

2007-11-07 Thread Don Stewart
vigalchin: >Hello, > > I was watching Simon Peyton-Jones' video on "A Taste of Haskell" >Part 1. .. Is there any paper discussing the architecture? I am not afraid >to read code but sometimes a paper overview is good ... > >Regards, Vasya There's one quick paper describ

Re: [Haskell-cafe] MD5? (was: Haskell performance question)

2007-11-08 Thread Don Stewart
andrewcoppin: > Don Stewart wrote: > >dpiponi: > > > >>I was getting about 1.5s for the Haskell program and about 0.08s for > >>the C one with the same n=10,000,000. > >> > > > >I'm sure we can do better than that! > > >

Re: [Haskell-cafe] Haskell performance question

2007-11-08 Thread Don Stewart
nominolo: > On Thu, 2007-11-08 at 10:33 -0800, Dan Piponi wrote: > > I see lots of shootout examples where Haskell programs seem to perform > > comparably with C programs, but I find it hard to reproduce anything > > like those figures when testing with my own code. So here's a simple > > case: > >

Re: [Haskell-cafe] MD5? (was: Haskell performance question)

2007-11-08 Thread Don Stewart
thomas.dubuisson: > Glad you asked! > > http://sequence.complete.org/node/367 > > I just posted that last night! Once I get a a community.haskell.org > login I will put the code on darcs. Cool. I'll look at this. You might like to test against, http://hackage.haskell.org/cgi-bin/hackage

Re: [Haskell-cafe] Haskell performance question

2007-11-08 Thread Don Stewart
dpiponi: > On Nov 8, 2007 11:34 AM, Jason Dusek <[EMAIL PROTECTED]> wrote: > > Can you show us your compilation options and timings? > > I was simply using -O3. I tried a bunch of other flags (copied from > the shootout examples) but they made no appreciable difference. Argh, -O2 please. -O3 does

Re: [Haskell-cafe] Haskell performance question

2007-11-08 Thread Don Stewart
dpiponi: > I see lots of shootout examples where Haskell programs seem to perform > comparably with C programs, but I find it hard to reproduce anything > like those figures when testing with my own code. So here's a simple > case: > > I have this C program: > > #include > > #define n 1

Re: [Haskell-cafe] Haskell performance question

2007-11-08 Thread Don Stewart
dpiponi: > On Nov 8, 2007 12:16 PM, Don Stewart <[EMAIL PROTECTED]> wrote: > > > If you can post the code somewhere, that would be great, with examples > > of how to reproduce your timings. > > The code is exactly what I posted originally (but nore that n is 10 &g

Re: [Haskell-cafe] Haskell performance question

2007-11-08 Thread Don Stewart
bulat.ziganshin: > Hello Don, > > Thursday, November 8, 2007, 10:53:28 PM, you wrote: > > >>a <- newArray (0,n-1) 1.0 :: IO (IOUArray Int Double) > >>forM_ [0..n-2] $ \i -> do { x <- readArray a i; y <- readArray a > >> (i+1); writeArray a (i+1) (x+y) } > > oh, i was stupid. obviously, f

Re: [Haskell-cafe] Haskell performance question

2007-11-08 Thread Don Stewart
xj2106: > Don Stewart <[EMAIL PROTECTED]> writes: > > > Can you start by retrying with flags from the spectral-norm benchmark: > > > > > > http://shootout.alioth.debian.org/gp4/benchmark.php?test=spectralnorm&lang=ghc&id=0 > > > > The

Re: [Haskell-cafe] Building Haskell stuff on Windows

2007-11-08 Thread Don Stewart
andrewcoppin: > Thomas Schilling wrote: > >On Thu, 2007-11-08 at 18:34 +, Andrew Coppin wrote: > > > >>Neil Mitchell wrote: > >> > >>>Windows and Haskell is not a well travelled route, but if you > >>>stray of > >>>the cuddly installer packages, it gets even worse. > >>> > >>> >

Re: [Haskell-cafe] Haskell performance question

2007-11-08 Thread Don Stewart
bulat.ziganshin: > definitely, it's a whole new era in low-level ghc programming victory! -- Don :D ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Re: ByteString search code available in easy-to-digest form

2007-11-09 Thread Don Stewart
bos: > ChrisK wrote: > >Yeah, my code wants to open up the internals of Lazy bytestrings. Until > >recently this was possible toChunks, but it would be best to rewrite it > >for the > >newest Lazy representation (which comes with new shiny ghc 6.8.1). > > I've updated the stringsearch package on

Re: [Haskell-cafe] XMonad architecture paper?

2007-11-09 Thread Don Stewart
dons: > vigalchin: > >Hello, > > > > I was watching Simon Peyton-Jones' video on "A Taste of Haskell" > >Part 1. .. Is there any paper discussing the architecture? I am not > > afraid > >to read code but sometimes a paper overview is good ... > > > >Regards, Vasya > >

Re: [Haskell-cafe] MD5?

2007-11-09 Thread Don Stewart
andrewcoppin: > Don Stewart wrote: > >You might like to test against, > > > >http://hackage.haskell.org/cgi-bin/hackage-scripts/package/nano-md5-0.1 > > > >which is a strict bytestring openssl binding. > > > > Is that likely to work on

[Haskell-cafe] C++ vs. Haskell: Type-Level Death Match

2007-11-10 Thread Don Stewart
http://www.rubinsteyn.com/template_insanity.html The C++ response to Conrad's 'instant insanity' type program from the last Monad.Reader ! Can we do better still with the planned type-level programming of type families? -- Don ___ Haskell-Cafe mailing

Re: [Haskell-cafe] WideFinder

2007-11-10 Thread Don Stewart
s.clover: > http://www.tbray.org/tmp/o10k.ap is the basic data set. For heavier > duty testing, folks seem to be appending it to itself 99 more times > to yield a "o1000k.ap" dataset. I'd be curious for comments on my > code or other suggestions to speed things up -- the strictness > semant

Re: [Haskell-cafe] Upgrading X11

2007-11-11 Thread Don Stewart
jim: > > I have X11 1.2.2 installed and wanted to upgrade to 1.3 (to satisfy the > dependencies of another package), but "Setup configure" tells me I don't > have the headers installed. I do, and when I configure 1.2.2 they're > detected. Is this due to the newer version of Cabal? I have ghc 6.6,

[Haskell-cafe] Haskell Weekly News: November 11, 2007

2007-11-11 Thread Don Stewart
ith files and directories. Includes code for pattern matching, finding files, modifying file contents, and more. * stringsearch-0.2. Uploaded by Bryan OSullivan. [23]stringsearch, fast search of ByteStrings. * nano-md5-0.1. Uploaded by Don Stewart. [24]nano-md5, ByteString

Re: [Haskell-cafe] Why are OCaml and Haskell being used at these companies?

2007-11-12 Thread Don Stewart
vigalchin: >I am looking for (objective.. i.e. not juts FPL cheerleading) opinions as >to why Wall Street ( [3]http://www.janestcapital.com/) and banking are >now using OCaml and Haskell. I really want to understand what industrial >markets are adopting FPLs and why in order to hel

[Haskell-cafe] More good performance results for ghc 6.8

2007-11-13 Thread Don Stewart
Trying out some of the great language shootout programs with ghc 6.8 is producing nice results. For example, our "classic" cache-hammering, bitwise sieve benchmark is out of the box 10% faster with the new compiler. The (already rather good) benchmark is here (the same speed as the OCaml version un

Re: [Haskell-cafe] cabal problem?

2007-11-14 Thread Don Stewart
jens.blanck: >I have problems building X11. I just installed ghc 6.8 but I got the same >behaviour when asking it to use the old compiler. > >Jens > >> runghc Setup.hs configure >Configuring X11-1.3.0.2007... >checking for gcc... gcc >checking for C compiler defaul

Re: [Haskell-cafe] Brazilian Haskellers ?

2007-11-14 Thread Don Stewart
rherrmann: > > Hi brazilian haskellers, > > How about trying to form a HUG-BR ? Maybe even something along the lines of > FringeDC (http://www.lisperati.com/fringedc.html). I only know about 4 > people that would join the cause, that's why I'm recruiting ;-) > > Feel free to contact me (I'm post

Re: [Haskell-cafe] Re: List of all powers

2007-11-14 Thread Don Stewart
byorgey: >apfelmus, does someone pay you to write so many thorough, insightful and >well-explained analyses on haskell-cafe? I'm guessing the answer is 'no', >but clearly someone should! =) Having met apfelmus last month in Freiburg I can inform the cafe that he is thorough and insigh

Re: [Haskell-cafe] Using Data.Binary for compression

2007-11-14 Thread Don Stewart
stefanor: > On Wed, Nov 14, 2007 at 10:03:52PM -0800, Chad Scherrer wrote: > > Hi, > > > > I'd like to be able to use Data.Binary (or similar) for compression. > > Say I have an abstract type Symbol, and for each value of Symbol I > > have a representation in terms of some number of bits. For comp

Re: [Haskell-cafe] Chart plotting libraries

2007-11-14 Thread Don Stewart
jon: > > I'd like some free software to help me plot charts like the one from the ray > tracer language comparison: > > http://www.ffconsultancy.com/languages/ray_tracer/results.html > > I was using Mathematica but its stopped working and an upgrade is £2,000. Are > there Haskell bindings to

Re: [Haskell-cafe] Haskellforge?

2007-11-15 Thread Don Stewart
duncan.coutts: > On Thu, 2007-11-15 at 15:56 -0200, Maurí­cio wrote: > > Hi, > > > > Is there a "Haskellforge" somewhere, i.e., > > something like a sourceforge for open source > > Haskell programs, with darcs, automatic > > cabalization etc.? Has anyone tried that > > already? > > There is the H

Re: [Haskell-cafe] dropSpace not exported in ByteString

2007-11-15 Thread Don Stewart
olivier.boudry: >Hi all, > >I'm writing a Haskell program to do some address cleansing. The program >uses the ByteString library. > >Data.ByteString.Char8 documentations shows functions for removing >whitespace from start or end of a ByteString. Those functions are said to >

Re: [Haskell-cafe] dropSpace not exported in ByteString

2007-11-15 Thread Don Stewart
olivier.boudry: >Hi Don, > >In fact I'm not really looking at performance, I don't expect performance >to be a big issue in my application. > >I was just looking at using some simple functions found in the >documentation and avoid redefining them. > >In fact dropSpace and

Re: [Haskell-cafe] (general question) Approaches for storing large amount of simple data structures

2007-11-15 Thread Don Stewart
bbrown: > I have a project where I want to store a data structure on a file, > binary or ascii. And I want to use haskell to read and write the > file. I will have about half a million records so it would be nice if > the format was able to load quickly. I guess I could, but I kind of > want to a

Re: [Haskell-cafe] dropSpace not exported in ByteString

2007-11-15 Thread Don Stewart
olivier.boudry: >On 11/15/07, Don Stewart <[EMAIL PROTECTED]> wrote: > > Let me know if the rule fires. If it isn't, that's a bug, essentially. > > -- Don > >Don, > >As you can see the rule fires. > >C:\Temp>ghc

Re: [Haskell-cafe] RFC: demanding lazy instances of Data.Binary

2007-11-16 Thread Don Stewart
nicolas.frisby: > I've noticed a few posts on the cafe, including my own experience, > where the spine-strictness of the Binary instance for lists caused > some confusion. I'd like to suggest an approach to preventing this > confusion in the future, or at least making it easier to resolve. > > Hav

Re: [Haskell-cafe] RFC: demanding lazy instances of Data.Binary

2007-11-16 Thread Don Stewart
dons: > nicolas.frisby: > > I've noticed a few posts on the cafe, including my own experience, > > where the spine-strictness of the Binary instance for lists caused > > some confusion. I'd like to suggest an approach to preventing this > > confusion in the future, or at least making it easier to r

Re: [Haskell-cafe] Haskellforge?

2007-11-16 Thread Don Stewart
briqueabraque: > Hi, > > Is there a "Haskellforge" somewhere, i.e., > something like a sourceforge for open source > Haskell programs, with darcs, automatic > cabalization etc.? Has anyone tried that > already? > We use http://community.haskell.org/ which you can ask for an account on. wit

Re: [Haskell-cafe] MD5?

2007-11-17 Thread Don Stewart
bulat.ziganshin: > Hello Andrew, > > Saturday, November 17, 2007, 5:45:29 PM, you wrote: > > > wasn't MD5 itself. It's all the datatype conversions. Nowhere in the > > Haskell libraries can I find any of these functions: > > > I had to write all these myself, by hand, and then check that I got >

[Haskell-cafe] Stream fusion for Hackage

2007-11-17 Thread Don Stewart
recent paper: "Stream Fusion: From Lists to Streams to Nothing at All" Duncan Coutts, Roman Leshchinskiy and Don Stewart. ICFP 2007 This is a drop-in replacement for Data.List. Haddocks here, http://code.haskell.org/~dons/doc/stream-fusion/ (but note the interface is exactly t

Re: [Haskell-cafe] Stream fusion for Hackage

2007-11-18 Thread Don Stewart
Tom.Schrijvers: > On Sat, 17 Nov 2007, Don Stewart wrote: > > >Just a quick announce: the stream fusion library for lists, > >that Duncan Coutts, Roman Leshchinskiy and I worked on earlier this year > >is now available on Hackage as a standalone package: > > > &g

Re: [Haskell-cafe] Performance problems with parallelizing QuickCheck using channels (Control.Concurrent.Chan)

2007-11-18 Thread Don Stewart
gwern0: > (My previous email showed up as mangled in > ; > I think the PGP signature was the problem; I removed it and sent it > again, but it was put into moderation for size, and hasn't been > released yet - so I'm sending t

Re: [Haskell-cafe] The Yampa Arcade: source code available?

2007-11-19 Thread Don Stewart
sk: > On 19.11.2007, at 19:54, Peter Verswyvelen wrote: > >I can find the paper, but is the source code for that Space > >Invaders alike game also available somewhere? > > it's included here: http://haskell.org/yampa/afrp-0.4-src.tgz > > btw, does anybody know what's the current state of affair

Re: [Haskell-cafe] Stream fusion for Hackage

2007-11-19 Thread Don Stewart
simonpj: > | > Will it eventually replace Data.List in GHC? > | > | That is the plan, yep. > > But first we need to solve the concatMap problem, no? > > So far as I know, fold/build has the property that if fusion doesn't happen, > no harm is done. But streams risk making the program *worse* i

Re: [Haskell-cafe] expanded standard lib

2007-11-19 Thread Don Stewart
andrewcoppin: > Hackage seems like a nice idea in principle. However, I think in practice too: we had no central lib archive or dependency system, now we have 400 libraries, and a package installer, 10 months later. Until Hackage, there was a strong pressure not to reuse other people's librarie

Re: [Haskell-cafe] expanded standard lib

2007-11-19 Thread Don Stewart
ndmitchell: > Hi > > > - The packages seem to be of quite variable quality. Some are excellent, > > some are rather poor (or just not maintained any more). > > The problem is that only one person gets to comment on the quality of > a library, the author, who is about the least objective person. >

Re: [Haskell-cafe] RFC: demanding lazy instances of Data.Binary

2007-11-19 Thread Don Stewart
nicolas.frisby: >I've got a first draft with the newtype and just an instance for list. > >If you'd prefer fewer questions, please let me know ;) > >0) I've cabalised it ("lazy-binary"), but I don't have anywhere to host >it. Would it be appropriate to host on [1]darcs.haskell.org

Re: [Haskell-cafe] Tetris

2007-11-19 Thread Don Stewart
andrewcoppin: > If you were going to implement Tetris in Haskell, how would you do it? > > (For that matter, has anybody already *done* it? It would probably make > a nice example program...) http://haskell.org/haskellwiki/Applications_and_libraries/Games ASCII tetris http://web.comlab.

Re: [Haskell-cafe] Tetris

2007-11-20 Thread Don Stewart
jon: > On Monday 19 November 2007 22:12, Don Stewart wrote: > > Check the thesis on Frag for a pure approach, or just use StateT IO. > > Has Frag been fixed to work on x86-64? Not that I'm aware of -- it lacks a game head maintainer

Re: [Haskell-cafe] Tetris

2007-11-20 Thread Don Stewart
jeremy.shaw: > At Mon, 19 Nov 2007 21:25:23 +, > Andrew Coppin wrote: > > > > If you were going to implement Tetris in Haskell, how would you do it? > > > > (For that matter, has anybody already *done* it? It would probably make > > a nice example program...) > > A minimal openGL haskell te

Re: [Haskell-cafe] Re: user error when using Text.Regex.PCRE

2007-11-20 Thread Don Stewart
haskell: > Thank you very much for the error report. I have tracked down the cause. > > You are searching against an empty Bytestring. This is now represented by > > > -- | /O(1)/ The empty 'ByteString' > > empty :: ByteString > > empty = PS nullForeignPtr 0 0 > > And while the useAsCString an

Re: [Haskell-cafe] Best way to format a number

2007-11-20 Thread Don Stewart
briqueabraque: > Hi, > > I would like to get a string for a number > using always 2 digits (i.e., 75 would be > "75", 3 would became "03"). What is the > best way to do that? I tried > > printf "%02d\n" 3 > > which gives me the correct string, but > ghci always ends that call with a > > *** Exc

Re: [Haskell-cafe] Re: [Haskell] recursive deriving

2007-11-20 Thread Don Stewart
duncan.coutts: > On Tue, 2007-11-20 at 19:18 -0500, Alex Jacobson wrote: > > When you want automated deriving of show/read etc., you need all the > > components of your type also to be instances of show/read but you won't > > want to *require* them to be automatically generated verions. > > > >

Re: [Haskell-cafe] SingHaskell 2007, November 28 2007

2007-11-20 Thread Don Stewart
Tom.Schrijvers: > > We're pleased to invite you to SingHaskell: > > What is SingHaskell? > > Sing(apore)Haskell is a Haskell (and related languages) meeting in > Singapore. The meeting is organized by Tom Schrijvers and Martin Sulzmann > and will be hosted by the National University of Singapo

Re: [Haskell-cafe] Re: How to abort a computation within Continuation Monad?

2007-11-21 Thread Don Stewart
gleb.alexeev: > Derek Elkins wrote: > > >> As Derek Elkins has written, one of the options is to use delimited > >>continuations, see > >>http://research.microsoft.com/~simonpj/papers/control/ for Haskell > >>implementation. > > > >I made no such suggestion. > > I didn't mean that you suggest

Re: [Haskell-cafe] Re: Over-allocation

2007-11-21 Thread Don Stewart
gracjanpolak: > Ketil Malde ii.uib.no> writes: > > > > Then you get the memory behavior you ask for. Unevaluated strings are > > extremely expensive, something like 12 bytes per char on 32 bit, twice > > that on 64 bits, and then you need GC overhead, etc. ByteStrings are > > much better, but y

Re: [Haskell-cafe] Unix (Posix) low-level device driver functionality?

2007-11-23 Thread Don Stewart
vigalchin: >Hello, > > I am seriously trying to push the mainstream computer industry. I am a >kernel developer for POSIX OS's (e.g. Linux) and Windows. I would at the >very least be able to write "test"/correctness software in Haskell where I >am able to open Unix/Windows dr

Re: [Haskell-cafe] Polymorphic dynamic typing

2007-11-23 Thread Don Stewart
derek.a.elkins: > On Fri, 2007-11-23 at 18:45 +, Paulo Silva wrote: > > Hello, > > > > Type representations using GADTs are being used to achieve dynamic > > typing in Haskell. However, representing polymorphic types is > > problematic. Does anyone know any work about including polymorphis

Re: [Haskell-cafe] Libraries need a new owner

2007-11-25 Thread Don Stewart
ahey: > Hello Folks, > > As some of you will be aware, I have been working on various Map > implementations that currently live here.. > > http://code.haskell.org/collections/collections-ghc6.8 > > The libs in question being Data.Tree.AVL, Data.Trie.General and a few > other bits like Data.COrde

Re: [Haskell-cafe] Libraries need a new owner

2007-11-25 Thread Don Stewart
bernardy: > On Nov 25, 2007 9:23 PM, Don Stewart <[EMAIL PROTECTED]> wrote: > > > > What are the long term goals of the project? To merge key data > > structures into the containers library? > > > > They are a more like a replacement, with (almost) the s

[Haskell-cafe] Announce: strict-concurrency

2007-11-26 Thread Don Stewart
While writing some multi-core concurrent code I needed more precise control over which thread evaluated particular expressions. The default concurrent types, MVar and Chan, are lazy, and sometimes not suitable. The little package, http://hackage.haskell.org/cgi-bin/hackage-scripts/package/st

Re: [Haskell-cafe] Strings and utf-8

2007-11-26 Thread Don Stewart
allbery: > > On Nov 26, 2007, at 19:23 , Maurí cio wrote: > > >Are 'String's in GHC 6.6.1 UTF-8? > > No. > > type String = [Char] > > and Char stores Unicode codepoints. However, the IO system truncates > them to 8 bits. I think there are UTF8 marshaling libraries on > hackage these days

Re: [Haskell-cafe] A tale of three shootout entries

2007-11-26 Thread Don Stewart
s.clover: > In some spare time over the holidays I cooked up three shootout > entries, for Fasta, the Meteor Contest, and Reverse Complement. I Yay! > First up is the meteor-contest entry. > > http://shootout.alioth.debian.org/gp4/benchmark.php? > test=meteor&lang=ghc&id=5 > > This is the

Re: [Haskell-cafe] Waiting for thread to finish

2007-11-27 Thread Don Stewart
briqueabraque: > Hi, > > After I have spawned a thread with > 'forkIO', how can I check if that > thread work has finished already? > Or wait for it? The usual trick I use is to have an MVar that child thread can set when done, causing the main thread to wait: main = do done <- newEmptyMVar

Re: [Haskell-cafe] the ability to talk to POSIX device drivers

2007-11-27 Thread Don Stewart
vigalchin: >Hello, > > I saw somewhere that in one of the Haskell libraries there is support >to open, read, write, ioctl, etc. to POSIX drivers, but I don't see in the >Haskell Report. ?? > Have a look in the 'unix' library. The Haskell report defines the language, not

Re: [Haskell-cafe] A tale of three shootout entries

2007-11-27 Thread Don Stewart
r.kelsall: > Simon Peyton-Jones wrote: > >| Something I found with Dons version on my machine was that if I removed > >| all the exclamation marks and the -fbang-patterns bit at the top it went > >| about 20% faster as well as being much cleaner code, but with my very > >| rudimentary understanding

Re: [Haskell-cafe] Re: Waiting for thread to finish

2007-11-27 Thread Don Stewart
briqueabraque: > >> Hi, > >> > >> After I have spawned a thread with 'forkIO', > >> how can I check if that thread work has > >> finished already? Or wait for it? > >> > > > The best way to do this is using > > Control.Exception.finally: (...) > > > > These techniques are needed because forkIO is

Re: [Haskell-cafe] A tale of Project Euler

2007-11-27 Thread Don Stewart
andrewcoppin: > Hi guys. > > Somebody just introduced me to a thing called "Project Euler". I gather > it's well known around here... > > Anyway, I was a little bit concerned about problem #7. The problem is > basically "figure out what the 10,001st prime number is". Consider the > following t

Re: [Haskell-cafe] cabal-install

2007-11-27 Thread Don Stewart
ben.franksen: > Just thought I install the latest version (0.4.0) from hackage and test it. > Build and install went fine, but then it gets strange: > > [EMAIL PROTECTED]: .../haskell/cabal-install-0.4.0 > sudo runhaskell Setup.lhs > install > Installing: /usr/local/bin > [EMAIL PROTECTED]: .../ha

Re: [Haskell-cafe] Haskell and DB : giving up

2007-11-28 Thread Don Stewart
emmanuel.delaborde: > Hello > > I've spent a few days trying to install all the packages required to > use HaskellDB with either MySQL or SQlite3 > (the only 2 DB the host I was thinking about is supporting) > > Well, I am giving up ! I seriously regret replacing ghc-6.6 with > ghc-6.8, I did

Re: [Haskell-cafe] Downside of -fglasgow-extensions

2007-11-28 Thread Don Stewart
emmanuel.delaborde: > Hello, > > I'm trying to build diverse packages from Hackage with ghc 6.8.1, > they usually fail to build because of missing language extensions. > > Sometimes I am unable to determine the proper name of the extension > missing in .cabal > I tend to slap {- #OPTIONS -fglas

[Haskell-cafe] Working out which library to use (was: Haskell and DB)

2007-11-29 Thread Don Stewart
andrewcoppin: > Ketil Malde wrote: > >I think this is the problem, not the solution. There is a lot of DB > >libraries, just like there are a multitude of XML libraries, several > >collections, etc. Too many libraries are written as research projects > >or by grad students, and left to rot after

Re: [Haskell-cafe] Optimizing cellular automata evaluation (round 2)

2007-11-29 Thread Don Stewart
felipe.lessa: > On Nov 29, 2007 10:31 PM, Justin Bailey <[EMAIL PROTECTED]> wrote: > > I represent the automata as an array of integers, where each bit > > represents a cell. > > Why don't you use an UArray of Bools? They're implemented as bit > arrays internally, AFAIK (e.g. see > http://www.hask

Re: [Haskell-cafe] fast Array operations: foldl, drop

2007-11-30 Thread Don Stewart
lemming: > > On Fri, 30 Nov 2007, Ketil Malde wrote: > > > Bryan O'Sullivan <[EMAIL PROTECTED]> writes: > > > > > For higher dimensions, there are enough options in terms of > > > traversal direction and what exactly e.g. a fold should fold over > > > (single elements? lower-dimensional slices?)

Re: [Haskell-cafe] fast Array operations: foldl, drop

2007-12-02 Thread Don Stewart
rl: > Don Stewart wrote: > > > >I forgot to mention this early, but possibly you could use the ndp array > >library. There are some people using its UArr type for (non parallel) > >strict arrays, that support map/fold/zip et al. > > > >http://darcs.has

[Haskell-cafe] Re: Haskell-Cafe Digest, Vol 51, Issue 180

2007-12-02 Thread Don Stewart
emmanuel.delaborde: > >> > >>I'm trying to build diverse packages from Hackage with ghc 6.8.1, > >>they usually fail to build because of missing language extensions. > >> > >>Sometimes I am unable to determine the proper name of the extension > >>missing in .cabal > >>I tend to slap {- #OPTIONS -fg

Re: [Haskell-cafe] Possible Improvements

2007-12-02 Thread Don Stewart
prstanley: > Hi > data Tree = Leaf Int | Node Tree Int Tree > > occurs :: Int -> Tree -> Bool > occurs m (Leaf n) = m == n > occurs m (Node l n r) = m == n || occurs m l || occurs m r > > It works but I'd like to know if it can be improved in any way. You could probably get away with: data

Re: [Haskell-cafe] Possible Improvements

2007-12-02 Thread Don Stewart
catamorphism: > On 12/2/07, Don Stewart <[EMAIL PROTECTED]> wrote: > > prstanley: > > > Hi > > > data Tree = Leaf Int | Node Tree Int Tree > > > > > > occurs :: Int -> Tree -> Bool > > > occurs m (Leaf n) = m == n > > >

Re: [Haskell-cafe] Possible Improvements

2007-12-02 Thread Don Stewart
> Fully lazy: > > data Tree = Leaf Int | Node Tree Int Tree > > $ time ./A 25 > 49 > ./A 25 18.20s user 0.04s system 99% cpu 18.257 total > ^^ > 3556K heap use. > > Strict in the elements, lazy in the spine: > >

Re: [Haskell-cafe] Possible Improvements

2007-12-02 Thread Don Stewart
dons: > > * Full strictness == teh suckness. > * Mixed lazy and strict == flexible and efficient data types. > > Makes me wonder why Map is strict in the spine, > > data Map k a = Tip > | Bin {-# UNPACK #-} !Size !k a !(Map k a) !(Map k a) > Spencer points out

Re: [Haskell-cafe] Trees

2007-12-02 Thread Don Stewart
aneumann: > Good morning, > > as an exercise for my Algorithms and Programming course I have to > program a couple of simple functions over trees. Until now everything > we did in Java could be done in Haskell (usually much nicer too) > using the naive > > > data Tree a = Leaf a | Node a [T

Re: [Haskell-cafe] A tale of three shootout entries

2007-12-03 Thread Don Stewart
s.clover: >Was this with tossing the partial sums code into the optimised bangs >program? Weird. I wonder if profiling will help explain why? In any case, >If nobody comes up with any other tweaks, I'll probably submit the >optimised bangs version to the shootout this weekend. > P

[Haskell-cafe] Parallelise now! Was: Re: Possible Improvements

2007-12-03 Thread Don Stewart
dons: > Strict in the elements, lazy in the spine: > > data Tree = Leaf !Int | Node Tree !Int Tree > > $ time ./A 25 > 49 > ./A 25 14.41s user 0.03s system 99% cpu 14.442 total > ^^ > 3056K heap use. And, finally, we can

Re: [Haskell-cafe] A tale of three shootout entries

2007-12-03 Thread Don Stewart
andrewcoppin: > Don Stewart wrote: > >Please go ahead and submit. :) and remember to upload also to our wiki, > >so we have a permanent record of the attempt, > > > >http://haskell.org/haskellwiki/Shootout > > > >Note down any ideas you have. &g

Re: [Haskell-cafe] Advice for clean code.

2007-12-03 Thread Don Stewart
stefanor: > On Mon, Dec 03, 2007 at 08:47:48PM -0600, David McBride wrote: > > I am still in the early stages learning haskell, which is my first foray > > into functional programming. Well there's no better way to learn than to > > write something, so I started writing a game. > > > > Mostly th

Re: [Haskell-cafe] Looking for smallest power of 2 >= Integer

2007-12-03 Thread Don Stewart
dpiponi: > On Dec 3, 2007 9:10 PM, Don Stewart <[EMAIL PROTECTED]> wrote: > > > Is there anything in any of the interfaces to Integer that will allow > > > me to quickly find the highest bit set in an Integer? > > Well, you could use testBit, which is pretty effic

Re: [Haskell-cafe] Looking for smallest power of 2 >= Integer

2007-12-03 Thread Don Stewart
dpiponi: > Is there anything in any of the interfaces to Integer that will allow > me to quickly find the highest bit set in an Integer? If not, does > anyone have any recommendations for how to do it efficiently. There > are some obvious things that come to mind but which might involve > quite a b

Re: [Haskell-cafe] Advice for clean code.

2007-12-04 Thread Don Stewart
jules: > Felipe Lessa wrote: > >On Dec 4, 2007 1:28 AM, Don Stewart <[EMAIL PROTECTED]> wrote: > >>-- How to display results > >>instance Show Action where > >>show MoveOutOfBounds= "Sorry you can't move in that > &

Re: [Haskell-cafe] Looking for largest power of 2 <= Integer

2007-12-04 Thread Don Stewart
dpiponi: > On Dec 3, 2007 10:05 PM, David Benbennick <[EMAIL PROTECTED]> wrote: > > > Could you please post your code here when you're done? I'd be > > interested to see the final result. > > This is just experimental code I'm playing with in order to implement > exact real arithmetic, so there'

Re: [Haskell-cafe] Looking for largest power of 2 <= Integer

2007-12-04 Thread Don Stewart
dbenbenn: > On Dec 4, 2007 11:51 AM, Don Stewart <[EMAIL PROTECTED]> wrote: > > Awesome. We can use this in Data.Bits, if you've got some QuickChecks > > for it. > > Hear hear. But is there any way to just make the compiler use > fastTestBit in place of test

[Haskell-cafe] Re: who are the contributors to the Unix package?

2007-12-06 Thread Don Stewart
vigalchin: >Hello, > > Who started this effort? Who is currently doing work on the Unix >package? > >Kind regards, Vasya It is maintained by [EMAIL PROTECTED] ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.has

[Haskell-cafe] Announce: PDXFunc: Portland FP Users Group

2007-12-06 Thread Don Stewart
Who: Portland Functional Programmers Group Web: http://groups.google.com/group/pdxfunc Time and location: Monday, December 10th, 7pm at CubeSpace, 622 SE Grand, Portland, OR 97214. Directions: http://www.cubespacepdx.com/directions Topic Functional concurrency with

Re: [Haskell-cafe] Re: Over-allocation

2007-12-08 Thread Don Stewart
gracjanpolak: > Gracjan Polak gmail.com> writes: > > > > > Don Stewart galois.com> writes: > > > > > > ByteStrings have all the same operations as lists though, so you can > > > index, compare and take substrings, with the benefit that he

[Haskell-cafe] ANNOUNCE: xmonad 0.5: a tiling window manager

2007-12-09 Thread Don Stewart
and writing extensions see the webpage. The library of extensions is available from hackage: http://hackage.haskell.org/cgi-bin/hackage-scripts/package/xmonad-contrib Brought to you by the xmonad team: Spencer Janssen Don Stewart Jason Creighton Andrea Rossato David

<    1   2   3   4   5   6   7   8   9   10   >