[Haskell-cafe] Re: hmatrix

2008-06-03 Thread Alberto Ruiz
Anatoly Yakovenko wrote: do you have any plans to provide an interface for inplace updates? Yes, I will try to write a simple version of Data.Array.ST... I can try to help you, although I still dont quite grok monads. Wouldn't it be more efficient to use StorableArray, so you can cast from

Re: [Haskell-cafe] Re: hmatrix

2008-06-03 Thread Bulat Ziganshin
Hello Alberto, Tuesday, June 3, 2008, 11:27:54 AM, you wrote: Yes, I will try to write a simple version of Data.Array.ST... That's right, the correspondence with StorableArray is direct, and efficient conversion can be easily added to the library. I mentioned the idea of Data.Array.ST to

Re: [Haskell-cafe] Re: hmatrix

2008-06-03 Thread Alberto Ruiz
Bulat Ziganshin wrote: Hello Alberto, Tuesday, June 3, 2008, 11:27:54 AM, you wrote: Yes, I will try to write a simple version of Data.Array.ST... That's right, the correspondence with StorableArray is direct, and efficient conversion can be easily added to the library. I mentioned the idea

Re: [Haskell-cafe] ghc 6.8.2 issue

2008-06-03 Thread Duncan Coutts
On Mon, 2008-06-02 at 23:11 -0500, Galchin, Vasili wrote: at this point rebuild and install the unix package ... [EMAIL PROTECTED]:~/FTP/Haskell/bytestring-mmap-0.2.0$ runhaskell Setup.lhs clean cleaning... [EMAIL PROTECTED]:~/FTP/Haskell/bytestring-mmap-0.2.0$ runhaskell Setup.lhs

Re: [Haskell-cafe] [ANN] bloomfilter 1.0 - Fast immutable and mutable Bloom filters

2008-06-03 Thread Ketil Malde
Thomas Hartman [EMAIL PROTECTED] writes: What kind of speed do you get on your laptop for Data.Set? How much faster is the bloom filter? I tried to modify examples/Words.hs to use Data.Set insted. The results look like this (first Bloom, second Data.Set, both compiled with -O2):

Re: [Haskell-cafe] ghc 6.8.2 issue

2008-06-03 Thread Duncan Coutts
On Tue, 2008-06-03 at 00:04 -0500, Galchin, Vasili wrote: Duncan, By installing localling, I runhaskell Setup.hs configure --prefix=$HOME plus add local path to LD_LIBRARY_PATH and LD_RUN_PATH? On Linux, does ghc use .so's or is it linked statically? ghc is linked statically but when

[Haskell-cafe] Re: appending an element to a list

2008-06-03 Thread apfelmus
Abhay Parvate wrote: I somehow thought it would be easy to talk about complexity of calculating individual elements in an infinite list should be sufficient, but that seems to be involved, and my over-generalization doesn't seem to work. Thanks for the link; particularly it has reference to

Re[2]: [Haskell-cafe] Re: hmatrix

2008-06-03 Thread Bulat Ziganshin
Hello Alberto, Tuesday, June 3, 2008, 12:56:50 PM, you wrote: Good! So you can easily hide the IO operations in the ST monad. I will definitely look into it. from implementation POV ST monad is nothing but renamed IO monad which exports only subset of its operations which are guaranteed to

Re: [Haskell-cafe] Rotating backdrop (aka learning Haskell)

2008-06-03 Thread Yann Golanski
First version is available at: http://www.kierun.org/backdropper-1.0.tbz2 It is minimal but does the trick of randomly rotating backgrounds. Features to add are only rotate during work hours, making sure that all images are shown within a day and a nice GUI. Criticism welcome. -- [EMAIL

Re: [Haskell-cafe] Implementing ParseChart with Data.Map

2008-06-03 Thread Krasimir Angelov
I actually made my own copy of Data.Map and added an extra: alterLookúp :: Ord k = (Maybe a - (b,Maybe a)) - k - Map k a - (b,Map k a) function. I also changed my data type to: type ParseChart k v = Map k (Map v ()) so I don't have to copy the Data.Set module also. Unfortunately this doesn't

Re: [Haskell-cafe] Implementing ParseChart with Data.Map

2008-06-03 Thread Yitzchak Gale
Krasimir Angelov wrote: but notice that the set is still traversed twice. Neil Mitchell wrote: I don't see any way of reducing that Yeah, it looks like the Data.Set (and Data.IntSet) library is missing the functions insertMember :: Ord a = a - Set a - (Bool, Set a) deleteMember :: Ord a = a -

