26.1 : Array S
Description:
`Array(S)' is the domain of mono-dimensional arrays over S.
The arrays are 1-based, i.e. if `v' is an array then `v.1' is its first element.
See also `ArrayCategory'.
Parameter:
Returns:
- ArrayCategory(S) with exports
Categories satisfied:
Aggregate(S),
ArrayCategory(S),
BasicType,
FiniteAggregate(S),
FiniteLinearAggregate(S),
LinearAggregate(S)
Cascaded exports: S
Exports:
-
`array(t)' creates an array from a tuple.
-
`array(g)' creates an array from a generator.
=, ~= : | (%, %) -> Boolean | from BasicType |
<< : | (TextWriter, %) -> TextWriter | from BasicType |
<< : | % -> TextWriter -> TextWriter | from BasicType |
# : | % -> SingleInteger | from FiniteAggregate(S) |
-
`empty!(v)' resets `v' to have no elements.
-
`extend!(v,s)' adds the element `s' to the end of `v'.
new : | (SingleInteger, S) -> % | |
`new(n,s)' creates a new array with `n' elements, each initialized to
`s'.
set! : | (%, SingleInteger, S) -> S | from ArrayCategory |
dispose! : | % -> () | from ArrayCategory |
empty? : | % -> Boolean | from Aggregate(S) |
generator : | % -> Generator(S) | from Aggregate(S) |
map : | (S -> S, %) -> % | from Aggregate(S) |
empty : | () -> % | from LinearAggregate(S) |
bracket : | Generator(S) -> % | from LinearAggregate(S) |
bracket : | Tuple(S) -> % | from LinearAggregate(S) |
map : | ((S, S) -> S, %, %) -> % | from LinearAggregate(S) |
apply : | (%, SingleInteger) -> S | from LinearAggregate(S) |
-
hash : | % -> SingleInteger | from BasicType |
26.3 : Boolean
Description:
The Boolean datatype supports logical operations.
Both arguments of the binary operations are always evaluated.
Returns:
- Join(Conditional, Logic, OrderedFinite) with exports
Categories satisfied:
BasicType,
Conditional,
Finite,
Logic,
Order,
OrderedFinite
Exports:
-
-
false is the constant representing logical falsity.
true is the constant representing logical truth.
coerce : | (Bool$Machine) -> % | |
coerce : | % -> (Bool$Machine) | |
Cast from and to the internal builtin representation.
/\ : | (%, %) -> % | from Logic |
\/ : | (%, %) -> % | from Logic |
Logical `and' and `or' operations. Note that both the arguments are evaluated.
=, ~= : | (%, %) -> Boolean | from BasicType |
<< : | (TextWriter, %) -> TextWriter | from BasicType |
<< : | % -> TextWriter -> TextWriter | from BasicType |
-
-
Number of elements in the domain. In this case, 2.
test : | % -> Boolean | from Conditional |
-
-
-
-
<, >, >=, <= : | (%, %) -> Boolean | from Order |
<, >, >=, <= : | (%, %) -> Cross(Boolean, %) | from Order |
<, >, >=, <= : | (Cross(Boolean, %), %) -> Cross(Boolean, %) | from Order |
<, >, >=, <= : | (Cross(Boolean, %), %) -> Boolean | from Order |
min, max : | % | from OrderedFinite |
-
hash : | % -> SingleInteger | from BasicType |
26.4 : Byte
Description:
Byte implements single byte integers, typically 8 bits.
Returns:
- Join(Logic, OrderedFinite, OrderedRing)
Categories satisfied:
AbelianGroup,
AbelianMonoid,
ArithmeticSystem,
BasicType,
Finite,
Logic,
Monoid,
Order,
OrderedAbelianGroup,
OrderedAbelianMonoid,
OrderedFinite,
OrderedRing,
Ring
Exports:
coerce : | (XByte$Machine) -> % | |
coerce : | % -> (XByte$Machine) | |
coerce : | Integer -> % | from ArithmeticSystem |
coerce : | SingleInteger -> % | from ArithmeticSystem |
=, ~= : | (%, %) -> Boolean | from BasicType |
<< : | (TextWriter, %) -> TextWriter | from BasicType |
<< : | % -> TextWriter -> TextWriter | from BasicType |
-
/\ : | (%, %) -> % | from Logic |
\/ : | (%, %) -> % | from Logic |
-
<, >, >=, <= : | (%, %) -> Boolean | from Order |
<, >, >=, <= : | (%, %) -> Cross(Boolean, %) | from Order |
<, >, >=, <= : | (Cross(Boolean, %), %) -> Cross(Boolean, %) | from Order |
<, >, >=, <= : | (Cross(Boolean, %), %) -> Boolean | from Order |
min, max : | % | from OrderedFinite |
-
1 : | % | from ArithmeticSystem |
+ : | % -> % | from AbelianMonoid |
+ : | (%, %) -> % | from AbelianMonoid |
- : | % -> % | from AbelianGroup |
- : | (%, %) -> % | from AbelianGroup |
* : | (%, %) -> % | from ArithmeticSystem |
^ : | (%, Integer) -> % | from ArithmeticSystem |
zero? : | % -> Boolean | from AbelianMonoid |
negative? : | % -> Boolean | from OrderedRing |
positive? : | % -> Boolean | from OrderedRing |
abs : | % -> % | from OrderedRing |
sign : | % -> % | from OrderedRing |
-
hash : | % -> SingleInteger | from BasicType |
26.5 : Character
Description:
Characters for natural language text.
In the portable byte code files, characters are represented in ASCII.
In a running program, characters are represented according to the
machine's native character set, e.g. ASCII or EBCDIC.
Returns:
- OrderedFinite with exports
Categories satisfied:
BasicType,
Finite,
Order,
OrderedFinite
Exports:
-
`char(s)' returns the character corresponding to the first
letter of `s'.
-
`char(s)' returns the character whose code is `s', e.g.~the letter
`a' has code 97.
coerce : | (Char$Machine) -> % | |
coerce : | % -> (Char$Machine) | |
Coerce from and to the internal builtin representation
-
`ord(s)' returns the code for character `s'.
=, ~= : | (%, %) -> Boolean | from BasicType |
-
<< : | (TextWriter, %) -> TextWriter | from BasicType |
<< : | % -> TextWriter -> TextWriter | from BasicType |
-
-
`digit?(c)' returns true if and only if `c' is in 0..9.
`letter?(c)' returns true if and only if `c' is in a..z or in
A..Z.
-
-
`lower(c)' returns the corresponding lower case letter if `c'
is an upper case letter, otherwise `c'.
`upper(c)' returns the corresponding upper case letter if `c'
is a lower case letter, otherwise `c'.
-
<, >, >=, <= : | (%, %) -> Boolean | from Order |
<, >, >=, <= : | (%, %) -> Cross(Boolean, %) | from Order |
<, >, >=, <= : | (Cross(Boolean, %), %) -> Cross(Boolean, %) | from Order |
<, >, >=, <= : | (Cross(Boolean, %), %) -> Boolean | from Order |
min, max : | % | from OrderedFinite |
-
hash : | % -> SingleInteger | from BasicType |
26.7 : Complex R
Description:
Complex(R) implements complex numbers over a field, `R'.
Domains created by the constructor are fields and implement additional
operations to manipulate the real and imaginary parts of complex numbers.
Parameter:
Returns:
Categories satisfied:
AbelianGroup,
AbelianMonoid,
ArithmeticSystem,
BasicType,
EuclideanDomain,
Field,
Group,
Monoid,
Ring
Cascaded exports: R
Exports:
-
`complex(r, i)' creates a complex number with real
part `r' and imaginary part `i'.
-
-
`real(c)' returns the real part of the complex number `c'.
`imag(c)' returns the imaginary part of the complex
number `c'.
-
coerce : | Integer -> % | from ArithmeticSystem |
coerce : | SingleInteger -> % | from ArithmeticSystem |
=, ~= : | (%, %) -> Boolean | from BasicType |
<< : | (TextWriter, %) -> TextWriter | from BasicType |
<< : | % -> TextWriter -> TextWriter | from BasicType |
-
`r * c' is the product of the real number `r' and the
complex number `c'.
-
`c * r' is the product of the complex number `c' and
the real number `r'.
-
`c / r' is the quotient of the complex number `c' and
the real number `r'.
-
`%i' is the literal constant `i = complex(0,1)'.
-
`norm(c)' computes the algebraic norm of `c'.
This is `real(c)^2 + imag(c)^2'.
-
`conjugate(c)' returns the complex conjugate of the complex
number `c'.
0 : | % | from ArithmeticSystem |
1 : | % | from ArithmeticSystem |
+ : | % -> % | from ArithmeticSystem |
+ : | (%, %) -> % | from ArithmeticSystem |
- : | % -> % | from ArithmeticSystem |
- : | (%, %) -> % | from ArithmeticSystem |
* : | (%, %) -> % | from ArithmeticSystem |
^ : | (%, Integer) -> % | from ArithmeticSystem |
-
-
zero? : | % -> Boolean | from AbelianMonoid |
gcd : | (%, %) -> % | from EuclideanDomain |
quo : | (%, %) -> % | from EuclideanDomain |
rem : | (%, %) -> % | from EuclideanDomain |
divide : | (%, %) -> (%, %) | from EuclideanDomain |
-
-
hash : | % -> SingleInteger | from BasicType |
26.8 : DoubleFloat
Description:
`DoubleFloat' implements double-precision floating point numbers.
In the portable byte code files, double precision floats are represented in
a format capable of representing IEEE extended double precision.
In a running program, double precision floats are represented according
to the machine's native arithmetic.
Returns:
- Join(OrderedFinite, FloatingPointNumberSystem) with exports
Categories satisfied:
AbelianGroup,
AbelianMonoid,
ArithmeticSystem,
BasicType,
EuclideanDomain,
Field,
Finite,
FloatingPointNumberSystem,
Group,
Monoid,
Order,
OrderedAbelianGroup,
OrderedAbelianMonoid,
OrderedFinite,
OrderedRing,
Ring
Cascaded exports: RoundingMode
Exports:
float : | Literal -> % | from FloatingPointNumberSystem |
step : | SingleInteger -> (%, %) -> Generator(%) | from FloatingPointNumberSystem |
coerce : | (DFlo$Machine) -> % | |
coerce : | % -> (DFlo$Machine) | |
Coerce from and to the internal builtin representation
coerce : | Integer -> % | from ArithmeticSystem |
coerce : | SingleInteger -> % | from ArithmeticSystem |
integer : | % -> Integer | from FloatingPointNumberSystem |
fraction : | % -> % | from FloatingPointNumberSystem |
round : | (%, RoundingMode) -> Integer | from FloatingPointNumberSystem |
=, ~= : | (%, %) -> Boolean | from BasicType |
<< : | (TextWriter, %) -> TextWriter | from BasicType |
<< : | % -> TextWriter -> TextWriter | from BasicType |
-
-
1 : | % | from ArithmeticSystem |
+ : | % -> % | from AbelianMonoid |
+ : | (%, %) -> % | from AbelianMonoid |
- : | % -> % | from AbelianGroup |
- : | (%, %) -> % | from AbelianGroup |
* : | (%, %) -> % | from ArithmeticSystem |
^ : | (%, Integer) -> % | from ArithmeticSystem |
-
-
<, >, >=, <= : | (%, %) -> Boolean | from Order |
<, >, >=, <= : | (%, %) -> Cross(Boolean, %) | from Order |
<, >, >=, <= : | (Cross(Boolean, %), %) -> Cross(Boolean, %) | from Order |
<, >, >=, <= : | (Cross(Boolean, %), %) -> Boolean | from Order |
<< : | (%, %) -> Boolean | from FloatingPointNumberSystem |
>> : | (%, %) -> Boolean | from FloatingPointNumberSystem |
min, max : | % | from OrderedFinite |
zero? : | % -> Boolean | from AbelianMonoid |
negative? : | % -> Boolean | from OrderedRing |
positive? : | % -> Boolean | from OrderedRing |
abs : | % -> % | from OrderedRing |
sign : | % -> % | from OrderedRing |
gcd : | (%, %) -> % | from EuclideanDomain |
quo : | (%, %) -> % | from EuclideanDomain |
rem : | (%, %) -> % | from EuclideanDomain |
divide : | (%, %) -> (%, %) | from EuclideanDomain |
-
-
hash : | % -> SingleInteger | from BasicType |
26.11 : Float
Description:
`Float' implements arbitrary precision floating
point arithmetic.
The number of significant digits of each operation can be set
to an arbitrary value (the default is 20 decimal digits).
The operation `float(significand, exponent, base)'
for integer `significand', `exponent' specifies the number
`significand * base (exponent)'.
The underlying representation for floats is binary
not decimal. The implications of this are described below.
The model adopted is that arithmetic operations are rounded to the
nearest unit in the last place, that is, accurate to within
`2(-bits)'.
Also, the elementary functions and constants are
accurate to one unit in the last place. A float is represented as a
record of two integers, the significand and the exponent. The base
of the representation is binary, hence a
`Record(m: significand, e: exponent)'
represents the number `m * 2e'. Though it is not
assumed that the underlying integers are represented with a binary
base, the code will be most efficient when this is the the case. The
decision to choose the base to be binary has some unfortunate
consequences. First, decimal numbers like 0.3 cannot be represented
exactly. Second, there is a further loss of accuracy during
conversion to decimal for output. To compensate for this, if d digits
of precision are specified, `1 + ceiling(log2 d)' bits are used.
Two numbers that are displayed identically may therefore not in fact be equal.
On the other hand, a significant efficiency loss would be incurred if
we chose to use a decimal base when the underlying integer base is
binary.
Returns:
- Join(OrderedRing, Field) with exports
Categories satisfied:
AbelianGroup,
AbelianMonoid,
ArithmeticSystem,
BasicType,
EuclideanDomain,
Field,
Group,
Monoid,
Order,
OrderedAbelianGroup,
OrderedAbelianMonoid,
OrderedRing,
Ring
Cascaded exports: RoundingMode
Exports:
float : | Literal -> % | from FloatingPointNumberSystem |
step : | SingleInteger -> (%, %) -> Generator(%) | from FloatingPointNumberSystem |
-
makeFloat : | SingleInteger -> % | |
-
-
`integer(f)' returns the integer part of `f'. `fraction(f)'
returns the fractional part of `f' as a float.
round : | (%, mode: RoundingMode == nearest()) -> Integer | |
-
coerce : | SingleInteger -> % | |
=, ~= : | (%, %) -> Boolean | from BasicType |
<< : | (TextWriter, %) -> TextWriter | from BasicType |
<< : | % -> TextWriter -> TextWriter | from BasicType |
-
1 : | % | from ArithmeticSystem |
+ : | % -> % | from AbelianMonoid |
+ : | (%, %) -> % | from AbelianMonoid |
- : | % -> % | from AbelianGroup |
- : | (%, %) -> % | from AbelianGroup |
exponent, significand : | % -> Integer | |
<, >, >=, <= : | (%, %) -> Boolean | from Order |
<, >, >=, <= : | (%, %) -> Cross(Boolean, %) | from Order |
<, >, >=, <= : | (Cross(Boolean, %), %) -> Cross(Boolean, %) | from Order |
<, >, >=, <= : | (Cross(Boolean, %), %) -> Boolean | from Order |
min, max : | (%, %) -> % | from Order |
zero? : | % -> Boolean | from AbelianMonoid |
-
* : | (%, %) -> % | from ArithmeticSystem |
^ : | (%, Integer) -> % | from ArithmeticSystem |
abs : | % -> % | from OrderedRing |
sign : | % -> % | from OrderedRing |
negative?, positive? : | % -> Boolean | from OrderedRing |
gcd : | (%, %) -> % | from EuclideanDomain |
quo, rem : | (%, %) -> % | from EuclideanDomain |
divide : | (%, %) -> (%, %) | from EuclideanDomain |
-
-
-
decreasePrecision, increasePrecision : | Integer -> Integer | |
-
`bits()' returns the current precision in bits.
-
`bits(n)' sets the current precision to `n' bits.
-
-
-
-
`normalize(f)' normalizes `f' at the current precision.
relerror : | (%, %) -> Integer | |
`relerror(x,y)' computes the absolute value of `(x-y)/y' when `y'
is non-zero.
-
-
-
-
-
-
-
-
-
-
`outputFloating()' sets the output mode to floating (scientific)
notation, i.e. `mantissa * 10 exponent' is displayed as `0.mantissa E exponent'.
outputFloating : | Integer -> () | |
`outputFloating(n)' sets the output mode to floating (scientific)
notation with `n' significant digits displayed after the decimal point.
-
`outputFixed()' sets the output mode to fixed point notation;
the output will contain a decimal point.
outputFixed : | Integer -> () | |
`outputFixed(n)' sets the output mode to fixed point notation,
with `n' digits displayed after the decimal point.
-
`outputGeneral()' sets the output mode (default mode) to general
notation; numbers will be displayed in either fixed or floating
(scientific) notation depending on the magnitude.
outputGeneral : | Integer -> () | |
`outputGeneral(n)' sets the output mode to general notation
with `n' significant digits displayed.
outputSpacing : | SingleInteger -> () | |
`outputSpacing(n) 'inserts a space after
`n' (default 10) digits on output;
`outputSpacing(0)' means no spaces are inserted.
-
`digits()' returns the current precision in decimal digits.
digits : | Integer -> Integer | |
`digits(n)' sets the current precision to `n' decimal digits.
-
hash : | % -> SingleInteger | from BasicType |
26.15 : HalfInteger
Description:
`HalfInteger' implements half-precision integers, typically 16 bits.
Returns:
- Join(Logic, OrderedFinite, OrderedRing)
Categories satisfied:
AbelianGroup,
AbelianMonoid,
ArithmeticSystem,
BasicType,
Finite,
Logic,
Monoid,
Order,
OrderedAbelianGroup,
OrderedAbelianMonoid,
OrderedFinite,
OrderedRing,
Ring
Exports:
coerce : | (HInt$Machine) -> % | |
coerce : | % -> (HInt$Machine) | |
Coerce from and to the internal builtin representation
coerce : | Integer -> % | from ArithmeticSystem |
coerce : | SingleInteger -> % | from ArithmeticSystem |
=, ~= : | (%, %) -> Boolean | from BasicType |
<< : | (TextWriter, %) -> TextWriter | from BasicType |
<< : | % -> TextWriter -> TextWriter | from BasicType |
-
/\ : | (%, %) -> % | from Logic |
\/ : | (%, %) -> % | from Logic |
-
<, >, >=, <= : | (%, %) -> Boolean | from Order |
<, >, >=, <= : | (%, %) -> Cross(Boolean, %) | from Order |
<, >, >=, <= : | (Cross(Boolean, %), %) -> Cross(Boolean, %) | from Order |
<, >, >=, <= : | (Cross(Boolean, %), %) -> Boolean | from Order |
min, max : | % | from OrderedFinite |
-
1 : | % | from ArithmeticSystem |
+ : | % -> % | from AbelianMonoid |
+ : | (%, %) -> % | from AbelianMonoid |
- : | % -> % | from AbelianGroup |
- : | (%, %) -> % | from AbelianGroup |
* : | (%, %) -> % | from ArithmeticSystem |
^ : | (%, Integer) -> % | from ArithmeticSystem |
zero? : | % -> Boolean | from AbelianMonoid |
negative? : | % -> Boolean | from OrderedRing |
positive? : | % -> Boolean | from OrderedRing |
abs : | % -> % | from OrderedRing |
sign : | % -> % | from OrderedRing |
-
hash : | % -> SingleInteger | from BasicType |
26.16 : HashTable(Key, Value)
Description:
`HashTable(Key, Val)' provides a parameterized hash-table datatype.
Parameters:
Returns:
Categories satisfied:
BasicType
Cascaded exports: Key, Value
Exports:
=, ~= : | (%, %) -> Boolean | from BasicType |
<< : | (TextWriter, %) -> TextWriter | from BasicType |
<< : | % -> TextWriter -> TextWriter | from BasicType |
-
table : | ((Key, Key) -> Boolean, Key -> SingleInteger) -> % | |
`table()' creates a new table using the equality test `=' and the
hash function `hash' from the `Key' type.
`table(=, hash)' creates a new hash table using the equality test
`=' and the hash function `hash'.
-
`eqtable()' creates a new table using instance equality.
-
`copy(t)' creates a copy of the table `t'.
-
`#t' returns the number of elements in `t'.
search : | (%, Key, Value) -> (Boolean, Value) | |
`(b,v) := search(t,k,d)' searches table `t' for the value
associated with key `k'. If there is such a value, `vk',
then `b' is set to `true' and `v' is set to `vk'.
Otherwise `b' is `false' and `v' is set to `d'.
-
`t.k' searches the table `t' for the value associated with
the key `k'. It is an error if there is no value for `k'.
set! : | (%, Key, Value) -> Value | |
`t.k := val' associates `val' with `k' in `t'.
-
`drop!(t, k)' removes the entry for `k' in `t'.
-
`dispose! t' indicates a table will no longer be used.
generator : | % -> Generator(Cross(Key, Value)) | |
`generator(t)' is a generator which produces all the
`(key, value)' pairs from `t'.
-
hash : | % -> SingleInteger | from BasicType |
26.18 : Integer
Description:
`Integer' provides operations for arbitrary precision (big) integer arithmetic.
Returns:
- Join(Steppable, IntegerNumberSystem) with exports
Categories satisfied:
AbelianGroup,
AbelianMonoid,
ArithmeticSystem,
BasicType,
EuclideanDomain,
IntegerNumberSystem,
Monoid,
Order,
OrderedAbelianGroup,
OrderedAbelianMonoid,
OrderedRing,
Ring,
Steppable
Cascaded exports: Segment Integer
Exports:
-
coerce : | SingleInteger -> % | |
coerce : | Integer -> % | from ArithmeticSystem |
coerce : | % -> (BInt$Machine) | |
coerce : | (BInt$Machine) -> % | |
Coerce from and to the internal builtin representation
=, ~= : | (%, %) -> Boolean | from BasicType |
<< : | (TextWriter, %) -> TextWriter | from BasicType |
<< : | % -> TextWriter -> TextWriter | from BasicType |
<, >, >=, <= : | (%, %) -> Boolean | from Order |
<, >, >=, <= : | (%, %) -> Cross(Boolean, %) | from Order |
<, >, >=, <= : | (Cross(Boolean, %), %) -> Cross(Boolean, %) | from Order |
<, >, >=, <= : | (Cross(Boolean, %), %) -> Boolean | from Order |
min,max : | (%, %) -> % | from Order |
-
1 : | % | from ArithmeticSystem |
+ : | % -> % | from AbelianMonoid |
+ : | (%, %) -> % | from AbelianMonoid |
- : | % -> % | from AbelianGroup |
- : | (%, %) -> % | from AbelianGroup |
* : | (%, %) -> % | from ArithmeticSystem |
^ : | (%, Integer) -> % | from ArithmeticSystem |
zero? : | % -> Boolean | from AbelianMonoid |
negative? : | % -> Boolean | from OrderedRing |
positive? : | % -> Boolean | from OrderedRing |
even? : | % -> Boolean | from IntegerNumberSystem |
odd? : | % -> Boolean | from IntegerNumberSystem |
single? : | % -> Boolean | from IntegerNumberSystem |
prev : | % -> % | from IntegerNumberSystem |
next : | % -> % | from IntegerNumberSystem |
mod : | (%, %) -> % | from IntegerNumberSystem |
length : | % -> SingleInteger | from IntegerNumberSystem |
shift : | (%, SingleInteger) -> % | from IntegerNumberSystem |
bit : | (%, SingleInteger) -> Boolean | from IntegerNumberSystem |
retract : | % -> SingleInteger | from IntegerNumberSystem |
gcd : | (%, %) -> % | from EuclideanDomain |
quo : | (%, %) -> % | from EuclideanDomain |
rem : | (%, %) -> % | from EuclideanDomain |
divide : | (%, %) -> (%, %) | from EuclideanDomain |
stepsBetween : | (%, %, %) -> SingleInteger | from Steppable |
stepsBetween : | (%, %) -> SingleInteger | from Steppable |
abs : | % -> % | from OrderedRing |
sign : | % -> % | from OrderedRing |
-
hash : | % -> SingleInteger | from BasicType |
26.20 : List S
Description:
`List(S)' is the domain of linked lists.
Parameter:
Returns:
Categories satisfied:
Aggregate(S),
BasicType,
Conditional,
FiniteAggregate(S),
FiniteLinearAggregate(S),
LinearAggregate(S),
ListCategory(S)
Cascaded exports: 'first', 'rest'
Exports:
=, ~= : | (%, %) -> Boolean | from BasicType |
<< : | (TextWriter, %) -> TextWriter | from BasicType |
<< : | % -> TextWriter -> TextWriter | from BasicType |
-
hash : | % -> SingleInteger | from BasicType |
empty? : | % -> Boolean | from Aggregate(S) |
generator : | % -> Generator(S) | from Aggregate(S) |
map : | (S -> S, %) -> % | from Aggregate(S) |
# : | % -> SingleInteger | from FiniteAggregate(S) |
empty : | () -> % | from LinearAggregate(S) |
bracket : | Generator(S) -> % | from LinearAggregate(S) |
bracket : | Tuple(S) -> % | from LinearAggregate(S) |
map : | ((S, S) -> S, %, %) -> % | from LinearAggregate(S) |
apply : | (%, SingleInteger) -> S | from LinearAggregate(S) |
test : | % -> Boolean | from Conditional |
nil : | % | from ListCategory(S) |
cons : | (S, %) -> % | from ListCategory(S) |
list : | Tuple(S) -> % | from ListCategory(S) |
list : | Generator(S) -> % | from ListCategory(S) |
first : | % -> S | from ListCategory(S) |
rest : | % -> % | from ListCategory(S) |
setFirst! : | (%, S) -> S | from ListCategory(S) |
setRest! : | (%, %) -> % | from ListCategory(S) |
apply : | (%, 'first') -> S | from ListCategory(S) |
apply : | (%, 'rest') -> % | from ListCategory(S) |
set! : | (%, 'first'), S) -> S | from ListCategory(S) |
set! : | (%, 'rest', %) -> % | from ListCategory(S) |
copy : | % -> % | from ListCategory(S) |
last : | % -> S | from ListCategory(S) |
reverse : | % -> % | from ListCategory(S) |
reverse! : | % -> % | from ListCategory(S) |
concat! : | (%, %) -> % | from ListCategory(S) |
concat : | (%, %) -> % | from ListCategory(S) |
reduce : | ((S, S) -> S, %, S) -> S | from ListCategory(S) |
member? : | (S, %) -> Boolean | from ListCategory(S) |
rest : | (%, SingleInteger) -> % | from ListCategory(S) |
tails : | % -> Generator(%) | from ListCategory(S) |
dispose! : | % -> () | from ListCategory(S) |
disposeHead! : | % -> % | from ListCategory(S) |
26.30 : Ratio I
Description:
`Ratio(I)' defines arithmetic on fractions over an IntegerNumberSystem.
Parameter:
Returns:
- Join(OrderedRing, Field) with exports
Categories satisfied:
AbelianGroup,
AbelianMonoid,
ArithmeticSystem,
BasicType,
EuclideanDomain,
Field,
Group,
Monoid,
Order,
OrderedAbelianGroup,
OrderedAbelianMonoid,
OrderedRing,
Ring
Cascaded exports: I
Exports:
-
`n / d' gives the rational number `n/d'. Note that the minimal
representation is chosen, so, for example, `3333/6666' is represented by `1/2'.
-
-
`numer(r)' returns the numerator of the rational number `r'.
`denom(r)' returns the denominator of the rational number `r'.
-
-
coerce : | Integer -> % | from ArithmeticSystem |
coerce : | SingleInteger -> % | from ArithmeticSystem |
=, ~= : | (%, %) -> Boolean | from BasicType |
<< : | (TextWriter, %) -> TextWriter | from BasicType |
<< : | % -> TextWriter -> TextWriter | from BasicType |
<, >, >=, <= : | (%, %) -> Boolean | from Order |
<, >, >=, <= : | (%, %) -> Cross(Boolean, %) | from Order |
<, >, >=, <= : | (Cross(Boolean, %), %) -> Cross(Boolean, %) | from Order |
<, >, >=, <= : | (Cross(Boolean, %), %) -> Boolean | from Order |
min, max : | (%, %) -> % | from Order |
-
1 : | % | from ArithmeticSystem |
+ : | % -> % | from AbelianMonoid |
+ : | (%, %) -> % | from AbelianMonoid |
- : | % -> % | from AbelianGroup |
- : | (%, %) -> % | from AbelianGroup |
* : | (%, %) -> % | from ArithmeticSystem |
-
-
^ : | (%, Integer) -> % | from ArithmeticSystem |
zero? : | % -> Boolean | from AbelianMonoid |
negative? : | % -> Boolean | from OrderedRing |
positive? : | % -> Boolean | from OrderedRing |
gcd : | (%, %) -> % | from EuclideanDomain |
quo : | (%, %) -> % | from EuclideanDomain |
rem : | (%, %) -> % | from EuclideanDomain |
divide : | (%, %) -> (%, %) | from EuclideanDomain |
-
sign : | % -> % | from OrderedRing |
abs : | % -> % | from OrderedRing |
-
hash : | % -> SingleInteger | from BasicType |
26.33 : SingleFloat
Description:
`SingleFloat' implements single-precision floating point numbers.
In the portable byte code files, single-precision floats are represented in
a format capable of representing IEEE extended single-precision.
In a running program, single-precision floats are represented according
to the machine's native arithmetic.
Returns:
- Join(OrderedFinite, FloatingPointNumberSystem) with exports
Categories satisfied:
AbelianGroup,
AbelianMonoid,
ArithmeticSystem,
BasicType,
EuclideanDomain,
Field,
Finite,
FloatingPointNumberSystem,
Group,
Monoid,
Order,
OrderedAbelianGroup,
OrderedAbelianMonoid,
OrderedFinite,
OrderedRing,
Ring
Cascaded exports: RoundingMode
Exports:
coerce : | (SFlo$Machine) -> % | |
coerce : | % -> (SFlo$Machine) | |
Coerce from and to the internal builtin representation
coerce : | Integer -> % | from ArithmeticSystem |
coerce : | SingleInteger -> % | from ArithmeticSystem |
integer : | % -> Integer | from FloatingPointNumberSystem |
fraction : | % -> % | from FloatingPointNumberSystem |
round : | (%, RoundingMode) -> Integer | from FloatingPointNumberSystem |
=, ~= : | (%, %) -> Boolean | from BasicType |
<< : | (TextWriter, %) -> TextWriter | from BasicType |
<< : | % -> TextWriter -> TextWriter | from BasicType |
-
<, >, >=, <= : | (%, %) -> Boolean | from Order |
<, >, >=, <= : | (%, %) -> Cross(Boolean, %) | from Order |
<, >, >=, <= : | (Cross(Boolean, %), %) -> Cross(Boolean, %) | from Order |
<, >, >=, <= : | (Cross(Boolean, %), %) -> Boolean | from Order |
min, max : | % | from OrderedFinite |
<< : | (%, %) -> Boolean | from FloatingPointNumberSystem |
>> : | (%, %) -> Boolean | from FloatingPointNumberSystem |
+ : | % -> % | from AbelianMonoid |
+ : | (%, %) -> % | from AbelianMonoid |
- : | % -> % | from AbelianGroup |
- : | (%, %) -> % | from AbelianGroup |
-
1 : | % | from ArithmeticSystem |
* : | (%, %) -> % | from ArithmeticSystem |
-
-
^ : | (%, Integer) -> % | from ArithmeticSystem |
abs : | % -> % | from OrderedRing |
sign : | % -> % | from OrderedRing |
zero? : | % -> Boolean | from AbelianMonoid |
negative? : | % -> Boolean | from OrderedRing |
positive? : | % -> Boolean | from OrderedRing |
gcd : | (%, %) -> % | from EuclideanDomain |
quo : | (%, %) -> % | from EuclideanDomain |
rem : | (%, %) -> % | from EuclideanDomain |
divide : | (%, %) -> (%, %) | from EuclideanDomain |
-
float : | Literal -> % | from FloatingPointNumberSystem |
step | SingleInteger -> (%, %) -> Generator(%) | from FloatingPointNumberSystem |
-
hash : | % -> SingleInteger | from BasicType |
26.34 : SingleInteger
Description:
`SingleInteger' implements single-precision integers, typically 32 bits.
Returns:
- Join(Logic, OrderedFinite, IntegerNumberSystem, Steppable) with exports
Categories satisfied:
AbelianGroup,
AbelianMonoid,
ArithmeticSystem,
BasicType,
EuclideanDomain,
IntegerNumberSystem,
Monoid,
Order,
OrderedAbelianGroup,
OrderedAbelianMonoid,
OrderedRing,
Ring,
Steppable
Cascaded exports: Segment SingleInteger
Exports:
integer : | Literal -> % | from IntegerNumberSystem |
-
-
-
coerce : | % -> (SInt$Machine | |
coerce : | (SInt$Machine) -> % | |
Coerce from and to the internal builtin representation
coerce : | Integer -> % | from ArithmeticSystem |
coerce : | SingleInteger -> % | from ArithmeticSystem |
=, ~= : | (%, %) -> Boolean | from BasicType |
<< : | (TextWriter, %) -> TextWriter | from BasicType |
<< : | % -> TextWriter -> TextWriter | from BasicType |
-
/\ : | (%, %) -> % | from Logic |
\/ : | (%, %) -> % | from Logic |
-
<, >, >=, <= : | (%, %) -> Boolean | from Order |
<, >, >=, <= : | (%, %) -> Cross(Boolean, %) | from Order |
<, >, >=, <= : | (Cross(Boolean, %), %) -> Cross(Boolean, %) | from Order |
<, >, >=, <= : | (Cross(Boolean, %), %) -> Boolean | from Order |
min, max : | % | from OrderedFinite |
-
1 : | % | from ArithmeticSystem |
+ : | % -> % | from AbelianMonoid |
+ : | (%, %) -> % | from AbelianMonoid |
- : | % -> % | from AbelianGroup |
- : | (%, %) -> % | from AbelianGroup |
* : | (%, %) -> % | from ArithmeticSystem |
^ : | (%, Integer) -> % | from ArithmeticSystem |
-
zero? : | % -> Boolean | from AbelianMonoid |
negative? : | % -> Boolean | from OrderedRing |
positive? : | % -> Boolean | from OrderedRing |
even? : | % -> Boolean | from IntegerNumberSystem |
odd? : | % -> Boolean | from IntegerNumberSystem |
single? : | % -> Boolean | from IntegerNumberSystem |
abs : | % -> % | from OrderedRing |
sign : | % -> % | from OrderedRing |
gcd : | (%, %) -> % | from EuclideanDomain |
quo : | (%, %) -> % | from EuclideanDomain |
rem : | (%, %) -> % | from EuclideanDomain |
divide : | (%, %) -> (%, % | from EuclideanDomain |
prev : | % -> % | from IntegerNumberSystem |
next : | % -> % | from IntegerNumberSystem |
mod : | (%, %) -> % | from IntegerNumberSystem |
length : | % -> SingleInteger | from IntegerNumberSystem |
shift : | (%, SingleInteger) -> % | from IntegerNumberSystem |
bit : | (%, SingleInteger) -> Boolean | from IntegerNumberSystem |
retract : | % -> SingleInteger | from IntegerNumberSystem |
mod_+, mod_-, mod_*, mod_^ : | (%, %, %) -> % | |
stepsBetween : | (%, %, %) -> SingleInteger | |
stepsBetween : | (%, %) -> SingleInteger | from Steppable |
-
hash : | % -> SingleInteger | from BasicType |