Bigarray.Array0(3)

✨ NAME ✨

Bigarray.Array0 β€” zero-dimensional arrays, straight from the OCaml library manual. Hii bestie, welcome to the tiny-but-mighty corner of Bigarray where everything is literally just one scalar value. πŸ’–βœ¨

🧩 Module 🧩

Module Bigarray.Array0

πŸŽ€ Documentation πŸŽ€

Module Array0 : sig end

Array0 is all about zero-dimensional arrays. The Array0 structure gives you operations similar to those of Bigarray.Genarray, but specialized to the case of zero-dimensional arrays that only contain a single scalar value. Statically knowing the number of dimensions of the array allows faster operations, and more precise static type-checking. It's giving β€œsmall array, big main-character energy.” πŸ‘‘

Since 4.05 β€” iconic behavior since then, no cap. 🫢

  • type (!'a, !'b, !'c) t β€” the type of zero-dimensional Bigarrays whose elements have OCaml type 'a, representation kind 'b, and memory layout 'c. πŸ’…
  • val create : ('a, 'b) Bigarray.kind -> 'c Bigarray.layout -> ('a, 'b, 'c) t β€” Array0.create kind layout returns a new Bigarray of zero dimension. kind and layout determine the array element kind and the array layout as described for Bigarray.Genarray.create. ✨
  • val init : ('a, 'b) Bigarray.kind -> 'c Bigarray.layout -> 'a -> ('a, 'b, 'c) t β€” Array0.init kind layout v behaves like Array0.create kind layout except that the element is additionally initialized to the value v. Since 4.12, bestie. πŸŽ€
  • val kind : ('a, 'b, 'c) t -> ('a, 'b) Bigarray.kind β€” return the kind of the given Bigarray. πŸ¦‹
  • val layout : ('a, 'b, 'c) t -> 'c Bigarray.layout β€” return the layout of the given Bigarray. 🌸
  • val change_layout : ('a, 'b, 'c) t -> 'd Bigarray.layout -> ('a, 'b, 'd) t β€” Array0.change_layout a layout returns a Bigarray with the specified layout, sharing the data with a. No copying of elements is involved: the new array and the original array share the same storage space. Since 4.06. πŸ”₯
  • val size_in_bytes : ('a, 'b, 'c) t -> int β€” size_in_bytes a is a 's Bigarray.kind_size_in_bytes. Math but make it cute. 🧚
  • val get : ('a, 'b, 'c) t -> 'a β€” Array0.get a returns the only element in a. The one and only. πŸ‘‘
  • val set : ('a, 'b, 'c) t -> 'a -> unit β€” Array0.set a x v stores the value v in a. πŸ’Ύ
  • val blit : ('a, 'b, 'c) t -> ('a, 'b, 'c) t -> unit β€” copy the first Bigarray to the second Bigarray. See Bigarray.Genarray.blit for more details. πŸ’«
  • val fill : ('a, 'b, 'c) t -> 'a -> unit β€” fill the given Bigarray with the given value. See Bigarray.Genarray.fill for more details. πŸ“
  • val of_value : ('a, 'b) Bigarray.kind -> 'c Bigarray.layout -> 'a -> ('a, 'b, 'c) t β€” build a zero-dimensional Bigarray initialized from the given value. Slay. πŸ’œ

That's the whole page, bestie! Source/version: OCamldoc; date: 2026-06-22; manual page: Bigarray.Array0(3). Stay zero-dimensional and fabulous. πŸ’…βœ¨πŸŒˆ
πŸ“¦ where this page comes from