Re: [Haskell-cafe] Implementing ParseChart with Data.Map

2008-06-03 Thread Adrian Hey
Hello Krasimir, Krasimir Angelov wrote: Hi, I have to write ParseChart implementation with Data.Map/Set. The chart is type like this: type Chart k v = Map k (Set v) now I need operation like: insert :: k - v - Chart k v - Maybe (Chart k v) where the result is (Just _) if the (k,v) is

RE: [Haskell-cafe] hs-plugins compile error

2008-06-03 Thread John O'Donnell
Hi, What is the status of hs-plugins? I recently tried to install the version plugins-1.2 on hackage, using a Gnu/Linux box with Fedora 9 and ghc-6.8.2, but didn't get past the configure stage (see config.log below). The installation script is invoking gcc with a -V command line argument but

Re: [Haskell-cafe] [ANNOUNCE] git-darcs-import 0.1

2008-06-03 Thread Loup Vaillant
2008/6/3 Darrin Thompson [EMAIL PROTECTED]: On Sun, Jun 1, 2008 at 2:44 PM, Bertram Felgenhauer [EMAIL PROTECTED] wrote: Hi, I'm pleased to announce yet another tool for importing darcs repositories to git. Unlike darcs2git [1] and darcs-to-git [2], it's written in Haskell, on top of the

Re: [Haskell-cafe] hs-plugins compile error

2008-06-03 Thread Edsko de Vries
On Tue, Jun 03, 2008 at 03:07:33PM +0100, John O'Donnell wrote: Hi, What is the status of hs-plugins? I recently tried to install the version plugins-1.2 on hackage, using a Gnu/Linux box with Fedora 9 and ghc-6.8.2, but didn't get past the configure stage (see config.log below). The

Re: [Haskell-cafe] [ANNOUNCE] git-darcs-import 0.1

2008-06-03 Thread Darrin Thompson
On Sun, Jun 1, 2008 at 2:44 PM, Bertram Felgenhauer [EMAIL PROTECTED] wrote: Hi, I'm pleased to announce yet another tool for importing darcs repositories to git. Unlike darcs2git [1] and darcs-to-git [2], it's written in Haskell, on top of the darcs2 source code. The result is a much faster

RE: [Haskell-cafe] hs-plugins compile error

2008-06-03 Thread John O'Donnell
Thanks, Edsko. My version of gcc is 4.3.0. It may well be that some other piece of software in the Fedora 9 distribution is incompatible with the hs-plugins installation script. Has anyone installed hs-plugins on Fedora? I was able to get it to compile on Fedora 4, using ghc-6.4, two or three

[Haskell-cafe] Rewrite class with fundeps in pure h98?

2008-06-03 Thread Darrin Thompson
I thought that I should be able to write something like the toHtml function below with pure H98, but when I went to write it I ended up needing fundeps. Is there a way to express this without using any extensions? The idea was to take a remotely Dom-like tree and flatten it into a string, but not

Re: [Haskell-cafe] Implementing ParseChart with Data.Map

2008-06-03 Thread Isaac Dupree
Duncan Coutts wrote: modify :: k - Map k e - (e, Maybe e - Map k e) so it's a lookup that returns the element at k and also a continuation that lets you rebuild a new map with an altered element. I guess that doesn't account for the element not existing. There's probably a generalisation that

Re: [Haskell-cafe] ANN (2 Libs) -- hvac 0.1b, a lightweight web framework and HStringTemplate 0.3

2008-06-03 Thread Thomas Hartman
I just tried out hvac. I was trying to run the hvac examples after following the readme in the samples directory. sudo lighttpd -D -f lh.conf [sudo] password for thartman: 2008-06-03 09:30:02: (log.c.75) server started so that's okay, but http://localhost:3000/hvac-board/board/1 in firefox

[Haskell-cafe] Re: Rewrite class with fundeps in pure h98?

2008-06-03 Thread apfelmus
Darrin Thompson wrote: I thought that I should be able to write something like the toHtml function below with pure H98, but when I went to write it I ended up needing fundeps. Is there a way to express this without using any extensions? The idea was to take a remotely Dom-like tree and flatten

Re: [Haskell-cafe] What is the maturity of Haskell Web Frameworks

2008-06-03 Thread Thomas Hartman
Note however that hpaste runs off an earlier version of HAppS, which has changed radically from v8 to v9. I seem to remember discussion of porting hpaste to the latest HAppS as a demo app... are there still plans to do that? Thomas. 2008/6/2 Don Stewart [EMAIL PROTECTED]: aditya_siram: I am

