プログラミング言語SML#解説 3.7.1版
26 Standard ML標準ライブラリ

26.20 MONO_VECTOR

単相ベクトル型とその操作プリミティブを提供.

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

シグネチャを実装するストラクチャ

  • CharVector : MONO_VECTOR

    type elem = char
    type vector = string

  • Word8Array : MONO_ARRAY

    type elem = word8
    type vector = word8 vector