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
> = Integer? (That is, without having to introduce a new function to
> the public interface of Data.Bits.) Some kind of SPECIALIZE pragma,
> perhaps?
{-# RULES
"Integer fastTestBit" forall x n.
testBit x n = fastTestBit :: Integer -> Int -> Bool
#-}
I think should work. If testBit is in the Bits class though, we can just
add it for instance Bits Integer
-- Don
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe