Re: [Haskell-cafe] List of all powers

2007-11-14 Thread Brent Yorgey
On Nov 14, 2007 2:57 PM, Kurt Hutchinson <[EMAIL PROTECTED]> wrote: > On Nov 14, 2007 1:06 PM, Brent Yorgey <[EMAIL PROTECTED]> wrote: > > On Nov 14, 2007 12:32 PM, Kurt Hutchinson <[EMAIL PROTECTED]> wrote: > > The merging can be done much more simply and efficiently (this is code I > > wrote whe

Re: [Haskell-cafe] List of all powers

2007-11-14 Thread Kurt Hutchinson
On Nov 14, 2007 1:06 PM, Brent Yorgey <[EMAIL PROTECTED]> wrote: > On Nov 14, 2007 12:32 PM, Kurt Hutchinson <[EMAIL PROTECTED]> wrote: > The merging can be done much more simply and efficiently (this is code I > wrote when computing squarefree numbers in a blog post a few months ago): Wow, thanks

Re: [Haskell-cafe] List of all powers

2007-11-14 Thread Henning Thielemann
On Wed, 14 Nov 2007, Kurt Hutchinson wrote: > As part of a solution I'm working on for Project Euler problem 119, I > wanted to create an ordered list of all powers of all positive > integers (starting with squares). This is what I came up with: > > powers = ( uniq . map fst . iterate next ) ( 1,

Re: [Haskell-cafe] List of all powers

2007-11-14 Thread Brent Yorgey
On Nov 14, 2007 12:32 PM, Kurt Hutchinson <[EMAIL PROTECTED]> wrote: > As part of a solution I'm working on for Project Euler problem 119, I > wanted to create an ordered list of all powers of all positive > integers (starting with squares). This is what I came up with: > > powers = ( uniq . map f

[Haskell-cafe] List of all powers

2007-11-14 Thread Kurt Hutchinson
As part of a solution I'm working on for Project Euler problem 119, I wanted to create an ordered list of all powers of all positive integers (starting with squares). This is what I came up with: powers = ( uniq . map fst . iterate next ) ( 1, ( 0, powertable ) ) powertable = map (\ n -> map (\ p