PREDEFINED IDENTIFIERS OF STANDARD ML type bool TRUTH VALUES true false: bool not : bool -> bool = <> : ''a * ''a -> bool equality test type int and real NUMBERS + - * : int * int -> int addition, subtraction, OR real * real -> real multiplication ~ : int -> int OR real -> real unary minus abs : int -> int OR real -> real absolute value / : real * real -> real real division div mod : int * int -> int quotient, remainder < > <= >= : int * int -> bool relations OR real * real -> bool floor : real -> int conversion real : int -> real conversion sqrt : real -> real square root sin cos arctan : real -> real trig functions exp ln : real -> real exponential, log type string CHARACTER STRINGS ^ : string * string -> string string concat size : string -> int number of chars chr : int -> string string from ASCII ord : string -> int ASCII from string explode : string -> string list string to char list implode : string list -> string join strings type 'a list LISTS nil : 'a list the empty list :: : 'a * 'a list -> 'a list list construction @ : 'a list * 'a list -> 'a list list concatenation rev : 'a list -> 'a list list reversal map: ('a->'b) -> 'a list -> 'b list apply fun to list elts o : ('b->'c) * ('a->'b) -> ('a->'c) composition type unit TYPE OF EMPTY TUPLE type 'a ref REFERENCES ! : 'a ref -> 'a get contents ref : '_a -> '_a ref create a ref := : 'a ref * 'a -> unit assignment type instream INPUT STREAMS std_in : instream for terminal input open_in : string -> instream open file for input close_in: instream -> unit terminate input stream input : instream * int -> string read from input lookahead : instream -> string inspect waiting chars end_of_stream : instream -> bool test if finished type outstream OUTPUT STREAMS std_out : outstream for terminal output open_out: string -> outstream open file for output close_out: outstream -> unit terminate output stream output : outstream * string -> unit write to output exception Io of string errors during I/O type exn EXCEPTIONS exception Match Bind Interrupt PRECEDENCE OF INFIXES 7 / * div mod 6 + - ^ 5 :: @ 4 = <> < > <= >= 3 := o