1(* 2 Title: Standard Basis Library: Vector Slice Signature 3 Author: David Matthews 4 Copyright David Matthews 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 20(* This uses the 'a vector type defined at the top level. *) 21signature VECTOR_SLICE = 22sig 23 type 'a slice 24 val length : 'a slice -> int 25 val sub : ('a slice * int) -> 'a 26 val full: 'a vector -> 'a slice 27 val slice: 'a vector * int * int option -> 'a slice 28 val subslice: 'a slice * int * int option -> 'a slice 29 val base: 'a slice -> 'a vector * int * int 30 val vector: 'a slice -> 'a vector 31 val concat : 'a slice list -> 'a vector 32 val isEmpty: 'a slice -> bool 33 val getItem: 'a slice -> ('a * 'a slice) option 34 val appi : ((int * 'a) -> unit) -> 'a slice -> unit 35 val app : ('a -> unit) -> 'a slice -> unit 36 val mapi : ((int * 'a) -> 'b) -> 'a slice -> 'b vector 37 val map : ('a -> 'b) -> 'a slice -> 'b vector 38 val foldli : ((int * 'a * 'b) -> 'b) -> 'b -> 'a slice -> 'b 39 val foldri : ((int * 'a * 'b) -> 'b) -> 'b -> 'a slice -> 'b 40 val foldl : (('a * 'b) -> 'b) -> 'b -> 'a slice -> 'b 41 val foldr : (('a * 'b) -> 'b) -> 'b -> 'a slice -> 'b 42 val findi: (int * 'a -> bool) -> 'a slice -> (int * 'a) option 43 val find: ('a -> bool) -> 'a slice -> 'a option 44 val exists: ('a -> bool) -> 'a slice -> bool 45 val all: ('a -> bool) -> 'a slice -> bool 46 val collate: ('a * 'a -> order) -> 'a slice * 'a slice -> order 47end; 48