Re: Overloading and Literal Numerics

2002-06-26 Thread Hal Daume III
The problem is that you might have: instance Poly Double where ... and then when you say: po 5 it doesn't know whether this is an Int or a Double. writing po (5::Int) should be sufficient. -- Hal Daume III "Computer science is no more about computers| [EMAIL PROTECTED] than astrono

Overloading and Literal Numerics

2002-06-26 Thread Alain Cremieux
Hi, I am trying to create an overloaded function "à la Java" to be able to call it either with a string or a number. Ex : definePort "http" definePort 80 but I have problem with restrictions in Haskell's type system (or with my lack of experience with it). The program : data PolyType = MkPolyLef

Advance Notice of Possible Research Opening

2002-06-26 Thread Kevin Hammond
Dear friends, Although final confirmation is awaited, Kevin Hammond and Steve Linton expect shortly to be in a position to advertise a three year post-doctoral fellowship to work on a research project entitled: "Computational Algebra for Commodity Parallel Machines". The goal of this project is

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: Weird profiling behaviour

2002-06-26 Thread Koen Claessen
Ketil Z. Malde wrote: | (writing his own O(n log n) sortBy as we speak) It might be useful to look at Ralf Hinze's collection of sorting routines, available on his homepage: http://www.cs.uu.nl/~ralf/software.html#sort /Koen. ___ Haskell mailing

Re: Papers on strictness annotations

2002-06-26 Thread Robert Ennals
> And in the olden days (Before Haskell) there was: > > Kewley and Glynn1989 > J.M. Kewley and K. Glynn. > Evaluation Annotations for Hope+. > In Glasgow Workshop on Functional Programming, Workshops in Computing, > pages 329-337, Fraserburgh, Scotland, 1989. Springer-Verlag. Now r

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
Koen Claessen <[EMAIL PROTECTED]> writes: > Another reason might be that the ints in the list are not > evaluated yet; and sorting the list on the ints forces > evaluation of them which maybe takes time? Yes, I've thought of that, but (and correct me if I'm wrong!) I was under the impression tha

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 Koen Claessen
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 in

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

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