Re: [Haskell-cafe] What is the maturity of Haskell Web Frameworks

2008-06-03 Thread Thomas Hartman
note to the curious that this is a git and not a darcs repo git clone http://code.haskell.org/hpaste.git thomas. 2008/6/3 Don Stewart [EMAIL PROTECTED]: A new version of happs was written on a Monday a couple of months ago, using fastcgi and takusen. We're running it at galois, and you can

[Haskell-cafe] More on performance

2008-06-03 Thread Don Stewart
I wrote up the second part of the tour of understanding low level performance in GHC here, http://reddit.com/r/programming/info/6lx36/comments/ Follows on from the discussion last week about various performance related things. Enjoy. -- Don ___

[Haskell-cafe] Re: [ANNOUNCE] git-darcs-import 0.1

2008-06-03 Thread Aaron Denney
On 2008-06-03, Peter Hercek [EMAIL PROTECTED] wrote: Loup Vaillant wrote: 2008/6/3 Darrin Thompson [EMAIL PROTECTED]: --cut-- What's the appeal of this? I personally love git, but I thought all the cool kids at this school used darcs and that was that. Disclaimer: I'm no expert, this is

Re: [Haskell-cafe] What is the maturity of Haskell Web Frameworks

2008-06-03 Thread Don Stewart
Ah yes, the url was incorrect. Well spotted. tphyahoo: note to the curious that this is a git and not a darcs repo git clone http://code.haskell.org/hpaste.git thomas. 2008/6/3 Don Stewart [EMAIL PROTECTED]: A new version of happs was written on a Monday a couple of months ago,

Re: [Haskell-cafe] What is the maturity of Haskell Web Frameworks

2008-06-03 Thread Don Stewart
A new version of happs was written on a Monday a couple of months ago, using fastcgi and takusen. We're running it at galois, and you can find the code on code.haskell.org/hpaste. So not quite what you wanted, but another data point. -- Don tphyahoo: Note however that hpaste runs off an earlier

[Haskell-cafe] Re: type-level integers using type families

2008-06-03 Thread Alfonso Acosta
On Thu, May 29, 2008 at 5:15 AM, Peter Gavin [EMAIL PROTECTED] wrote: Has anyone else tried implementing type-level integers using type families? When I started to work on thetype-level and parameterized data packages, I considered using type-families and GADTs, but I found quite a few problems

Re: [Haskell-cafe] Re: Rewrite class with fundeps in pure h98?

2008-06-03 Thread Sterling Clover
This was how it was originally done in HStringTemplate, as I recall. The mptcs were introduced in order to maintain lookup-maps of the correct type, and particularly to allow embedding of templates within one another. There may have been some other corner-cases involved as well. However,

Re: [Haskell-cafe] ANN (2 Libs) -- hvac 0.1b, a lightweight web framework and HStringTemplate 0.3

2008-06-03 Thread Sterling Clover
Probably best not to keep this discussion in -cafe after this, as this is more of a debugging-type issue, but in my experience, I bet the lighttpd server is trying to serve the hvac-board fcgi file directly as a binary, rather than launching it as a fastcgi instance at all. The

[Haskell-cafe] Re: [ANNOUNCE] git-darcs-import 0.1

2008-06-03 Thread Peter Hercek
Aaron Denney wrote: On 2008-06-03, Peter Hercek [EMAIL PROTECTED] wrote: Loup Vaillant wrote: 2008/6/3 Darrin Thompson [EMAIL PROTECTED]: --cut-- What's the appeal of this? I personally love git, but I thought all the cool kids at this school used darcs and that was that. Disclaimer: I'm no

[Haskell-cafe] HDBC-odbc 1.1.4.4 fixes Windows linking problems

2008-06-03 Thread John Goerzen
Hi, HDBC-odbc version 1.1.4.4 has been uploaded to Hackage. It fixes the problems some here have encountered regarding ODBC crashes or other similar odd behavior on Windows. Thanks to Andrew Appleyard for tracking down the problem and sending me a patch. The detailed explanation, if you're

Re: [Haskell-cafe] ghc 6.8.2 issue

2008-06-03 Thread Galchin, Vasili
Something like that yes. You're running runhaskell Setup.lhs and that loads and runs code from the Cabal library. The Cabal library depends on the process library which depends on the unix library. So by replacing the same version of the unix package you're breaking everything else which

[Haskell-cafe] Re: [ANNOUNCE] git-darcs-import 0.1

