SML# Document Version 4.0.0
26 Standard ML Basis Library

26.20 MONO_VECTOR

Provide a monomorphic vector type and its primitive functions.

signature MONO_VECTOR =
sig
  type vector
  type elem
  val all : (elem -> bool) -> vector -> bool
  val app : (elem -> unit) -> vector -> unit
  val appi : (int * elem -> unit) -> vector -> unit
  val collate : (elem * elem -> order) -> vector * vector -> order
  val concat : vector list -> vector
  val exists : (elem -> bool) -> vector -> bool
  val find : (elem -> bool) -> vector -> elem option
  val findi : (int * elem -> bool) -> vector -> (int * elem) option
  val foldl : (elem * ’a -> ’a) -> ’a -> vector -> ’a
  val foldli : (int * elem * ’a -> ’a) -> ’a -> vector -> ’a
  val foldr : (elem * ’a -> ’a) -> ’a -> vector -> ’a
  val foldri : (int * elem * ’a -> ’a) -> ’a -> vector -> ’a
  val fromList : elem list -> vector
  val length : vector -> int
  val map : (elem -> elem) -> vector -> vector
  val mapi : (int * elem -> elem) -> vector -> vector
  val maxLen : int
  val sub : vector * int -> elem
  val tabulate : int * (int -> elem) -> vector
  val update : vector * int * elem -> vector
end

Structures that implement the signature

  • CharVector : MONO_VECTOR

    type elem = char
    type vector = string

  • Word8Array : MONO_ARRAY

    type elem = word8
    type vector = word8 vector