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
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
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 -
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
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
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 /
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
| 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
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
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
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
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]
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
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
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
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
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
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
36 matches
Mail list logo