[Haskell-cafe] containers license issue

Dmitry Kulagin dmitry.kulagin at gmail.com
Wed Dec 12 21:18:30 CET 2012


Clark, Johan, thank you! That looks like perfect solution to the problem.

12.12.2012, в 22:56, Johan Tibell <johan.tibell at gmail.com> написал(а):

> On Wed, Dec 12, 2012 at 10:40 AM, Clark Gaebel <cgaebel at uwaterloo.ca> wrote:
>> I just did a quick derivation from
>> http://graphics.stanford.edu/~seander/bithacks.html#RoundUpPowerOf2 to get
>> the highest bit mask, and did not reference FXT nor the containers
>> implementation. Here is my code:
>>
>> highestBitMask :: Word64 -> Word64
>> highestBitMask x1 = let x2 = x1 .|. x1 `shiftR` 1
>>                        x3 = x2 .|. x2 `shiftR` 2
>>                        x4 = x3 .|. x3 `shiftR` 4
>>                        x5 = x4 .|. x4 `shiftR` 8
>>                        x6 = x5 .|. x5 `shiftR` 16
>>                        x7 = x6 .|. x6 `shiftR` 32
>>                     in x7 `xor` (x7 `shiftR` 1)
>>
>> This code is hereby released into the public domain. Problem solved.
>
> I will integrate this into containers later today.
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe



More information about the Haskell-Cafe mailing list