Hi,
I am looking for help in design of a stateful tree walker. I have a tree-like
data structure (an AST for a small language) for which there is a general
stateful walk procedure. That is, each node type is an instance of a walker
class, and the walk function is monadic:
class Walker a where
On Mon, Feb 19, 2007 at 08:47:39AM +0100, Mikael Johansson wrote:
On Sun, 18 Feb 2007, Yitzchak Gale wrote:
Besides memoizing, you might want to use the fact
that:
fib (2*k) == (fib (k+1))^2 - (fib (k-1))^2
fib (2*k-1) == (fib k)^2 + (fib (k-1))^2
Or, you know, go straight to the
| Thanks to everyone for all the help! Everything
| is working for me now. It turns out that the main
| detail I was missing was exactly what commands
| to type to compile it, and how to use it in GHCI.
| Pretty important detail, actually.
|
| Alistair - yes, there are a few simpler pages about
|
Stefan O'Rear wrote:
Prior art trumps all. (by a few %) granted it doesn't do much memoizing
anymore :)
gs ajb f d u, it, z s n
[snip]
Nice. I took the opportunity to polish my generic linear recurrence
module somewhat and test its speed. It does quite well I think:
using
David Tolpin wrote:
I am looking for help in design of a stateful tree walker.
I think that you can use Data.Traversable to great effect. Related to
that are Control.Applicative and Data.Foldable. The papers that are
mentioned in the Haddocks explain what these modules do and what they
are
Following recent discussion about a cross-implementation performance
benchmark suite, based on nofib, I've gone and combined nofib with the
great language shootout programs, and rewritten the build system to
support cross implementation measurements.
The result is:
nobench
Hi Dons,
nobench
http://www.cse.unsw.edu.au/~dons/nobench.html
Yhc is consistently half the speed of nhc, whereas in our tests, its
typically 20% faster. Can you make sure you've built Yhi with -O
(scons type=release should do it). I opened a bug just a few days ago,
because I
Donald Bruce Stewart wrote:
Following recent discussion about a cross-implementation performance
benchmark suite, based on nofib, I've gone and combined nofib with the
great language shootout programs, and rewritten the build system to
support cross implementation measurements.
Great work!
Quoth Ketil Malde, nevermore,
Wouldn't it be better to benchmark a more idiomatically correct codebase?
I suppose the ideal way to do it would be benchmarks for the (1) idiomatic
and (2) the highly tuned implementations. Then the compiler writers can
push 1 towards 2, while the pesky shootout
On 2/19/07, Donald Bruce Stewart [EMAIL PROTECTED] wrote:
results are quite interesting. The most recent run is available:
http://www.cse.unsw.edu.au/~dons/nobench/bench.results
http://www.cse.unsw.edu.au/~dons/nobench/bench.log
Maybe I'm missing something, but how can ghci beat ghc
felipe.lessa:
On 2/19/07, Donald Bruce Stewart [EMAIL PROTECTED] wrote:
results are quite interesting. The most recent run is available:
http://www.cse.unsw.edu.au/~dons/nobench/bench.results
http://www.cse.unsw.edu.au/~dons/nobench/bench.log
Maybe I'm missing something, but how
ithika:
Quoth Ketil Malde, nevermore,
Wouldn't it be better to benchmark a more idiomatically correct codebase?
I suppose the ideal way to do it would be benchmarks for the (1) idiomatic
and (2) the highly tuned implementations. Then the compiler writers can
push 1 towards 2, while
Is it possible to write multi-line definitions in GHC interactive interpreter ?
(like in Python interp. ?)
When I try to write f.E. if-then-else in more then 1 line I get the following
error:
interactive:1:30: parse error (possibly incorrect indentation)
Ketil.Malde:
Donald Bruce Stewart wrote:
Following recent discussion about a cross-implementation performance
benchmark suite, based on nofib, I've gone and combined nofib with the
great language shootout programs, and rewritten the build system to
support cross implementation measurements.
For absorbing the functional style of programming (which is what you really
should be working on at this point),
For functional style and the reasoning attitude associated with lazy
functional programming, the following book is a good introduction:
@Book{Bird-2000,
author = {Richard
Dunric wrote:
Is it possible to write multi-line definitions in GHC interactive interpreter ?
(like in Python interp. ?)
When I try to write f.E. if-then-else in more then 1 line I get the following
error:
interactive:1:30: parse error (possibly incorrect indentation)
It would be quite
Hi
Is it possible to write multi-line definitions in GHC interactive interpreter
? (like in Python interp. ?)
As it happens, it is possible to do with WinHugs, I've just never
turned it on by default. If there is massive need I'll polish this
feature up and put it in the next builds.
| I am trying to get a deeper understanding of core's role in GHC and
| the compilation of functional languages in general. So far I have
You can find lots of stuff here
http://hackage.haskell.org/trac/ghc/wiki/Commentary. At the bottom is a link
to a lot of GHC-related papers.
| - Exactly
Would it be worth opening a Trac bug report or feature request for this?
And/or documenting the unexpected behaviour; perhaps here
http://haskell.org/haskellwiki/GHC/GUI_programming ?
Simon
| -Original Message-
| From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Duncan
|
On 18/02/07, Marc Weber [EMAIL PROTECTED] wrote:
Do I still miss a point?
I think Yitzchak's explanation of this was pretty good, so I recommend
you check that out. You should also make sure you read Sebastian's
argument, whose line of thought is similar to the one I'm going to try
to develop.
Sorry, I'm a little late to this thread, but the topic of
sieve [] = []
sieve (x:xs) = x : sieve [y | y - xs, y `mod` x /= 0]
(as posted by Rafael Almeida) is somewhat dear to my heart, as I
wrote a paper about it last summer and sent it in to JFP. Still
waiting for a reply though.
Let's
lang:haskell seems to work just fine for me.
On 2/14/07, Adam Peacock [EMAIL PROTECTED] wrote:
On 2/14/07, Stephane Bortzmeyer [EMAIL PROTECTED] wrote:
http://www.krugle.com/
Unlike Google, you can specify Haskell as a language.
It is true that you can't directly specify the programming
You took my quote entirely out of context. In particular, you omitted
the rest of the sentence but I'm sure that day will come. My
statement was no excuse by any stretch of the imagination--I was
initially confused when I saw it in your post and then a bit offended.
The original intent of my
Hi all,
GHC v Hugs v Yhc v NHC v ...
...Hacle Clean!
I shoved 5 of the benchmarks that Donald used through Hacle, and
compiled the outputs using version 2.1 of the Clean compiler. Results
are below.
As for the other examples, Hacle doesn't like non-Haskell98 and
translates
On Mon, Feb 19, 2007 at 08:12:14PM +, Matthew Naylor wrote:
Hi all,
GHC v Hugs v Yhc v NHC v ...
...Hacle Clean!
I shoved 5 of the benchmarks that Donald used through Hacle, and
compiled the outputs using version 2.1 of the Clean compiler. Results
are below.
Submit
Melissa O'Neill wrote:
FWIW, another way to write this code (without needing to think about how
fold bails early) is
primes = 2: [x | x −[3,5..], all (\p − x `mod` p 0) (factorsToTry x)]
where
factorsToTry x = takeWhile (\p − p*p = x) primes
Well, you certainly thought of the fact
Hello Brian
I wrote you on this just some hours ago, before I had looked through
haskell-cafe! That's an interesting coincidence!
Anyway, moving my questions here.
1.
How easy is it to interoperate with Java code (call methods, pass Java
objects) for Haskell code run by LambdaVM rts? And vice
Hi David.
I see that its useful to add complete type signatures without letting
the compiler add stuff magically. This is why I've tried to write the final
question down under a new topic wether it would be useful to be able to write
down partial type signatures where browsing coders know that
Hi
Well, he was willing to make concessions for Yhc brokenness (wrt importing
System.Environment - yhc's System doesn't export getArgs like the Report
says it should (first tangible result of nofib: the Yhc team has fixed it))
The second tangible result should be that Yhc runs faster than
On 19/02/07, Neil Mitchell [EMAIL PROTECTED] wrote:
The second tangible result should be that Yhc runs faster than nhc.
Our internal testing originally showed a 20% speedup over nhc -
something seems to have gone wrong to slow down Yhc, so we are working
to fix this. Hopefully in a few days Yhc
Simon Peyton-Jones wrote:
Yitz, Please do make time to do this!
This is the moment, while it is still fresh in your mind.
Of course, you are correct. Thanks for the push.
I am a bit busy with work, but the information is not
lost. I'll have it up soon.
Regards,
Yitz
Hi Melissa,
I enjoyed your article. I especially like your trick
of starting with p*p.
You wrote:
Which seems reasonable, until you realize that every
prime p we come up with is still considered by
k deleteOrd filters, where k is the number of primes
that preceeded it.
It is true that I have
P. R. Stanley wrote:
Chaps,
is there another general pattern for mylen, head or tail?
mylen [] = 0
mylen (x:xs) = 1 + mylen (xs)
head [] = error what head?
head (x:xs) = x
tail [] = error no tail
tail (x:xs)= xs
There are of course stylistic variations possible, e.g. you can use case
P. R. Stanley:
is there another general pattern for mylen, head or tail?
mylen [] = 0
mylen (x:xs) = 1 + mylen (xs)
head [] = error what head?
head (x:xs) = x
tail [] = error no tail
tail (x:xs)= xs
Benjamin Franksen:
Another very common 'pattern' is to factor the recursion into a
This is the inital version of a very small library, mostly using the functional graph library, to find a derangement of a set, or rather a list.
A derangement of a set is a permutation with no fixed points, like many constrained matching problems it is susceptible to solution via a Max-flow
apfelmus wrote:
I think that the `mod`-algorithm counts as sieve, it just does a
bad job at organizing the crossing off.
I'd say that it might count as a sieve, but *algorithmically* it is
not The Sieve of Eratosthenes. If you abstract away the
algorithmic details to a mathematical
apfelmus,
Cool! I really like your examples! Thank you.
Nick.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Nicolas Frisby wrote:
http://www.thinkgeek.com/geektoys/cubegoodies/86b8/
Now you can really show your coders why unsafePerformIO is to be avoided!
On the contrary, seems like a little more non-determinism would really
make that thing into an effective weapon. ;-)
38 matches
Mail list logo