RE: [Haskell-cafe] Looking for largest power of 2 = Integer

2007-12-06 Thread Simon Peyton-Jones
| (2) Is it safe to assume an underlying implementation based on GMP? | (In Num.lhs there is an alternative definition for .NET. Is that ever | used?) Is it safe to assume the size of a GMP limb is the same as | the word size? (I'm assuming it is for now.) I think it's safe for now. In principle

Re: [Haskell-cafe] Looking for largest power of 2 = Integer

2007-12-05 Thread Spencer Janssen
On Tuesday 04 December 2007 15:47:19 David Benbennick wrote: On Dec 4, 2007 11:51 AM, Don Stewart [EMAIL PROTECTED] wrote: Awesome. We can use this in Data.Bits, if you've got some QuickChecks for it. Hear hear. But is there any way to just make the compiler use fastTestBit in place of

Re: [Haskell-cafe] Looking for largest power of 2 = Integer

2007-12-04 Thread Dan Piponi
On Dec 3, 2007 10:05 PM, David Benbennick [EMAIL PROTECTED] wrote: Could you please post your code here when you're done? I'd be interested to see the final result. This is just experimental code I'm playing with in order to implement exact real arithmetic, so there'll never be a final result

Re: [Haskell-cafe] Looking for largest power of 2 = Integer

2007-12-04 Thread Don Stewart
dpiponi: On Dec 3, 2007 10:05 PM, David Benbennick [EMAIL PROTECTED] wrote: Could you please post your code here when you're done? I'd be interested to see the final result. This is just experimental code I'm playing with in order to implement exact real arithmetic, so there'll never

Re: [Haskell-cafe] Looking for largest power of 2 = Integer

2007-12-04 Thread David Benbennick
On Dec 4, 2007 11:51 AM, Don Stewart [EMAIL PROTECTED] wrote: Awesome. We can use this in Data.Bits, if you've got some QuickChecks for it. Hear hear. But is there any way to just make the compiler use fastTestBit in place of testBit :: (Bits a) = a - Int - Bool when a = Integer? (That is,

Re: [Haskell-cafe] Looking for largest power of 2 = Integer

2007-12-04 Thread Don Stewart
dbenbenn: On Dec 4, 2007 11:51 AM, Don Stewart [EMAIL PROTECTED] wrote: Awesome. We can use this in Data.Bits, if you've got some QuickChecks for it. Hear hear. But is there any way to just make the compiler use fastTestBit in place of testBit :: (Bits a) = a - Int - Bool when a =

Re: [Haskell-cafe] Looking for largest power of 2 = Integer

2007-12-04 Thread Dan Piponi
There's a bit of work required to make this code good enough for general consumption, and I don't know much about Haskell internals. (1) What is the official way to find the size of a word? A quick look at 6.8.1's base/GHC/Num.lhs reveals that it uses a #defined symbol. (2) Is it safe to assume