5023a43afe513d8aaadb0354c0b9fe62a9890e43426b138474126f681a7b200f

Download raw

Created: 2023-12-19 03:40:10.302489 UTC

Size: 908

Preview (limited to 512 bytes)

"{-# LANGUAGE CPP #-}\nmodule Data.Bits.Compat (\n popCount,\n zeroBits,\n finiteBitSize,\n countLeadingZeros,\n ) where\n\nimport Data.Bits\n\n#if !MIN_VERSION_base(4,7,0)\n#define FiniteBits Bits\n#endif\n\n#if !MIN_VERSION_base(4,5,0)\npopCount :: Bits a => a -> Int\npopCount = go 0\n where\n go c 0 = c `seq` c\n go c w = go (c+1) (w .&. (w - 1)) -- clear the least significant\n{-# INLINE popCount #-}\n#endif\n\n#if !MIN_VERSION_base(4,7,0)\nzeroBits :: Bits a => a\nzeroBits = clearBit (bit 0) 0\n{-# INLINE zero"


Casa is a service provided by the Haskell Foundation │ Originally developed by FP Complete