Functions of ML
This document was generated automatically from an ASCII file using
Dick Botting's
MATHS notation. It was slightly changed by Martin
Eldracher for the local copy.
There is an alphabetical index.
A Quick List of Functions in SML/NJ
-
Note
Use "*" to show products "><"
- (*)::=
- (><).
-
Arithmetic
- negation::int->int=
- "~".
- negation::real->real=
- "~".
- max::
- int*int->int.
- min::
- int*int->int.
- abs::
- int->int.
- abs::
- real->real.
- real::
- int->real.
- truncate::
- real->int.
- ceiling::
- real->int.
- floor::
- real->int.
- sin::
- real->real.
- cos::
- real->real.
- arctan::
- real->real.
- ln::
- real<>->real. (partial functions, not defined on zero or less)
- sqrt::
- real<>->real. (partial functions, not defined on zero or less)
- exp::
- real->real.
- chr::
- int->string.
- |-chr= /ord. --- chr inverts the effect of ord.
- makestring::
- int|real->string.
- print::
- int|real->unit.
-
Comparisons
- = :: int*int->bool =
- (1st) has same value as (2nd).
- <> :: int*int->bool =
- (1st) is not equal to (2nd).
- < ::
- int*int->bool.
- > ::
- int*int->bool.
- <= ::
- int*int->bool.
- >= ::
- int*int->bool.
-
Strings
The characters in strings are numbered 0,1,2,... .
-
- explode::string->string list=
- each char in (_) becomes item in resulting list.
- implode::string list->string=
- concatenate elements of (_).
(IE):implode o explode = Id.
(EI):explode o implode = Id.
- size::string->int=
- number of characters in string.
- substring::string*int*int->string=
- (3rd) chars starting at (2nd) of string (1st).
- ord::string->int=
- number in character sequence of first char of (_).
- ordof::
- string*int->int.
- print::
- string->unit.
-
Boolean
- andalso::
- bool*bool->bool.
- orelse::
- bool*bool->bool.
- not::
- bool->bool.
- makestring::
- bool->string.
- print::
- bool->unit.
-
Lists
- hd::
- a' list -> a' for type a'.
- tl::
- a' list->a' list for type a'.
- nth::
- 'a list*int->a'.
- nthtail::
- 'a list*int->a' list.
- null::
- 'a list->bool.
- length::
- 'a list->int.
- rev::
- 'a list->'a list.
- map::
- ('a -> 'b) -> 'a list -> 'b list for 'a and 'b types.
-
- app, revapp::
- ('a->'b)-> 'a list -> 'b list.
-
- fold, revfold::
- (('a * 'b)->'b) ->'a list ->'b -> 'b.
-
- exists::
- ('a->bool)->'a list-> bool.
-
-
Arrays
Must call
open Array;
- array::
- int*'a -> 'a array.
- sub::
- 'a array*int->'a.
- update::
- 'a array * int * 'a -> 'a array.
- length::
- 'a array->int.
- arrayoflist::
- 'a list -> 'a array.
-
References
- dereference::=
- "!"::'a ref -> 'a.
- assignment::=
- ":="::'a ref*'a->unit.
- inc::
- int ref->unit.
- dec::
- int ref->unit.
-
Bit Strings
- andb,orb,xorb::
- int*int->int
- lshift,rshift::
- int*int->int.
-
-
Byte arrays
- array::
- int*int->bytearray.
sub, update, length as in arrays.
-
- extract::
- bytearray*int*int->string.
-
fold, revfold.
-
app,revapp.
-
-
-
UNIX Based Functions
- use::string->unit=
- loads UNIX file name(_) relative to current working directory. Undefined side effects in expressions.
-
- execute::string*string list->instream*outstream=
- execute command with path name(1st) and arguments (2nd) and return ...??.
Assumptions and Definitions in Alphabetical Order
Disclaimer: CSUSB may or may not agree with this message.
Copyright(1995): Copy the document in which the link appeared and use as you wish as long as you include the following as
source, disclaimer, and copyright.
Also see my home page
Martin
Eldracher, 1995-11-14