opPow, opDollar

Stewart Gordon smjg_1998 at yahoo.com
Sun Nov 8 08:42:31 PST 2009


Matti Niemenmaa wrote:
<snip>
> It's essentially because Haskell has separate type classes (kiiiinda 
> like D interfaces... I won't go into that topic) for integers, 
> fractional numbers, and floating-point numbers. In D the types of those 
> three operators could be something like:
> 
> anyinteger     ^(anyinteger    base, anyinteger  exponent);
> anyfractional ^^(anyfractional base, anyinteger  exponent);
> anyfloating   **(anyfloating   base, anyfloating exponent);
<snip>

You've merely expanded on what I'd already made out - it doesn't explain 
why these generic functions can't share the same name.  Is it because 
Haskell doesn't support function overloading as D does, or for some 
other reason?

Stewart.



More information about the Digitalmars-d mailing list