Re: [Haskell-cafe] NumberTheory library

2005-05-16 Thread ajb
G'day all. I've finally had a chance to implement some of these changes. Quoting Yitzchak Gale <[EMAIL PROTECTED]>: > o I think you are testing w' * w' < n each time, even >when you are repeating factors of the same prime p. >You only need to do that when you move to the next p. Actuall

Re: [Haskell-cafe] NumberTheory library

2005-05-12 Thread Bo Herlin
Hi I have put some comments and examples in the code now, and will continue to do so as soon as i get time for it. Please look at the code, and tell me if it is worth making into a part of an official library. Or, even better, if someone has already done this code, and in a better way. You fin

Re: [Haskell-cafe] NumberTheory library

2005-05-11 Thread ajb
G'day all. Quoting John Meacham <[EMAIL PROTECTED]>: > Ack. I use the MTL quite extensivly in most of my projects. I hope it > won't disapear from the standard libraries completely. For the record, I have no information that the MTL will disappear any time soon. However, the proposed roadmap is

Re: [Haskell-cafe] NumberTheory library

2005-05-11 Thread John Meacham
On Wed, May 11, 2005 at 01:57:58PM -0500, Brian Smith wrote: > On 5/10/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > The MTL might be deprecated soon, > > replaced by Iavor's library, for example. > Is this just a rumor, or is this really the plan? Where is the best place to > get lavor's l

Re: [Haskell-cafe] NumberTheory library

2005-05-11 Thread Brian Smith
On 5/10/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > The MTL might be deprecated soon, > replaced by Iavor's library, for example. Hi, Is this just a rumor, or is this really the plan? Where is the best place to get lavor's library? Thanks, Brian Smith___

Re: [Haskell-cafe] NumberTheory library

2005-05-11 Thread Bo Herlin
Hi [EMAIL PROTECTED] wrote: G'day all. Quoting Bo Herlin <[EMAIL PROTECTED]>: Great! I like this a LOT. ... I don't know if I count as a guru or not, but by all means. Want to discuss this on-list or off-list? The code kinda big already, 700 lines + an util-file, so i'll put it on-line at http://

Re: [Haskell-cafe] NumberTheory library

2005-05-10 Thread ajb
G'day all. One more thing... Quoting Yitzchak Gale <[EMAIL PROTECTED]>: > o I think that in most of the places where you >fix the type as Int or Integer, you could leave >it polymorphic and avoid a lot of coercing. Even though it looks ugly, converting from an Int to an Integer is reall

Re: [Haskell-cafe] NumberTheory library

2005-05-10 Thread ajb
G'day all. Thanks for your suggestions. Some comments... Quoting Yitzchak Gale <[EMAIL PROTECTED]>: > o I think you are testing w' * w' < n each time, even >when you are repeating factors of the same prime p. >You only need to do that when you move to the next p Good point, thanks. >

Re: [Haskell-cafe] NumberTheory library

2005-05-10 Thread ajb
G'day all. Quoting Bo Herlin <[EMAIL PROTECTED]>: > Great! I like this a LOT. Thanks! > Im working on a framework for ranking and unranking things where primes > are just a tiny part: > > > data DCountable > > = Countable Integer > > | Uncountable > > deriving (Eq,Show) > > > > c

Re: [Haskell-cafe] NumberTheory library

2005-05-10 Thread Yitzchak Gale
As promised, here's the first attempt: darcs get http://andrew.bromage.org/darcs/numbertheory/ A few small comments about the function "factor" in Prime.hs: o I think you are testing w' * w' < n each time, even when you are repeating factors of the same prime p. You only need to do that

Re: [Haskell-cafe] NumberTheory library

2005-05-10 Thread Bo Herlin
> Well, part of what I was doing was experimenting with what a library like > this should look like, even more than what it should do. For some reason, > I kind of like writing this: > > *Math.Prime> is Prime 42 > False > > instead of this: > > *Math.Prime> isPrime 42 > False Gre

Re: [Haskell-cafe] NumberTheory library

2005-05-09 Thread ajb
G'day all. Quoting Jan-Willem Maessen <[EMAIL PROTECTED]>: > How about one that's actually H98? The types here aren't *that* > fiddly... :-) Well, part of what I was doing was experimenting with what a library like this should look like, even more than what it should do. For some reason, I kin

Re: [Haskell-cafe] NumberTheory library

2005-05-09 Thread Jan-Willem Maessen
On May 9, 2005, at 8:34 PM, [EMAIL PROTECTED] wrote: G'day all. Quoting Bo Herlin <[EMAIL PROTECTED]>: Great, why not put these together in a first attempt of making a standard library? As promised, here's the first attempt: darcs get http://andrew.bromage.org/darcs/numbertheory/ How about

Re: [Haskell-cafe] NumberTheory library

2005-05-09 Thread ajb
G'day all. Quoting Bo Herlin <[EMAIL PROTECTED]>: > Great, why not put these together in a first attempt of making a > standard library? As promised, here's the first attempt: darcs get http://andrew.bromage.org/darcs/numbertheory/ Cheers, Andrew Bromage ___

Re: [Haskell-cafe] NumberTheory library

2005-05-05 Thread ajb
G'day all. Quoting Daniel Fischer <[EMAIL PROTECTED]>: > The fibonacci numbers are really cool, for fib 10 and fib 20 I got > the > same performance as with William Lee Irwins 'fastest fibonacci numbers in the > west' from a couple of months ago. He reported that mine was a little slower

Re: [Haskell-cafe] NumberTheory library

2005-05-05 Thread Daniel Fischer
Am Donnerstag, 5. Mai 2005 06:20 schrieb [EMAIL PROTECTED]: > G'day all. > > Quoting Bo Herlin <[EMAIL PROTECTED]>: > > But there are functions that I cant find and that I assume others before > > me must have missed and then perhaps also implemented them. > > Is there any standard library with fun

Re: [Haskell-cafe] NumberTheory library

2005-05-05 Thread Bo Herlin
You might want to check out the archives of the mailing list, too. These sorts of problems occasionally get solved. For the record, here are a few of my attempts: http://andrew.bromage.org/Fib.hs (Fairly fast Fibonacci numbers) http://andrew.bromage.org/WheelPrime.hs (Fast factor

Re: [Haskell-cafe] NumberTheory library

2005-05-04 Thread ajb
G'day all. Quoting Bo Herlin <[EMAIL PROTECTED]>: > But there are functions that I cant find and that I assume others before > me must have missed and then perhaps also implemented them. > Is there any standard library with functions like: > > binomial > isCatalan > nthCatalan > nextCatalan > isP

[Haskell-cafe] NumberTheory library

2005-05-04 Thread Bo Herlin
Hi I've been running Hugs for a couple of weeks now and I'm slowly starting to get the Haskell idea, and I certanly like it! But there are functions that I cant find and that I assume others before me must have missed and then perhaps also implemented them. Is there any standard library with func