1(*
2    Title:      Standard Basis Library: Mono_Array signature
3    Author:     David Matthews
4    Copyright   David Matthews 1999, 2005
5
6    This library is free software; you can redistribute it and/or
7    modify it under the terms of the GNU Lesser General Public
8    License as published by the Free Software Foundation; either
9    version 2.1 of the License, or (at your option) any later version.
10    
11    This library is distributed in the hope that it will be useful,
12    but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14    Lesser General Public License for more details.
15    
16    You should have received a copy of the GNU Lesser General Public
17    License along with this library; if not, write to the Free Software
18    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19*)
20
21(* G&R 2004 status: updated. *)
22
23signature MONO_ARRAY =
24sig
25    eqtype array
26    type elem
27    type vector
28    val maxLen : int
29    val array : (int * elem) -> array
30    val fromList : elem list -> array
31    val vector: array -> vector
32    val tabulate : (int * (int -> elem)) -> array
33    val length : array -> int
34    val sub : (array * int) -> elem
35    val update : (array * int * elem) -> unit
36    val copy : {src : array, dst : array, di : int} -> unit
37    val copyVec : {src : vector, dst : array, di : int} -> unit
38    val appi : ((int * elem) -> unit) -> array -> unit
39    val app : (elem -> unit) -> array -> unit
40    val foldli : ((int * elem * 'b) -> 'b) -> 'b -> array -> 'b
41    val foldri : ((int * elem * 'b) -> 'b) -> 'b -> array -> 'b
42    val foldl : ((elem * 'b) -> 'b) -> 'b -> array -> 'b
43    val foldr : ((elem * 'b) -> 'b) -> 'b -> array -> 'b
44    val modifyi : ((int * elem) -> elem) -> array -> unit
45    val modify : (elem -> elem) -> array -> unit
46    val findi: (int * elem -> bool) -> array -> (int * elem) option
47    val find: (elem -> bool) -> array -> elem option
48    val exists: (elem -> bool) -> array -> bool
49    val all: (elem -> bool) -> array -> bool
50    val collate: (elem * elem -> order) -> array * array -> order
51end;
52