elmw/extra-bit/1.0.4

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 5ad85be0bff2 of https://github.com/nodef/extra-bit.elm (zip prefix elmw-extra-bit-5da6f5d/, America/Los_Angeles times): the zip is byte-identical to the one package.elm-lang.org recorded, SHA-1 90eb266d4e83539f1f3d8148054074b97b95a370.

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.4/

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


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
-- 5 (110 => 101)

reverse 0xFFFF0000
-- 65535 (0x0000FFFF)

signExtend 15 4
-- -1


Index

MethodAction
getGets a bit.
setSets a bit.
toggleToggles a bit.
swapSwaps bit sequences.
scanGets index of first set bit from LSB.
countCounts bits set.
parityGets n-bit parity.
rotateRotates bits.
reverseReverses all bits.
mergeMerges bits as per mask.
interleaveInterleaves bits of two int16s.
signExtendSign extends variable bit-width integer.