package miou

  1. Overview
  2. Docs
Composable concurrency primitives for OCaml

Install

dune-project
 Dependency

Authors

Maintainers

Sources

miou-0.5.0.tbz
sha256=50aa6aa6767d3fe1875e35c69e4b1d92346a5f3a0349ac065f2efce6378c89c3
sha512=58736c04b4c5f11165fc04b7b1ffe7183852e994a3617cebc7ecaa6e88244b583712c3d04e5f82bc52241317b71c8c3262d188a6c8f398a3f7813c75a8fc52dd

doc/miou.unix/Miou_bitv/index.html

Module Miou_bitvSource

This module implements bit vectors, as an abstract datatype t. Since bit vectors are particular cases of arrays, this module provides the same operations as module Array. It also provides bitwise operations and conversions to/from integer types.

In the following, false stands for bit 0 and true for bit 1.

Sourcetype t

The type of bit vectors

Sourceval create : int -> bool -> t

create n b creates a new bit vector of length n, initialized with b.

Sourceval length : t -> int

length returns the length (number of elements) of the given vector.

Sourceval next : t -> int option

next v returns the next unset nth bit of v.

Sourceval max : t -> int
Sourceval get : t -> int -> bool

get v n returns the nth bit of v.

Sourceval set : t -> int -> bool -> unit

set v n b sets the nth bit of v to the value b.

Sourceval iter : (int -> unit) -> t -> unit

iter fn v applies function fn in turn to all indexes of the elements of v which are set (i.e. true); indexes are visited from least significant to most significant.

Sourceval equal : t -> t -> bool

Returns true if two bit vectors are of the same length and with the same bits.