1(*
2    Title:      Standard Basis Library: Vector Signature
3    Author:     David Matthews
4    Copyright   David Matthews 1999, 2005, 2016
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 version 2.1 as published by the Free Software Foundation.
9    
10    This library is distributed in the hope that it will be useful,
11    but WITHOUT ANY WARRANTY; without even the implied warranty of
12    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13    Lesser General Public License for more details.
14    
15    You should have received a copy of the GNU Lesser General Public
16    License along with this library; if not, write to the Free Software
17    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18*)
19
20signature VECTOR =
21sig
22    eqtype  'a vector
23    val maxLen : int
24    val fromList : 'a list -> 'a vector
25    val tabulate : (int * (int -> 'a)) -> 'a vector
26    val length : 'a vector -> int
27    val sub : ('a vector * int) -> 'a
28    val update: 'a vector * int * 'a -> 'a vector
29    
30    val concat : 'a vector list -> 'a vector
31    val mapi : ((int * 'a) -> 'b) -> 'a vector -> 'b vector
32    val map : ('a -> 'b) -> 'a vector -> 'b vector
33
34    val appi : ((int * 'a) -> unit) -> 'a vector -> unit
35    val app : ('a -> unit) -> 'a vector -> unit
36
37    val foldli : ((int * 'a * 'b) -> 'b) -> 'b -> 'a vector -> 'b
38    val foldri : ((int * 'a * 'b) -> 'b) -> 'b -> 'a vector -> 'b
39    val foldl : (('a * 'b) -> 'b) -> 'b -> 'a vector -> 'b
40    val foldr : (('a * 'b) -> 'b) -> 'b -> 'a vector -> 'b
41    
42    val findi: (int * 'a -> bool) -> 'a vector -> (int * 'a) option
43    val find: ('a -> bool) -> 'a vector -> 'a option
44    val exists: ('a -> bool) -> 'a vector -> bool
45    val all: ('a -> bool) -> 'a vector -> bool
46    val collate: ('a * 'a -> order) -> 'a vector * 'a vector -> order
47end;
48