TFL/utils.sml
changeset 9867 bf8300fa4238
parent 3391 5e45dd3b64e9
child 9876 a069795f1060
     1.1 --- a/TFL/utils.sml	Tue Sep 05 18:53:21 2000 +0200
     1.2 +++ b/TFL/utils.sml	Tue Sep 05 18:53:42 2000 +0200
     1.3 @@ -1,11 +1,31 @@
     1.4 -(*  Title:      TFL/utils
     1.5 +(*  Title:      TFL/utils.sml
     1.6      ID:         $Id$
     1.7      Author:     Konrad Slind, Cambridge University Computer Laboratory
     1.8      Copyright   1997  University of Cambridge
     1.9  
    1.10 -Basic utilities
    1.11 +Basic utilities.
    1.12  *)
    1.13  
    1.14 +signature Utils_sig =
    1.15 +sig
    1.16 +  exception ERR of {module:string,func:string, mesg:string}
    1.17 +
    1.18 +  val can   : ('a -> 'b) -> 'a -> bool
    1.19 +  val holds : ('a -> bool) -> 'a -> bool
    1.20 +  val C : ('a -> 'b -> 'c) -> 'b -> 'a -> 'c
    1.21 +
    1.22 +  val itlist : ('a -> 'b -> 'b) -> 'a list -> 'b -> 'b
    1.23 +  val rev_itlist : ('a -> 'b -> 'b) -> 'a list -> 'b -> 'b
    1.24 +  val end_itlist : ('a -> 'a -> 'a) -> 'a list -> 'a
    1.25 +  val itlist2 :('a -> 'b -> 'c -> 'c) -> 'a list -> 'b list -> 'c -> 'c
    1.26 +  val pluck : ('a -> bool) -> 'a list -> 'a * 'a list
    1.27 +  val zip3 : 'a list -> 'b list -> 'c list -> ('a*'b*'c) list
    1.28 +  val take  : ('a -> 'b) -> int * 'a list -> 'b list
    1.29 +  val sort  : ('a -> 'a -> bool) -> 'a list -> 'a list
    1.30 +
    1.31 +end;
    1.32 +
    1.33 +
    1.34  structure Utils = 
    1.35  struct
    1.36