MyNixOS website logo
Description

Efficient little-endian bit vector library.

. This package contains a time- and space- efficient implementation of little-endian, immutable bit vectors. Provides implementations of applicable typeclasses and numeric conversions. . The declared cost of each operation is either worst-case or amortized. . For an implementation of big-endian, immutable bit vectors use the bv package. . For an implementation of little-endian, mutable bit vectors, use the bitvec package.

Efficient little-endian bit vector Haskell library

Build Status Workflow Status Coverage Status License FreeBSD

Hackage Hackage CI

Stackage LTS Stackage Nightly

This package contains an efficient implementation of little-endian, immutable bit vectors. It implements most applicable type-classes and also conversions to and from signed or unsigned numbers.

For an implementation of big-endian, immutable bit vectors, use the bv package.

For an implementation of little-endian, mutable bit vectors, use the bitvec package.

Accessing type-class instances

This package utilizes the "multiple sub-libraries" feature of Cabal. The intended usage is an "opt-in" dependency footprint for the bv-little package, as not all type-class instances which are defined are exposed by default. Therefore package consumers can select which, if any, type-class instances outside of the core libraries they wish to have exposed and transitively depend on the associated package(s).

New type-class instance exposure procedure:

  1. All BitVector instances of type-classes defined in base are exported by default from the Data.BitVector.LittleEndian module.

  2. Each BitVector instance of a type-class defined in a package other thanbase is exposed through a specific sub-library dependency and a special exposing module.

To access an instance of a type-class defined outsidebase, add the requisite sub-library to your build-depends and import the corresponding exposing module within your code-base.

Sub-library DependencyExposing ModuleType-class Instance(s)
bv-little:instances-binaryData.BitVector.LittleEndian.Binary
  • Binary
bv-little:instances-mono-traversableData.BitVector.LittleEndian.MonoTraversable
  • MonoFoldable
  • MonoFunctor
  • MonoTraversable
bv-little:instances-mono-traversable-keysData.BitVector.LittleEndian.MonoKeyed
  • MonoAdjustable
  • MonoFoldableWithKey
  • MonoIndexable
  • MonoKeyed
  • MonoLookup
  • MonoTraversableWithKey
  • MonoZip
  • MonoZipWithKey
bv-little:instances-quickcheckData.BitVector.LittleEndian.QuickCheck
  • Arbitrary
  • CoArbitrary
bv-little:instances-text-showData.BitVector.LittleEndian.TextShow
  • TextShow

Tests

The test suite ensures that all type-class instances are "lawful" and that data-structure–specific functionality is well defined.

The TestSuite.hs file contains the specification. It can be run by invoking any of the following commands:

  • cabal test

  • stack test

Benchmarks

The benchmarks provide an empyrical check for the asymptotic complexity of data structure operations and also provide easy metrics for detecting performance regressions.

The Benchmarks.hs file contains these metrics. It can be run by invoking any of the following commands:

  • cabal bench

  • stack bench.

Metadata

Version

1.3.2

Platforms (77)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-windows
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows