RE: optimization question

2004-02-23 Thread Simon Peyton-Jones
The trouble is that you probably *don't* want to expand this case x of { foogle - e1; _ - e2 } to this case x of c1:x1 - case c1 of 'f' - case x1 of c2:x2 - case c2 of 'o' - of So GHC generates a

Re: ghc and signal processing

2004-02-23 Thread MR K P SCHUPKE
b - mapArray id a The reason it is slow is because the array type is copied every time a member is assigned. There are two solutions: 1) Use a mutable-array in the StateMonad then freeze it. 2) In this particular case where processing is sequential (IE you are only altering values based on

Array optimisation...

2004-02-23 Thread MR K P SCHUPKE
Was just thinking about GHC's implementation of arrays, and their poor performance. I know little about GHC's internal workings, but I was thinking about how array performance could be improved. What if when writing an array you instead construct a function: f :: (Ix x,Ix y) = Array a - Ix x -

Re: Array optimisation...

2004-02-23 Thread Josef Svenningsson
On Mon, 23 Feb 2004, MR K P SCHUPKE wrote: Was just thinking about GHC's implementation of arrays, and their poor performance. I know little about GHC's internal workings, but I was thinking about how array performance could be improved. What if when writing an array you instead construct a

Re: ghc and signal processing

2004-02-23 Thread Wolfgang Thaller
On 23.02.2004, at 13:32, MR K P SCHUPKE wrote: b - mapArray id a The reason it is slow is because the array type is copied every time a member is assigned. The array in question is already a mutable array, and even for non-mutable arrays, mapArray would use mutable arrays internally. The

Re: GC behaviour in GHC

2004-02-23 Thread Andrew Cheadle
Nivia, Don has mentioned most of the documentation about GC work in GHC except for: Generational garbage collection for Haskell - Sansom, Peyton Jones http://citeseer.nj.nec.com/sansom93generational.html There isn't really a paper on the performance of GHC's current generational /

Re: GC behaviour in GHC

2004-02-23 Thread Carsten Schultz
On Sat, Feb 21, 2004 at 08:43:56PM -0300, Nivia Q. wrote: I'm a Computational Engineering student in the University of Pernambuco (Brazil). In my research, I'm working with applications written in Haskell , where time is a critical factor. But there is a pretty high GC overhead I can't

Re: optimization question

2004-02-23 Thread Max Kirillov
On Sun, Feb 22, 2004 at 12:20:35AM -0800, John Meacham wrote: case x of foo - Foo bar - Bar fuzz - Fuzz fuzo - Fuzo x - other .. thing The reason I ask is I am writing someting which will generate large case statements like the first form and want

Re: optimization question

2004-02-23 Thread Lennart Augustsson
Simon Peyton-Jones wrote: generate case expressions when there is more than one string in the list, otherwise use an equality test Oh, you mean like hbc does? ;-) Sorry, couldn't resist. -- Lennart ___ Glasgow-haskell-users mailing list

RE: optimization question

2004-02-23 Thread Hal Daume III
I have some numbers on this. I have a list of first names for males from the census data. I have a function 'male :: String - Maybe Double' which returns (maybe) the probability of a person being given that name. I have two versions, one based on string matching, the other based on building

Re: optimization question

2004-02-23 Thread Peter Simons
Max Kirillov writes: [...] I will generate large case statements like the first form and want to know if I should bother pre-optimizing it to the second. I suppose such things should be made by flex-style generators. If you don't mind using FFI, the tool of choice would probably be

Hugs98 - GHC

2004-02-23 Thread gaby82
Hi, I've an application in Hugs98 and i've to integrate it with another application using GHC. I don´t know how to do this. I tried to compiled the hugs98 application using GHC but i couldn´t Another question: can i compiled many hs at the same time? Thanks a lot Gabriela

Re: ghc and signal processing

2004-02-23 Thread Mike Gunter
Hmmm. With -O2 on GHC 6.2, I get 0.177s, 0.217s, and 0.348s for your three Haskell examples and 0.187s (with gcc -O2) for your C example. The output of -ddump-simpl for the looks perfect for the second Haskell example. My GHC seems to be doing a bang-up job here. What's wrong with yours? (For

Re: ghc and signal processing

