| I am part of a group working on a new language for Microwave hardware
| design (MHDL). As it turns out, we are incorporating almost all of
| Haskell 1.2 into it.
If there is anything written about this language, please send a pointer
to this mailing list; and please keep us appraised of your progress.
It's always good to know of applications of functional programming.
| We cannot do this in Haskell, and we cannot do this in Gofer either
| because all type variables in the class signature have to be mentioned
| in all the method signatures.
The restriction you mention in Gofer ("all type variables in the class
signature have to be mentioned in all the method signatures") might be
avoided by simply using a separate class to define each operator.
| | Aside:
| | The fact that ti _must_ mention u1, but may or may not mention u2,
| | ..., uk is the significant change from Gofer (and Haskell, which
| | only allows one type variable in the class declaration). We think
| | that this would allow disambiguation with the "ease" of Haskell, but
| | still allow us the power of multiple class parameters in class
| | declarations.
This will allow easy disambiguation if you require that each instance
of the class differs in the first parameter. But if you allow
instance DemoClass Int Char where ...
instance DemoClass Int Bool where ...
then disambiguation will not be so easy.
| Our question to the gurus is the following: is this too much to ask?
| Are we going to mess up the typing philosophy of Haskell with this?
The only way to get a sure answer to these questions is to write a
formal specification of your system, and to convince yourself that
you have a type inference algorithm that is sound and complete with
respect to this system (e.g., yields principle types). I strongly
urge you complete some sort of formal specification before you begin
implementation.
The GRASP team at Glasgow is putting the finishing touches on a paper
that formally describes type classes as implemented in Haskell, which
you may find helpful. We will post a pointer to this paper when it's
done. I hope Mark Jones and Martin Odersky will also post pointers to
their recent work in this area.
Cheers, -- P