Hi Sergei,

On 03/03/2012 10:32 AM, Serge D. Mechveliani wrote:
And I am going to build constructions like this:

     constr :=  UPConstr(x, FrCons("Int" :: Symbol))

And to analyse it like this

   f(constr) ==
          constr case of Fr =>
                             constr' := frConstrArg constr
                             process the argument construction  constr'
          constr case of UP' =>
              x       := upConstrVar  constr
              cConstr := upConstrCoef constr
              process x and the coefficient domain construction  cConstr

This approach looks rather complex, and even requires to introduce a
category.
I thought of SExpression. But, for example,
                           convert[UP', x, coefConstr'] :: SExpressin

requires of  UP', x, constr'  to be of the same type. Right?
One neds to union the  constructor tags,  parameters (like x),
and domain constructions  into a certain type  U,  and to program
processing the data in  List U  ...

Can you be a bit more precise? All I see is some code that looks like Haskell and would certainly not be the way it would be programmed in SPAD. It would be helpful, if you state, what you actually want to achieve. From what I've read in your mail, all I can say is that you want something like Any, but not encoding every type. In other words, I think that you want tagged unions, but I'm not quite sure.

However, if you want something like Any or tagged union, then it looks like you basically want to throw away the type information. I'm sure there is some better way to achieve your goal in SPAD, but what is your goal?

Ralf

--
You received this message because you are subscribed to the Google Groups "FriCAS - 
computer algebra system" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/fricas-devel?hl=en.

Reply via email to