[Haskell-cafe] Re: Simple FAST lazy functional primes

Felipe Lessa felipe.lessa at gmail.com
Mon Nov 2 16:42:43 EST 2009


On Mon, Nov 02, 2009 at 02:10:12PM -0700, Jason Dagit wrote:
> If you are okay with Int, then maybe you're also happy with Int32 or Word32.
>  If so, why don't you use template haskell to build the list at compile
> time?  If you do that, then getting the kth prime at run-time is O(k).  Take
> that AKS!  :)

Silly you!  If he's into TH than he may just create an -- god
forbid -- array and get the kth prime in O(1).  :)

--
Felipe.


More information about the Haskell-Cafe mailing list