Hi Sergei,
Concerning
2. Here is a concrete and small contrived example/question presented by
an Haskell program.
of
http://groups.google.com/group/fricas-devel/browse_thread/thread/e2ed201491e8d2ab?hl=en
.
To be honest, I don't quite understand your problem.
Do you just want a way to print an object of a certain domain? In this
case implementing CoercibleTo(OutputForm) is the way to go. If you like
translate it into a category Show
Show: Category == CoercibleTo OutputForm
In your Haskell example you had to implement the function show for each
class. The same you must do for coerce: % -> OutputForm for each
respective domain.
I guess, you have already seen the following implementations.
https://github.com/hemmecke/fricas-svn/blob/master/src/algebra/product.spad.pamphlet#L57
https://github.com/hemmecke/fricas-svn/blob/master/src/algebra/fraction.spad.pamphlet#L66
https://github.com/hemmecke/fricas-svn/blob/master/src/algebra/list.spad.pamphlet#L99
That is in my eyes basically that what you want to achieve with your
Haskell example.
Did I misinterpret your question?
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.