Re: Weird profiling behaviour

2002-06-26 Thread Ketil Z. Malde
"Simon Marlow" <[EMAIL PROTECTED]> writes: > 5.02 uses quicksort, That's funny, since I see quadratic scaling, I must be hitting worst case both times? 'sort' and 'sortBy' *are* implemented in the same way, right? -kzm -- If I haven't seen further, it is by standing in the footprints of gian

Re: mergesort

2002-06-26 Thread Andrew J Bromage
G'day all. On Wed, Jun 26, 2002 at 04:06:50PM +0200, Koen Claessen wrote: > What implementation of mergesort are you using? (Could you > send me code?) I don't know for sure, but I'd be willing to bet it's Carsten Holst's merge sort with Andy Gill's partition function. If you have the GHC sour

Re: GHCI Can't Find Module But GHC Can

2002-06-26 Thread Malcolm Wallace
> > I think the problem is that GHCi doesn't respect #ifdef > > conditional compilation. > > I wasn't aware of any bugs in that area, can anyone provide some sample > code? (and I'm surprised, because GHCi just runs cpp in the same way as > GHC). Ah, I think it is probably just a failure to use

RE: GHCI Can't Find Module But GHC Can

2002-06-26 Thread Simon Marlow
> I think the problem is that GHCi doesn't respect #ifdef > conditional compilation. > The HaXml package has modules with stuff like > > #if defined(__HBC__) > import IOMisc > #endif > > which seems to confuse the interpreter (but not the compiler). I've > also seen reports that r

Re: Weird profiling behaviour

2002-06-26 Thread Brian Huffman
On Wednesday 26 June 2002 04:19 am, Colin Runciman wrote: > Could it be that the string-comparison sort simply has less sorting to do > than the int-comparison sort? The default definition of sortBy uses > insertion sort, so if the string-sort input happens to be already sorted > it takes linear

Re: mergesort

2002-06-26 Thread Koen Claessen
Simon, | 5.02 uses quicksort, but 5.04 will use mergesort | instead which has much more predictable performance | behaviour. What implementation of mergesort are you using? (Could you send me code?) I found that all implementations of mergesort I tried perform badly on large list (like 1

Re: GHCI Can't Find Module But GHC Can

2002-06-26 Thread Malcolm Wallace
> >___ ___ _ > > / _ \ /\ /\/ __(_) > > / /_\// /_/ / / | | GHC Interactive, version 5.02.3, > > for Haskell 98. > > / /_\\/ __ / /___| | http://www.haskell.org/ghc/ > > \/\/ /_/\/|_| Type :? for help. > > > > Loading package std ... linking ... done. > >

RE: GHCI Can't Find Module But GHC Can

2002-06-26 Thread Simon Marlow
> ghci test1.hs -i../lib -I../lib SVG-part1.o SVG-part2.o > ../lib/*.o -package > lang >___ ___ _ > / _ \ /\ /\/ __(_) > / /_\// /_/ / / | | GHC Interactive, version 5.02.3, > for Haskell 98. > / /_\\/ __ / /___| | http://www.haskell.org/ghc/ > \/\/ /_/\/|_|

RE: Building GHC / Happy

2002-06-26 Thread Simon Marlow
> It appears that building GHC requires Happy. It appears that > building Happy requires GHC. How does one bootstrap this thing ? Building GHC shouldn't really require Happy, but there's a bug in the 5.02 source distribution which means that the configure script complains if you don't have H

RE: Weird profiling behaviour

2002-06-26 Thread Simon Marlow
> >> The default definition of sortBy uses insertion sort > > > I have vague recollection of the wisdom of this choice being > > questioned > > And now I think I'm about question it as well... 5.02 uses quicksort, but 5.04 will use mergesort instead which has much more predictable performance

Re: Weird profiling behaviour

2002-06-26 Thread Ketil Z. Malde
[EMAIL PROTECTED] (Ketil Z. Malde) writes: > for 90K values to sort, I get 7M string comparisons and 321M integer ..and with different parameters giving 127K values, ie. a factor of 1.4, I get 12M and 614M comparisons, *very* close to the expected O(n²) behavior of insertion sort. >> The defaul

Re: Weird profiling behaviour

2002-06-26 Thread Ketil Z. Malde
Colin Runciman <[EMAIL PROTECTED]> writes: > Could it be that the string-comparison sort simply has less sorting to do > than the int-comparison sort? Not quite improbable, hang on while I print the profiling (with comparison in its own function): Yes, that seems to be the case, for 90K values

Re: Weird profiling behaviour

2002-06-26 Thread Colin Runciman
Ketil Z. Malde wrote: >I have what I think is a really strange problem. I have a fair sized >problem, which involves sorting a data set, first on labels (which are >Strings) and then on scores (which are Ints). > >The strange thing is that string sorting is *vastly* faster than int >scoring! No

RE: Andy Gill's html library

2002-06-26 Thread Keean
I have an alternative HTML library if you are interested... it uses an intermediate representation (a DOM style model) and defines the type ShowDOM = DOM -> DOM , allowing efficent concatination using function composition, finally a layer on top of this using the type ShowDOM -> (a,ShowDOM), insta

Weird profiling behaviour

2002-06-26 Thread Ketil Z. Malde
Hi, I have what I think is a really strange problem. I have a fair sized problem, which involves sorting a data set, first on labels (which are Strings) and then on scores (which are Ints). The strange thing is that string sorting is *vastly* faster than int scoring! Now, I've tried modifying

RE: Building GHC / Happy

2002-06-26 Thread Simon Peyton-Jones
Building GHC requires GHC too, not just Happy. The best thing to do is usually to download and install both GHC and Happpy, which is what the building guide recommends http://haskell.cs.yale.edu/ghc/docs/latest/building/sec-pre-supposed.htm l You can get away with downloading just GHC, building H

Re: Building GHC / Happy

2002-06-26 Thread Rafael Martínez Torres
This is a very useful hack to bootstrap GHC, at least for minor versions... If you have the autoconf utility avalaible on your box: -which autoconf -type autoconf ( under bash shell ) try as follow: 1) Remove configure file ( rm configure) 2)Open the file fptools/aclocal.m4 >dnl >dnl C