2004-02-23 Thread Jeremy Shaw
Hrm, I am going to do some new test tonight. I think my test environment may have been bad... Jeremy Shaw. At Mon, 23 Feb 2004 13:37:45 -0800, Mike Gunter wrote: Hmmm. With -O2 on GHC 6.2, I get 0.177s, 0.217s, and 0.348s for your three Haskell examples and 0.187s (with gcc -O2) for

RE: optimization question

2004-02-23 Thread ajb
G'day. Quoting Hal Daume III [EMAIL PROTECTED]: Finally, I implemented a version which reads data into a finitemap. I'd be curious about the relative performance in using a ternary search trie: http://cvs.sourceforge.net/viewcvs.py/hfl/hfl/edison/Assoc/ Cheers, Andrew Bromage

Re: optimization question

2004-02-23 Thread ajb
G'day all. Quoting Peter Simons [EMAIL PROTECTED]: If you don't mind using FFI, the tool of choice would probably be http://www.gnu.org/software/gperf/. Perfect hash functions are actually not that much better than imperfect hash functions for the case where you have keys to search for which

Re: ghc and signal processing

2004-02-23 Thread Jeremy Shaw
Hrm, Okay, it seems that my problems maybe be due to using ghc 6.3. Here are the results of running test under different compiler versions (see end of message for code): Athlon 600MHz + FreeBSD + GHC 6.0.1 real0m0.414s user0m0.361s sys 0m0.016s Athlon 600MHz + FreeBSD + GHC 6.3

[Haskell] Re: Impredicative Types?

2004-02-23 Thread Ben Rudiak-Gould
On Wed, 18 Feb 2004, Daan Leijen wrote: choose :: a - a - a choose x y = x What is the type of choose id if your system is impredicative? Either forall a. (a - a) - (a - a) or (forall a. a-a) - (forall a. a-a) Note that neither of these types subsumes the other. This is bad, but it

[Haskell] Re: graphs and trees again

2004-02-23 Thread Jeremy Gibbons
I've been catching up on things I meant to reply to weeks ago. BTW, do you have any uses for [upwards and downwards accumulations on trees]? I use flattenTree $ downAccuTree (flip (:)) [] $ spanningTree vertex graph to get paths from a graph vertex to every reachable vertex

Re: [Haskell] Re: Impredicative Types?

2004-02-23 Thread Johannes Waldmann
Ben Rudiak-Gould wrote: ... we can't even determine the meaning of a correct program without looking at explicit type signatures. So what? Can we do this in other languages? Do we want it? I think not. The Haskell design (of type inference rather than type checking) has the strange feeling of our

Re: [Haskell] Compiling HXmlToolbox-3.01 on Mac OS X

2004-02-23 Thread Graham Klyne
I'm not a MAC user, but I've been trying to get HXML Toolbox running under Windows, with some limited success. It's possible that some of my comments may provide pointers, so I'll see if I can manage a bit of list-archeology... + One big issue I had was the Regexp library, which was used for

Re: [Haskell] CVS access library in Haskell?

