SML# Document Version 3.7.1
26.18 MONO_ARRAY
Provide a monomorphic array type and its primitive functions.
signature MONO_ARRAY = sig eqtype array type elem type vector val all : (elem -> bool) -> array -> bool val app : (elem -> unit) -> array -> unit val appi : (int * elem -> unit) -> array -> unit val array : int * elem -> array val collate : (elem * elem -> order) -> array * array -> order val copy : {src : array, dst : array, di : int} -> unit val copyVec : {src : vector, dst : array, di : int} -> unit val exists : (elem -> bool) -> array -> bool val find : (elem -> bool) -> array -> elem option val findi : (int * elem -> bool) -> array -> (int * elem) option val foldl : (elem * ’b -> ’b) -> ’b -> array -> ’b val foldli : (int * elem * ’b -> ’b) -> ’b -> array -> ’b val foldr : (elem * ’b -> ’b) -> ’b -> array -> ’b val foldri : (int * elem * ’b -> ’b) -> ’b -> array -> ’b val fromList : elem list -> array val length : array -> int val maxLen : int val modify : (elem -> elem) -> array -> unit val modifyi : (int * elem -> elem) -> array -> unit val sub : array * int -> elem val tabulate : int * (int -> elem) -> array val update : array * int * elem -> unit val vector : array -> vector end
Structures that implement the signature
-
•
CharArray : MONO_ARRAY
type array = char array
type elem = char
type vector = string -
•
Word8Array : MONO_ARRAY
type array = word8 array
type elem = word8
type vector = word8 vector