TFL/utils.sig
author paulson
Thu, 22 May 1997 15:13:16 +0200
changeset 3302 404fe31fd8d2
parent 3245 241838c01caf
child 3330 ab7161e593c8
permissions -rw-r--r--
New headers and other minor changes
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3302
404fe31fd8d2 New headers and other minor changes
paulson
parents: 3245
diff changeset
     1
(*  Title:      TFL/utils
404fe31fd8d2 New headers and other minor changes
paulson
parents: 3245
diff changeset
     2
    ID:         $Id$
404fe31fd8d2 New headers and other minor changes
paulson
parents: 3245
diff changeset
     3
    Author:     Konrad Slind, Cambridge University Computer Laboratory
404fe31fd8d2 New headers and other minor changes
paulson
parents: 3245
diff changeset
     4
    Copyright   1997  University of Cambridge
404fe31fd8d2 New headers and other minor changes
paulson
parents: 3245
diff changeset
     5
404fe31fd8d2 New headers and other minor changes
paulson
parents: 3245
diff changeset
     6
Basic utilities
404fe31fd8d2 New headers and other minor changes
paulson
parents: 3245
diff changeset
     7
*)
404fe31fd8d2 New headers and other minor changes
paulson
parents: 3245
diff changeset
     8
2112
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
     9
signature Utils_sig =
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    10
sig
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    11
  (* General error format and reporting mechanism *)
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    12
  exception ERR of {module:string,func:string, mesg:string}
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    13
  val Raise : exn -> 'a
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    14
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    15
  val can   : ('a -> 'b) -> 'a -> bool
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    16
  val holds : ('a -> bool) -> 'a -> bool
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    17
  val C : ('a -> 'b -> 'c) -> 'b -> 'a -> 'c
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    18
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    19
  (* Set operations *)
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    20
  val mem : ('a -> 'a -> bool) -> 'a -> 'a list -> bool
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    21
  val set_diff : ('a -> 'b -> bool) -> 'a list -> 'b list -> 'a list
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    22
  val mk_set : ('a -> 'a -> bool) -> 'a list -> 'a list
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    23
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    24
  val itlist : ('a -> 'b -> 'b) -> 'a list -> 'b -> 'b
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    25
  val rev_itlist : ('a -> 'b -> 'b) -> 'a list -> 'b -> 'b
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    26
  val end_itlist : ('a -> 'a -> 'a) -> 'a list -> 'a
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    27
  val itlist2 :('a -> 'b -> 'c -> 'c) -> 'a list -> 'b list -> 'c -> 'c
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    28
  val mapfilter : ('a -> 'b) -> 'a list -> 'b list
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    29
  val pluck : ('a -> bool) -> 'a list -> 'a * 'a list
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    30
  val front_back : 'a list -> 'a list * 'a
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    31
  val zip3 : 'a list -> 'b list -> 'c list -> ('a*'b*'c) list
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    32
  val take  : ('a -> 'b) -> int * 'a list -> 'b list
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    33
  val sort  : ('a -> 'a -> bool) -> 'a list -> 'a list
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    34
  val concat : string -> string -> string
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    35
  val quote : string -> string
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    36
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    37
end;
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    38