Miscellany
Bits and bobs not belonging to the main features of the package, but needed by the package and useful nonetheless.
Contents
Default associative arrays
The new type AssocDflt
is an associative array with a default value. Hence it may be used to describe a function which is constant save for finitely many exceptions.
IsCoercible_DefaultAssociativeArray (x)
-> BoolElt, AssocDflt
True if we can create a default associative array with default x
.
IsCoercible_DefaultAssociativeArray (x, keys, values)
-> BoolElt, AssocDflt
True if we can create a default associative array with default x
and given keys
and values
.
IsCoercible_DefaultAssociativeArray (x, y)
IsCoercible_DefaultAssociativeArray (x, y :: Assoc)
IsCoercible_DefaultAssociativeArray (x, y :: [Tup])
-> BoolElt, AssocDflt
True if we can create a default associative array with default x
and values y
.
DefaultAssociativeArray (x)
-> AssocDflt
The default associative array with default value x
.
DefaultAssociativeArray (x, ys)
-> AssocDflt
The default associative array with default value x
and keys and values specified by ys
(an associative array or sequence of <key,value> pairs).
DefaultAssociativeArray (x, keys, values)
-> AssocDflt
The default associative array with default value x
, and given keys
and values
.
Print (x :: AssocDflt, lvl :: MonStgElt)
Print.
'@' (i, x :: AssocDflt)
-> Any
The value at index i
of x
.
ApplyPointwise (f, x :: AssocDflt, y :: AssocDflt)
-> AssocDflt
Applies the function f
pointwise to values of x
and y
.
ApplyPointwise (f, x :: AssocDflt)
-> AssocDflt
Applies the function f
pointwise to values of x
.
Image (x :: AssocDflt)
-> {}
The set of possible output values.
DefaultValue (x :: AssocDflt)
-> Any
The default value of x
.
SpecialAssociativeArray (x :: AssocDflt)
-> Assoc
The associative array of the special values of x
.
SpecialKeys (x :: AssocDflt)
-> Assoc
The keys of special values of x
.
Zip (xs :: [AssocDflt])
-> AssocDflt
The array [i] -> [x(i) : x in xs
]. The inputs must have compatible indices.
ZipApplyPointwise (f, xs :: [AssocDflt])
-> AssocDflt
The array [i] -> f
([x(i) : x in xs
]). Equivalent to ApplyPointwise(f
,Zip(xs
)).
ForAll (x :: AssocDflt, f)
-> BoolElt
True if f
(x
(i)) is true for all i.
ForAll (x :: AssocDflt, y :: AssocDflt, f)
-> BoolElt
True if f
(x
(i),y
(i)) is true for all i.
Promotion
A basic scheme for promoting values in different structures to a common strucure.
IsPromotable (x, y)
-> BoolElt, Any, Any
True if x
and y
are promotable to the same parent.
Promote (x, y)
-> Any, Any
Promotes x
and y
to a common type.