2008-06-03 Thread Aaron Denney
This is drifting off-topic, but... On 2008-06-03, Peter Hercek [EMAIL PROTECTED] wrote: Aaron Denney wrote: On 2008-06-03, Peter Hercek [EMAIL PROTECTED] wrote: Loup Vaillant wrote: 2008/6/3 Darrin Thompson [EMAIL PROTECTED]: --cut-- What's the appeal of this? I personally love git, but I

Re: [Haskell-cafe] Re: appending an element to a list

2008-06-03 Thread Ronald Guida
Thank you, apfelmus. That was a wonderful explanation; the debit method in [1] finally makes sense. [1]: Chris Okasaki. Purely Function Data Structures. http://www.cs.cmu.edu/~rwh/theses/okasaki.pdf ___ Haskell-Cafe mailing list

[Haskell-cafe] Laziness leaks

2008-06-03 Thread Ronald Guida
I was looking at the real time queues in [1] and I wanted to see what would happen if I tried to write one in Haskell. The easy part was translating the real time queue from [1], p43 into Haskell. The hard part is testing to see if the rotations really happen what they should. Basically, I

Re: [Haskell-cafe] hs-plugins compile error

2008-06-03 Thread Timo B. Hübel
What is the status of hs-plugins? I recently tried to install the version plugins-1.2 on hackage, using a Gnu/Linux box with Fedora 9 and ghc-6.8.2, but didn't get past the configure stage (see config.log below). I am getting exactly the same error on a Gentoo box. I've tracked it down to

Re: [Haskell-cafe] ghc 6.8.2 issue

2008-06-03 Thread Brandon S. Allbery KF8NH
On 2008 Jun 3, at 16:40, Galchin, Vasili wrote: 1) How do I get the local package.conf built and populated? 2) How do I get a test case to link against this experimental local version of unix? Is there a --prefix or something like that I pass on runhaskell Setup.hs build? both

Re: [Haskell-cafe] What is the maturity of Haskell Web Frameworks

2008-06-03 Thread Duncan Coutts
On Tue, 2008-06-03 at 10:23 -0700, Don Stewart wrote: A new version of happs was written on a Monday a couple of months ago, using fastcgi and takusen. We're running it at galois, and you can find the code on code.haskell.org/hpaste. So not quite what you wanted, but another data point.

[Haskell-cafe] Re: [ANN] bloomfilter 1.0 - Fast immutable and mutable Bloom filters

2008-06-03 Thread Scott Cruzen
* Jim Snow [EMAIL PROTECTED] [080531 15:23]: Without looking at the code to verify that this is how it has really been implemented, a bloom filter is like a series of hash tables, where the hash table entries are one bit. The bit is set if there is an item that hashes to that value in

Re: [Haskell-cafe] Laziness leaks

2008-06-03 Thread Albert Y. C. Lai
Ronald Guida wrote: I was looking at the real time queues in [1] and I wanted to see what would happen if I tried to write one in Haskell. The easy part was translating the real time queue from [1], p43 into Haskell. The hard part is testing to see if the rotations really happen what they

[Haskell-cafe] A simple beginner question

2008-06-03 Thread Adam Smyczek
Example: data SampleType = A | B Int | C String | D -- etc. sampleTypes = [A, B 5, C test] :: [SampleType] How do I find for example element A in the sampleTypes list? Do I have to create e.g.: isA :: SampleType - Bool isA A = True isA _ = False for every constructor and use find? It

Re: [Haskell-cafe] Laziness leaks

2008-06-03 Thread Ronald Guida
Don Stewart wrote: 2. Is there any way to systematically search for or detect laziness leaks? Profiling, and looking at the Core. Being explicit about the evaluation strategy you want is a fine idea though. Albert Y. C. Lai wrote A true cause of laziness is in accumulating a chain of

Re: [Haskell-cafe] More on performance

2008-06-03 Thread Ryan Ingram
I think it's hard to overstate how awesome the RULES pragma is. Thanks for the example. -- ryan On 6/3/08, Don Stewart [EMAIL PROTECTED] wrote: I wrote up the second part of the tour of understanding low level performance in GHC here,

Re: [Haskell-cafe] A simple beginner question

2008-06-03 Thread Philip Weaver
On Tue, Jun 3, 2008 at 5:11 PM, Adam Smyczek [EMAIL PROTECTED] wrote: Example: data SampleType = A | B Int | C String | D -- etc. sampleTypes = [A, B 5, C test] :: [SampleType] How do I find for example element A in the sampleTypes list? Do I have to create e.g.: isA :: SampleType -

