39348
|
1 |
(* ========================================================================= *)
|
|
2 |
(* NAME/ARITY PAIRS *)
|
39502
|
3 |
(* Copyright (c) 2004 Joe Hurd, distributed under the BSD License *)
|
39348
|
4 |
(* ========================================================================= *)
|
|
5 |
|
|
6 |
signature NameArity =
|
|
7 |
sig
|
|
8 |
|
|
9 |
(* ------------------------------------------------------------------------- *)
|
|
10 |
(* A type of name/arity pairs. *)
|
|
11 |
(* ------------------------------------------------------------------------- *)
|
|
12 |
|
|
13 |
type nameArity = Name.name * int
|
|
14 |
|
|
15 |
val name : nameArity -> Name.name
|
|
16 |
|
|
17 |
val arity : nameArity -> int
|
|
18 |
|
|
19 |
(* ------------------------------------------------------------------------- *)
|
|
20 |
(* Testing for different arities. *)
|
|
21 |
(* ------------------------------------------------------------------------- *)
|
|
22 |
|
|
23 |
val nary : int -> nameArity -> bool
|
|
24 |
|
|
25 |
val nullary : nameArity -> bool
|
|
26 |
|
|
27 |
val unary : nameArity -> bool
|
|
28 |
|
|
29 |
val binary : nameArity -> bool
|
|
30 |
|
|
31 |
val ternary : nameArity -> bool
|
|
32 |
|
|
33 |
(* ------------------------------------------------------------------------- *)
|
|
34 |
(* A total ordering. *)
|
|
35 |
(* ------------------------------------------------------------------------- *)
|
|
36 |
|
|
37 |
val compare : nameArity * nameArity -> order
|
|
38 |
|
|
39 |
val equal : nameArity -> nameArity -> bool
|
|
40 |
|
|
41 |
(* ------------------------------------------------------------------------- *)
|
|
42 |
(* Parsing and pretty printing. *)
|
|
43 |
(* ------------------------------------------------------------------------- *)
|
|
44 |
|
|
45 |
val pp : nameArity Print.pp
|
|
46 |
|
|
47 |
end
|