bv-little: Efficient little-endian bit vector library

[ bit-vectors, bsd3, data, library ] [ Propose Tags ] [ Report a vulnerability ]

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


[Skip to Readme]

library bv-little

Modules

[Index]

  • Data
    • BitVector
      • Data.BitVector.LittleEndian

library bv-little:instances-text-show

Modules

[Index]

  • Data
    • BitVector
      • LittleEndian
        • Data.BitVector.LittleEndian.TextShow

library bv-little:instances-quickcheck

Modules

[Index]

  • Data
    • BitVector
      • LittleEndian
        • Data.BitVector.LittleEndian.QuickCheck

library bv-little:instances-mono-traversable-keys

Modules

[Index]

  • Data
    • BitVector
      • LittleEndian
        • Data.BitVector.LittleEndian.MonoKeyed

library bv-little:instances-mono-traversable

Modules

[Index]

  • Data
    • BitVector
      • LittleEndian
        • Data.BitVector.LittleEndian.MonoTraversable

library bv-little:instances-binary

Modules

[Index]

  • Data
    • BitVector
      • LittleEndian
        • Data.BitVector.LittleEndian.Binary

library bv-little:instances

Modules

[Index]

  • Data
    • BitVector
      • LittleEndian
        • Data.BitVector.LittleEndian.Instances

library bv-little:core

Modules

[Index]

  • Data
    • BitVector
      • LittleEndian
        • Data.BitVector.LittleEndian.Internal

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 0.1.0.0, 0.1.1, 0.1.2, 1.0.0, 1.0.1, 1.1.0, 1.1.1, 1.3.0, 1.3.1, 1.3.2
Change log changelog.md
Dependencies base (>=4.16.1 && <5), binary (>=0.8), bv-little, deepseq (>=1.4.6), hashable (>=1.3), integer-gmp (>=1.1), keys (>=3.12), mono-traversable (>=1.0.5.0), mono-traversable-keys (>=0.2), primitive (>=0.7.2), QuickCheck (>=2.14.2), text-show (>=3.9) [details]
Tested with ghc ==9.6.2, ghc ==9.4.5, ghc ==9.2.8, ghc ==9.2.3
License BSD-3-Clause
Copyright (c) Alex Washburn 2020
Author Alex Washburn
Maintainer hackage@recursion.ninja
Category Data, Bit Vectors
Home page https://github.com/recursion-ninja/bv-little
Bug tracker https://github.com/recursion-ninja/bv-little/issues
Source repo head: git clone https://github.com/recursion-ninja/bv-little
Uploaded by recursion_ninja at 2023-10-03T21:34:16Z
Distributions LTSHaskell:1.3.2, NixOS:1.3.2, Stackage:1.3.2
Reverse Dependencies 3 direct, 0 indirect [details]
Downloads 4151 total (40 in the last 30 days)
Rating 2.0 (votes: 1) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]

Readme for bv-little-1.3.2

[back to package description]

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 than base is exposed through a specific sub-library dependency and a special exposing module.

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

Sub-library Dependency Exposing Module Type-class Instance(s)
bv-little:instances-binary Data.BitVector.LittleEndian.Binary
  • Binary
bv-little:instances-mono-traversable Data.BitVector.LittleEndian.MonoTraversable
  • MonoFoldable
  • MonoFunctor
  • MonoTraversable
bv-little:instances-mono-traversable-keys Data.BitVector.LittleEndian.MonoKeyed
  • MonoAdjustable
  • MonoFoldableWithKey
  • MonoIndexable
  • MonoKeyed
  • MonoLookup
  • MonoTraversableWithKey
  • MonoZip
  • MonoZipWithKey
bv-little:instances-quickcheck Data.BitVector.LittleEndian.QuickCheck
  • Arbitrary
  • CoArbitrary
bv-little:instances-text-show Data.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