Module Bit_field.Make

Create a new bitfield type

Parameters

Signature

type t = private int

Generative type of bitfields. Each instantiation of the functor should create a new, incompatible type

val empty : t

Empty bitfields (all bits 0).

val (lor) : t -> t -> t
val (land) : t -> t -> t
type field
val get : field -> t -> bool

Get the value of this field.

val set : field -> bool -> t -> t

Set the value of this field.

val mk_field : unit -> field

Make a new field.

val freeze : unit -> unit

Prevent new fields from being added. From now on, creating a field will raise Frozen.

val total_width : unit -> int

Current width of the bitfield.

val unsafe_of_int : int -> t