1(* 2 Title: Standard Basis Library: MONO_ARRAY_SLICE signature 3 Author: David Matthews 4 Copyright David Matthews 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: new. *) 22 23signature MONO_ARRAY_SLICE = 24sig 25 type elem 26 type array 27 type slice 28 type vector 29 type vector_slice 30 31 val length : slice -> int 32 val sub : (slice * int) -> elem 33 val update: slice * int * elem -> unit 34 val full: array -> slice 35 val slice: array * int * int option -> slice 36 val subslice: slice * int * int option -> slice 37 val base: slice -> array * int * int 38 val vector: slice -> vector 39 val copy : {src : slice, dst : array, di : int} -> unit 40 val copyVec : {src : vector_slice, dst : array, di : int} -> unit 41 val isEmpty: slice -> bool 42 val getItem: slice -> (elem * slice) option 43 val appi : ((int * elem) -> unit) -> slice -> unit 44 val app : (elem -> unit) -> slice -> unit 45 val modifyi : (int * elem -> elem) -> slice -> unit 46 val modify : (elem -> elem) -> slice -> unit 47 val foldli : ((int * elem * 'a) -> 'a) -> 'a -> slice -> 'a 48 val foldri : ((int * elem * 'a) -> 'a) -> 'a -> slice -> 'a 49 val foldl : ((elem * 'a) -> 'a) -> 'a -> slice -> 'a 50 val foldr : ((elem * 'a) -> 'a) -> 'a -> slice -> 'a 51 val findi: (int * elem -> bool) -> slice -> (int * elem) option 52 val find: (elem -> bool) -> slice -> elem option 53 val exists: (elem -> bool) -> slice -> bool 54 val all: (elem -> bool) -> slice -> bool 55 val collate: (elem * elem -> order) -> slice * slice -> order 56end; 57