package containers

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Create a new bitfield type

Parameters

module X : sig ... end

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)

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

OCaml

Innovation. Community. Security.