elmw/extra-bit/1.0.6

NOTE: the latest version is 1.0.14

Renamed to nodef/extra-bit.elm. That is where the repository lives now. It has not been published as a package under the new name.

Versions published as elmw/extra-bit still install under that name. 15 versions of 15 come from the new location (see their notes).

Rerouted (renamed, verified). The GitHub user or repository was renamed. The tag is still there, at the new name. The Lamdera package server serves a copy recovered from https://github.com/nodef/extra-bit.elm.

What we checked: The repo moved to github.com/nodef/extra-bit.elm. Rebuilt with git archive from commit 64e799f70860 of https://github.com/nodef/extra-bit.elm (zip prefix elmw-extra-bit-fbb00a1/, America/Los_Angeles times): the zip is byte-identical to the one package.elm-lang.org recorded, SHA-1 349683ee40bf8447490c7a97add26e78716fd1ea.

The Lamdera compiler uses this copy and prints a one-line notice saying so. elm itself fails to download this version.

Details · package.elm-lang.org's zip: https://github.com/elmw/extra-bit/zipball/1.0.6/

The bit is a basic unit of information in information theory, computing.
:package: Package, :blue_book: Wiki.


This package includes bit twiddling hacks by Sean Eron Anderson and many others.

Stability: Experimental.


import Bit exposing (..)

count 7
-- 3 (111 => 3)

parity 8 2
-- 2 (10,00 => 10)

swap 6 1 0 1
-- 5 (110 => 101)

reverse 0xFFFF0000
-- 65535 (0x0000FFFF)

signExtend 15 4
-- -1


Index

MethodAction
getGet a bit.
setSet a bit.
toggleToggle a bit.
swapSwap bit sequences.
scanGet index of first set bit from LSB.
countCount bits set.
parityGet n-bit parity.
rotateRotate bits.
reverseReverse all bits.
mergeMerge bits as per mask.
interleaveInterleave bits of two int16s.
signExtendSign extend variable bit-width integer.