alice
library
manual.

Alice Project

The General structure


________ Synopsis ____________________________________________________

    signature GENERAL
    structure General : GENERAL
  

An extended version of the Standard ML Basis' General structure.

All of the types and values defined in General are available unqualified in the top-level environment.

See also: Ref


________ Import ______________________________________________________

Imported implicitly.


________ Interface ___________________________________________________

    signature GENERAL =
    sig
	eqtype unit
	exttype exn

	datatype order = LESS | EQUAL | GREATER

	exception Bind
	exception Chr
	exception Div
	exception Domain
	exception Fail of string
	exception Match
	exception Overflow
	exception Size
	exception Span
	exception Subscript
	exception Unordered

	val exnName :    exn -> string
	val exnMessage : exn -> string

	val inverse :    order -> order

	val ! :          'a ref -> 'a
	val op := :      'a ref * 'a -> unit
	val op :=: :     'a ref * 'a ref -> unit

	val ignore :     'a -> unit
	val before :     'a * unit -> 'a

	val id :         'a -> 'a
	val const :      'a -> 'b -> 'a
	val curry :      ('a * 'b -> 'c) -> ('a -> 'b -> 'c)
	val uncurry :    ('a -> 'b -> 'c) -> ('a * 'b -> 'c)
	val flip :       ('a * 'b -> 'c) -> ('b * 'a -> 'c)
	val op o :       ('b -> 'c) * ('a -> 'b) -> 'a -> 'c
    end
  

________ Description _________________________________________________

Items not described here are as in the Standard ML Basis' General structure.

exception Unordered

Indicates that two values are incomparable with respect to a partial ordering.

inverse order

Returns the inverse of the argument order.

re1 :=: re2

Swaps the values referred to by the references re1 and re2.

id x

The polymorphic identity function, i.e.

        id x = x

for any value x.

const x

Creates a constant function that returns x for any application. The following equivalence holds:

        const x y = x

for any values x and y.

curry f
uncurry f

Creates a curried function from the uncurried argument function f. The function uncurry is the inverse. The following equivalence holds:

        curry f x y = f (x, y)
        uncurry f (x, y) = f x y

for any values x and y.

flip f

Creates a function that takes its arguments in the opposite order of function f. The following equivalence holds:

        flip f (x, y) = f (y, x)

for any values x and y.



last modified 1970/01/01 01:00