Re: [Haskell-cafe] A simple beginner question

2008-06-03 Thread Ronald Guida
Adam Smyczek wrote: data SampleType = A | B Int | C String | D -- etc. sampleTypes = [A, B 5, C test] :: [SampleType] How do I find for example element A in the sampleTypes list? Here's one way to do it: filter (\x - case x of A - True; otherwise - False) sampleTypes == [A] filter

[Haskell-cafe] Re: A simple beginner question

2008-06-03 Thread Achim Schneider
Adam Smyczek [EMAIL PROTECTED] wrote: data SampleType = A | B Int | C String | D -- etc. deriving (Eq) sampleTypes = [A, B 5, C test] :: [SampleType] If you derive from Eq, you can do isA = (==) A filter isA sampleTypes or ad-hoc: filter ((==) A) sampleTypes things like

[Haskell-cafe] Re: A simple beginner question

2008-06-03 Thread Achim Schneider
Achim Schneider [EMAIL PROTECTED] wrote: filter (\x - case x of { A - True ; B b | b 2 - True ; C c | c == foo - True ; _ - False}) sampleTypes coming to think of it: Why can't I write filter (\A - True \B b | b 2 - True \C c | c == foo - True

Re: [Haskell-cafe] Laziness leaks

2008-06-03 Thread Derek Elkins
On Tue, 2008-06-03 at 20:12 -0400, Ronald Guida wrote: Don Stewart wrote: 2. Is there any way to systematically search for or detect laziness leaks? Profiling, and looking at the Core. Being explicit about the evaluation strategy you want is a fine idea though. Albert Y. C. Lai

Re: [Haskell-cafe] A simple beginner question

2008-06-03 Thread Dan Weston
There's always one more way to do things in Haskell! :) Here's yet another way to get at the payloads in a list. You don't have to know how this works to use it: data SampleType = A | B Int | C String unA :: SampleType - [()] unA A = return () unA _ = fail Not an A unB :: SampleType

[Haskell-cafe] Re: A simple beginner question

2008-06-03 Thread Achim Schneider
Dan Weston [EMAIL PROTECTED] wrote: There's always one more way to do things in Haskell! :) Here's yet another way to get at the payloads in a list. You don't have to know how this works to use it: Bastard. He's going to try and find out how it works. To get back to the filters: module

Re: [Haskell-cafe] HDBC-odbc 1.1.4.4 fixes Windows linking problems

2008-06-03 Thread Greg Matheson
On Tue, 03 Jun 2008, John Goerzen wrote: Hi, HDBC-odbc version 1.1.4.4 has been uploaded to Hackage. It fixes the problems some here have encountered regarding ODBC crashes or other similar odd behavior on Windows. I'm getting a 'Parse error in pattern' error. C:\Documents and

Re: [Haskell-cafe] HDBC-odbc 1.1.4.4 fixes Windows linking problems

2008-06-03 Thread Andrew Appleyard
On 4/06/2008 1:05 PM, Greg Matheson wrote: I'm getting a 'Parse error in pattern' error. C:\Documents and Settings\Administratorghci GHCi, version 6.8.2: http://www.haskell.org/ghc/ :? for help Loading package base ... linking ... done. Prelude :m Database.HDBC.ODBC Database.HDBC [...] Prelude

Re: [Haskell-cafe] A simple beginner question

2008-06-03 Thread Don Stewart
adam.smyczek: Example: data SampleType = A | B Int | C String | D -- etc. sampleTypes = [A, B 5, C test] :: [SampleType] How do I find for example element A in the sampleTypes list? Do I have to create e.g.: isA :: SampleType - Bool isA A = True isA _ = False for every

Re: [Haskell-cafe] A simple beginner question

2008-06-03 Thread Luke Palmer
On Tue, Jun 3, 2008 at 6:48 PM, Ronald Guida [EMAIL PROTECTED] wrote: filter (\x - case x of A - True; otherwise - False) sampleTypes == [A] filter (\x - case x of B _ - True; otherwise - False) sampleTypes == [B 5] There's a neat little mini-trick for these types of pattern matches:

Re: [Haskell-cafe] [ANNOUNCE] git-darcs-import 0.1

2008-06-03 Thread Bertram Felgenhauer
Darrin Thompson wrote: On Sun, Jun 1, 2008 at 2:44 PM, Bertram Felgenhauer [EMAIL PROTECTED] wrote: I'm pleased to announce yet another tool for importing darcs repositories to git. [...] What's the appeal of this? I personally love git, but I thought all the cool kids at this school used