2004-02-23 Thread Graham Klyne
This sounds to me like a candidate for POpen, which is available under Unix and firends, but not (yet) fully under Windows. (I'm nibbling at that, slowly.) (The POpen module allows one to run an external command-line utility, and connect Haskell file streams (terminology?) to the program's

[Haskell] Announce: wxHaskell 0.6

2004-02-23 Thread Daan Leijen
Announcement: wxHaskell version 0.6 -- http://wxhaskell.sourceforge.net This new release fixes many bugs, adds basic support for MDI applications and compiles with the latest CVS snapshots of wxWidgets. For now, only an installer

Re: [Haskell] Re: Impredicative Types?

2004-02-23 Thread Conor McBride
Hi Ben Rudiak-Gould wrote: ... we can't even determine the meaning of a correct program without looking at explicit type signatures. Johannes Waldmann wrote: So what? Can we do this in other languages? Do we want it? I think not. The Haskell design (of type inference rather than

Re: [Haskell] Announce: wxHaskell 0.6

2004-02-23 Thread Axel Simon
On Mon, Feb 23, 2004 at 01:33:38PM +0100, Daan Leijen wrote: Announcement: wxHaskell version 0.6 -- Tested on: - windowsXP and windows 2000 with ghc 6.2, 6.0.1, and wxMSW 2.4.2 - MacOS X 10.3 (Panther) with ghc 6.2 and wxMAC

RE: [Haskell] exists keyword and existential types

2004-02-23 Thread Simon Peyton-Jones
| I find myself confused by the lack of an exists quantifier to complement | forall. It imposes seemingly arbitrary restrictions on the ways in which | types can be expressed, and makes some seemingly harmless (and useful) | types entirely inexpressible. | | For example, it seems as though runST

Re: [Haskell] Compiling HXmlToolbox-3.01 on Mac OS X

2004-02-23 Thread Sachin Desai
I've found that if I modify the Makefile and include -ipath-to-md5-directory everything compiles and links fine. I did however have to make a small change to MD5.lhs removing the then clause. I don't believe this was correct but nevertheless it does compile and programs run. #ifdef

RE: [Haskell] GHC Core backend

2004-02-23 Thread Simon Peyton-Jones
I don't see why it should be hard to use GHC's back end in this way. GHC's core language is pretty stable. I don't find the external representation of Core very appealing, but it's really meant for computers not people. An important constraint is that Core is *typed*, so you'd need a front end

[Haskell] regular expression syntax - perl ain't got nothin on haskell

2004-02-23 Thread John Meacham
Inspired by an idea by Andrew Pang and an old project of mine, I decided to fill out a reusable regular expression library which is similar to Perl's, but much more expressive. It provides regular and monadic versions, a very overloaded and useful interface, as well as extensibility. although

Re: [Haskell] regular expression syntax - perl ain't got nothin on haskell

2004-02-23 Thread John Meacham
Excuse me, I meant Andre Pang. not Andrew Pang. It's not enough I steal his good idea, but then I get his name wrong. :) John -- --- John Meacham - California Institute of Technology, Alum. - [EMAIL PROTECTED]

[Haskell-cafe] Perl-ish =~ operator

2004-02-23 Thread ozone
In my effort to turn Haskell into a language more like Perl (muahaha)[1], I got a bit fed up and implemented something like Perl 5's =~ binding operator (a.k.a. regex operator); I thought maybe somebody else here might find it useful. Perl has the concept of 'contexts': a function does

[Haskell-cafe] Re: Perl-ish =~ operator

2004-02-23 Thread ozone
On 24/02/2004, at 1:30 AM, Andre Pang wrote: In my effort to turn Haskell into a language more like Perl (muahaha)[1], I got a bit fed up and implemented something like Perl 5's =~ binding operator (a.k.a. regex operator); I thought maybe somebody else here might find it useful. Perl has the

Re: [Haskell-cafe] Perl-ish =~ operator

2004-02-23 Thread Mark Carroll
On Tue, 24 Feb 2004 [EMAIL PROTECTED] wrote: In my effort to turn Haskell into a language more like Perl (muahaha)[1], I got a bit fed up and implemented something like Perl 5's =~ binding operator (a.k.a. regex operator); I thought maybe (snip) This reminds me that one thing I do miss from

Re: [Haskell-cafe] Perl-ish =~ operator

2004-02-23 Thread John Meacham
On Mon, Feb 23, 2004 at 12:09:12PM -0500, Mark Carroll wrote: On Tue, 24 Feb 2004 [EMAIL PROTECTED] wrote: In my effort to turn Haskell into a language more like Perl (muahaha)[1], I got a bit fed up and implemented something like Perl 5's =~ binding operator (a.k.a. regex operator); I

Re: [Haskell-cafe] Perl-ish =~ operator

2004-02-23 Thread Mark Carroll
On Mon, 23 Feb 2004, John Meacham wrote: (snip) a standard pcre (pcre.org) binding would also be a cool thing to work on. (snip) Heh - maybe a Cambridge computer science student could do it, having both PCRE's author and Haskell experts handy locally. (-: -- Mark

Re: [Haskell-cafe] Perl-ish =~ operator

2004-02-23 Thread ozone
On 24/02/2004, at 1:30 AM, [EMAIL PROTECTED] wrote: In my effort to turn Haskell into a language more like Perl (muahaha)[1], I got a bit fed up and implemented something like Perl 5's =~ binding operator (a.k.a. regex operator); I thought maybe somebody else here might find it useful. Perl