On Wed, Dec 01, 1999 at 01:33:01PM +0100, Ch. A. Herrmann wrote:
> Hello,
> 
> > operators with suitable associations defined). So
> > my symbolic expression type should be an instance
> > of the Num class so that the (+) operator can
> > be overloaded for it. But, as the function has
> > now three arguments, it cannot be a binary operator
> > anymore.
> 
> maybe, an ad-hoc solution is to use an interpreter
> which takes your infix expressions as strings and evaluates them in
> the environment you like.

This is not a solution for my problem, because what am developing
is a library in Haskell for symbolic manipulation. So the user of
the library will be programming in Haskell. An interpreter at this
level would be inadequate.

I have developed a solution in the current version of my library
(in Clean) in which I have had a different approach: the environment
was attached to the expressions been evaluated. But it seems to
have some problems... I have also developed an interpreter (in Clean)
that reads symbolic expressions, parses them, simplify them and
prints the result. The parser converts from strings to the representation
used in the library for the symbolic expressions. But this
interpreter is just an application of the library, not its goal.

> 
> For the future, I would appreciate a redesign of the overloading
> of operators in Haskell, such that any (also predefined) operator
> can be overloaded according to the users taste,
> e.g., to form an expression like
> 
>         expr1 +e expr2
> 
> where e is some environment and the above expression is shorthand for 
> 
>         (+) e expr1 expr2.
> 
> -- 
>  Christoph Herrmann
>  E-mail:  [EMAIL PROTECTED]
>  WWW:     http://brahms.fmi.uni-passau.de/cl/staff/herrmann.html
> 
> 
> 
> 

-- 
Prof. José Romildo Malaquias <[EMAIL PROTECTED]>
Departamento de Computação
Universidade Federal de Ouro Preto
Brasil

Reply via email to