3302
|
1 |
(* Title: TFL/utils
|
|
2 |
ID: $Id$
|
|
3 |
Author: Konrad Slind, Cambridge University Computer Laboratory
|
|
4 |
Copyright 1997 University of Cambridge
|
|
5 |
|
|
6 |
Basic utilities
|
|
7 |
*)
|
|
8 |
|
2112
|
9 |
signature Utils_sig =
|
|
10 |
sig
|
|
11 |
exception ERR of {module:string,func:string, mesg:string}
|
|
12 |
|
|
13 |
val can : ('a -> 'b) -> 'a -> bool
|
|
14 |
val holds : ('a -> bool) -> 'a -> bool
|
|
15 |
val C : ('a -> 'b -> 'c) -> 'b -> 'a -> 'c
|
|
16 |
|
|
17 |
val itlist : ('a -> 'b -> 'b) -> 'a list -> 'b -> 'b
|
|
18 |
val rev_itlist : ('a -> 'b -> 'b) -> 'a list -> 'b -> 'b
|
|
19 |
val end_itlist : ('a -> 'a -> 'a) -> 'a list -> 'a
|
|
20 |
val itlist2 :('a -> 'b -> 'c -> 'c) -> 'a list -> 'b list -> 'c -> 'c
|
|
21 |
val pluck : ('a -> bool) -> 'a list -> 'a * 'a list
|
|
22 |
val zip3 : 'a list -> 'b list -> 'c list -> ('a*'b*'c) list
|
|
23 |
val take : ('a -> 'b) -> int * 'a list -> 'b list
|
|
24 |
val sort : ('a -> 'a -> bool) -> 'a list -> 'a list
|
|
25 |
|
|
26 |
end;
|
|
27 |
|