On 24-Mar-1999, S.D.Mechveliani <[EMAIL PROTECTED]> wrote:
> 
> Who knows, has it sense to write things like
> 
>   instance AddSemigroup Int where add = Prelude.plusInt
> ?
> I mean some primitive operations instead of overloaded (+), (-) ...
> placed above after `='.
> Does Haskell-98 provide such primitives?

No.

> I suspect that one has to set (+), and to hope the compiler would 
> substitute the needed primitive thing.

Yes.  I think there is nothing wrong with relying on that.
The optimization is a quite straight-forward one, and is very useful
for other purposes too, so any mature optimizing implementation of Haskell
should do it.  I don't think it would be worth complicating the language
definition and complicating programs by defining primitives
for all those kind of operations.

-- 
Fergus Henderson <[EMAIL PROTECTED]>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger [EMAIL PROTECTED]        |     -- the last words of T. S. Garp.


Reply via email to