annotate src/list_util.sig @ 1329:9be9da2df74b

Clarifying some C FFI details in manual
author Adam Chlipala <adam@chlipala.net>
date Sat, 11 Dec 2010 11:00:05 -0500
parents e571fb150a9f
children
rev   line source
adamc@5 1 (* Copyright (c) 2008, Adam Chlipala
adamc@5 2 * All rights reserved.
adamc@5 3 *
adamc@5 4 * Redistribution and use in source and binary forms, with or without
adamc@5 5 * modification, are permitted provided that the following conditions are met:
adamc@5 6 *
adamc@5 7 * - Redistributions of source code must retain the above copyright notice,
adamc@5 8 * this list of conditions and the following disclaimer.
adamc@5 9 * - Redistributions in binary form must reproduce the above copyright notice,
adamc@5 10 * this list of conditions and the following disclaimer in the documentation
adamc@5 11 * and/or other materials provided with the distribution.
adamc@5 12 * - The names of contributors may not be used to endorse or promote products
adamc@5 13 * derived from this software without specific prior written permission.
adamc@5 14 *
adamc@5 15 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
adamc@5 16 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
adamc@5 17 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
adamc@5 18 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
adamc@5 19 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
adamc@5 20 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
adamc@5 21 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
adamc@5 22 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
adamc@5 23 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
adamc@5 24 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
adamc@5 25 * POSSIBILITY OF SUCH DAMAGE.
adamc@5 26 *)
adamc@5 27
adamc@5 28 signature LIST_UTIL = sig
adamc@5 29
adamc@110 30 val mapConcat : ('a -> 'b list) -> 'a list -> 'b list
adamc@110 31
adamc@6 32 val mapfold : ('data, 'state, 'abort) Search.mapfolder
adamc@6 33 -> ('data list, 'state, 'abort) Search.mapfolder
adamc@34 34 val mapfoldB : ('context * 'data -> 'context * ('state -> ('data * 'state, 'abort) Search.result))
adamc@34 35 -> ('context, 'data list, 'state, 'abort) Search.mapfolderB
adamc@6 36
adamc@26 37 val foldlMap : ('data1 * 'state -> 'data2 * 'state) -> 'state -> 'data1 list -> 'data2 list * 'state
adamc@39 38 val foldlMapPartial : ('data1 * 'state -> 'data2 option * 'state) -> 'state -> 'data1 list -> 'data2 list * 'state
adamc@849 39 val foldlMapiPartial : (int * 'data1 * 'state -> 'data2 option * 'state)
adamc@849 40 -> 'state -> 'data1 list -> 'data2 list * 'state
adamc@39 41 val foldlMapConcat : ('data1 * 'state -> 'data2 list * 'state) -> 'state -> 'data1 list -> 'data2 list * 'state
adamc@847 42 val foldlMapAbort : ('data1 * 'state -> ('data2 * 'state) option)
adamc@847 43 -> 'state -> 'data1 list -> ('data2 list * 'state) option
adamc@26 44
adamc@23 45 val search : ('a -> 'b option) -> 'a list -> 'b option
adamc@839 46 val searchi : (int * 'a -> 'b option) -> 'a list -> 'b option
adamc@23 47
adamc@120 48 val mapi : (int * 'a -> 'b) -> 'a list -> 'b list
adamc@849 49 val mapiPartial : (int * 'a -> 'b option) -> 'a list -> 'b list
adamc@191 50 val foldli : (int * 'a * 'b -> 'b) -> 'b -> 'a list -> 'b
adamc@275 51 val foldri : (int * 'a * 'b -> 'b) -> 'b -> 'a list -> 'b
adamc@120 52
adamc@313 53 val foldliMap : (int * 'data1 * 'state -> 'data2 * 'state) -> 'state -> 'data1 list -> 'data2 list * 'state
adamc@313 54
adamc@792 55 val appi : (int * 'a -> unit) -> 'a list -> unit
adamc@792 56
adamc@792 57 val appn : (int -> unit) -> int -> unit
adamc@792 58
adamc@5 59 end