Module Bitstring.Lsb_first

Lsb_first treats lists as having the least significant element at the head. Padding is added to the left end of the list.

include S
type 'a t = private 'a list
include Core_kernel.Container.S1 with type 'a t := 'a t
val mem : 'a t -> 'a -> equal:('a -> 'a -> bool) -> bool
val length : 'a t -> int
val is_empty : 'a t -> bool
val iter : 'a t -> f:('a -> unit) -> unit
val fold : 'a t -> init:'accum -> f:('accum -> 'a -> 'accum) -> 'accum
val fold_result : 'a t -> init:'accum -> f:('accum -> 'a -> ('accum, 'e) Base__.Result.t) -> ('accum, 'e) Base__.Result.t
val fold_until : 'a t -> init:'accum -> f:('accum -> 'a -> ('accum, 'final) Base__Container_intf.Continue_or_stop.t) -> finish:('accum -> 'final) -> 'final
val exists : 'a t -> f:('a -> bool) -> bool
val for_all : 'a t -> f:('a -> bool) -> bool
val count : 'a t -> f:('a -> bool) -> int
val sum : (module Base__Container_intf.Summable with type t = 'sum) -> 'a t -> f:('a -> 'sum) -> 'sum
val find : 'a t -> f:('a -> bool) -> 'a option
val find_map : 'a t -> f:('a -> 'b option) -> 'b option
val to_list : 'a t -> 'a list
val to_array : 'a t -> 'a array
val min_elt : 'a t -> compare:('a -> 'a -> int) -> 'a option
val max_elt : 'a t -> compare:('a -> 'a -> int) -> 'a option
val of_list : 'a list -> 'a t

of_list lst constructs a bitstring from a list. Identity function: no transformation is applied.

val init : int -> f:(int -> 'a) -> 'a t

init n ~f creates a bitstring of length n with elements f 0, ..., f (n-1).

val map : 'a t -> f:('a -> 'b) -> 'b t

map t ~f applies f to each element in the bitstring.

val pad : padding_length:int -> zero:'a -> 'a t -> 'a t

pad ~padding_length ~zero t pads the bitstring t with zero elements at the correct side based on ordering until it reaches length padding_length. If already equal or longer, returns unchanged.

val of_msb_first : 'a Msb_first.t -> 'a t

of_msb_first xs converts a most-significant-bit-first list to LSB-first.