Andreas C. Doering <[EMAIL PROTECTED]> writes
> As I understand the problem right,
> there is a need for classes computed dynamically
> like remainder rings polynomial rings and so forth.
No. Several classes are declared and fixed.
And there have to be generated dynamically and exploited several
*domains* (or type+instance -s) D(p) of one the classes C
defined by different parameter values p_1,p_2...,
p_i are the "usual" values, like Char, Int, [String] ...
> Let us call the mathematical Object R(a) where a
> is the (runtime) parameter which determines the object needed.
> This can be the variable set (and ordering), the modulo and so forth.
>
> In principal I see three ways:
> A) Use the sample argument:
> [..]
The matter is that I could not sensibly apply any other approach, so
far.
Now, the question is whether the constructor classes with the local
universal quantification can help.
> B) Make the parameter $a$ explicit. Use a pair (a,v) for
> every element: v is the value, a is the universe parameter.
> Then, constants are a function requiring a.
> [..]
I am not sure I understand this, but maybe, some analog was given
in the previous letters by Kowalczyk, Mechveliani, with (r vv),
r a "variable" type constructor, v :: vv a parameter.
> C) Make this need a language construct, that is make
> types with value parameters. Then it is explicit to the compiler,
> what is only type information and what is "value". The problem is,
> that the type information is run-time dependent and has the character
> of a value.
> Some problems:
> say we define a operation crt
> crt :: R(a) -> R(b) -> R(c)
> (Combination of two numbers in Z/a and Z/b into Z/(a*b),
> if ggt(a,b)=1)
> The implementation of crt would need the values a and b.
> The question is when the condition c=a*b is checked.
Slightly more precise. When a = residue of 1 in Z/(n) and
b = residue of 2 in Z/(m)
are summed by a+b, a, b should be of the same domain Z/(n).
When and whether at all this is checked?
With the sample argument approach, the user program *may* extract
the base from a, from b and compare at the run-time - if one
cares.
------------------
Sergey Mechveliani
[EMAIL PROTECTED]