TFL/utils.sig
author nipkow
Thu, 24 Apr 1997 18:38:30 +0200
changeset 3042 21cd332b65d3
parent 2112 3902e9af752f
child 3245 241838c01caf
permissions -rw-r--r--
induct_tac
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2112
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
     1
signature Utils_sig =
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
     2
sig
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
     3
  (* General error format and reporting mechanism *)
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
     4
  exception ERR of {module:string,func:string, mesg:string}
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
     5
  val Raise : exn -> 'a
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
     6
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
     7
  (* infix 3 ## *)
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
     8
  val ## : ('a -> 'b) * ('c -> 'd) -> 'a * 'c -> 'b * 'd
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
     9
  val can   : ('a -> 'b) -> 'a -> bool
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    10
  val holds : ('a -> bool) -> 'a -> bool
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    11
  val assert: ('a -> bool) -> 'a -> 'a
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    12
  val W : ('a -> 'a -> 'b) -> 'a -> 'b
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    13
  val C : ('a -> 'b -> 'c) -> 'b -> 'a -> 'c
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    14
  val I : 'a -> 'a
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    15
  val curry : ('a * 'b -> 'c) -> 'a -> 'b -> 'c
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    16
  val uncurry : ('a -> 'b -> 'c) -> 'a * 'b -> 'c
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    17
  val fst : 'a * 'b -> 'a
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    18
  val snd : 'a * 'b -> 'b
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    19
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    20
  (* option type *)
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    21
  datatype 'a option = SOME of 'a | NONE
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    22
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    23
  (* Set operations *)
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    24
  val mem : ('a -> 'a -> bool) -> 'a -> 'a list -> bool
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    25
  val union : ('a -> 'a -> bool) -> 'a list -> 'a list -> 'a list
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    26
  val Union : ('a -> 'a -> bool) -> 'a list list ->  'a list
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    27
  val intersect : ('a -> 'a -> bool) -> 'a list -> 'a list -> 'a list
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    28
  val set_diff : ('a -> 'b -> bool) -> 'a list -> 'b list -> 'a list
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    29
  val mk_set : ('a -> 'a -> bool) -> 'a list -> 'a list
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    30
  val set_eq : ('a -> 'a -> bool) -> 'a list -> 'a list -> bool
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    31
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    32
  val map2 : ('a -> 'b -> 'c) -> 'a list -> 'b list -> 'c list
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    33
  val itlist : ('a -> 'b -> 'b) -> 'a list -> 'b -> 'b
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    34
  val rev_itlist : ('a -> 'b -> 'b) -> 'a list -> 'b -> 'b
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    35
  val end_itlist : ('a -> 'a -> 'a) -> 'a list -> 'a
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    36
  val itlist2 :('a -> 'b -> 'c -> 'c) -> 'a list -> 'b list -> 'c -> 'c
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    37
  val filter : ('a -> bool) -> 'a list -> 'a list
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    38
  val mapfilter : ('a -> 'b) -> 'a list -> 'b list
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    39
  val pluck : ('a -> bool) -> 'a list -> 'a * 'a list
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    40
  val assoc1 : ('a*'a->bool) -> 'a -> ('a * 'b) list -> ('a * 'b) option
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    41
  val front_back : 'a list -> 'a list * 'a
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    42
  val all : ('a -> bool) -> 'a list -> bool
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    43
  val exists : ('a -> bool) -> 'a list -> bool
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    44
  val zip : 'a list -> 'b list -> ('a*'b) list
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    45
  val zip3 : 'a list -> 'b list -> 'c list -> ('a*'b*'c) list
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    46
  val unzip : ('a*'b) list -> ('a list * 'b list)
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    47
  val take  : ('a -> 'b) -> int * 'a list -> 'b list
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    48
  val sort  : ('a -> 'a -> bool) -> 'a list -> 'a list
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    49
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    50
  val int_to_string : int -> string
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    51
  val concat : string -> string -> string
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    52
  val quote : string -> string
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    53
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    54
end;
3902e9af752f Konrad Slind's TFL
paulson
parents:
diff changeset
    55